Posts: 88
Threads: 16
Joined: Oct 2017
Quote:
Originally Posted by Logic_
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH)
{
if(IsPlayerCop(playerid))
{
new Float: x, Float:y, Float:z, Float: distance, pid = INVALID_PLAYER_ID;
GetPlayerPos(pid, x, y, z);
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
if(!IsPlayerConnected(i)) continue;
distance = GetPlayerDistanceFromPoint(i, x, y, z);
if(floatabs(distance) < 2)
{
pid = i;
break;
}
}
if(pid != INVALID_PLAYER_ID)
{
Arrest(pid);
// format a message maybe? and send it
}
else
{
SendClientMessage(playerid, color, "NOT IN RANGE");
}
}
}
return 1;
}
^^.
|
thx but Its still saying "not in range" when I stand next to the player