28.10.2017, 17:11
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new pid;
if(IsPlayerCop(playerid))
if(newkeys == KEY_CROUCH)
{
new Float: x, Float:y, Float:z;
GetPlayerPos(pid, x,y,z);
for(new i=-1; i<MAX_PLAYERS, i++)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 2, x, y, z))
{
Arrest(pid);
return 1;
}
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Not in range!");
}
else
{
SendClientMessage(playerid,COLOR_RED,"Not a Cop!");
}
return 1;
}