this is you can insert in any cmd you want it work when you are near to that player you want to /jail/unjail/kick/ban/drown etc
i convert it from sq to pawn
Mirrorize 1
[pawn] if (GetPlayerDistance(playerid,plr) >= 3) {
SendClientMessage(playerid, RED, " You Have To Be Near To That Player");
}[/pawn]
Mirrorize 2
[pawn]else if(GetPlayerDistance(playerid,plr)) SendClientMessage(playerid,COLOR_RED," You Have To Be Near ");[/pawn]
stock
[pawn]stock GetPlayerDistance( playerid, playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos( playerid,x1,y1,z1 );
GetPlayerPos( playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1 ) ),2)+floatpower(floatabs(floatsub(y2,y1 ) ),2)+floatpower(floatabs(floatsub(z2,z1 ) ),2) );
return floatround(tmpdis);
}[/pawn]
This Function Is From VCMP!
GUPS!
It Will Also Usefull When!
If You Used A Jail Command
With tHis You Can make To Work When You Are Near To Him He Will Be Jailed Otherwise he Cant be! Jailed!
So Its A UseFull Feature Discovered By me!