12.08.2011, 06:07
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
* I'm not sure this code works, I typed it here.
pawn Код:
CMD:cuff(playerid,params[])
{
new id,string[128];
if(sscanf(params, "u",id))SendClientMessage(playerid,COLOR_RED,"Usage: /cuff [ID]");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Player Not Connected!");
else
{
format(string, sizeof(string), "You are cuffed");
GameTextForPlayer(playerid, string, 500, 4);
TogglePlayerControllable(id,0);
}
else
{
if (IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
{
// freezing player because of cuff.
return 1;
}