12.04.2019, 22:09
PHP Code:
IsPlayerNearPlayer(playerid, targetid, Float:range = 5.0)
{
new
Float:x,
Float:y,
Float:z;
GetPlayerPos(targetid, x, y, z);
return GetPlayerInterior(playerid) == GetPlayerInterior(targetid) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid) && IsPlayerInRangeOfPoint(playerid, range, x, y, z);
}
PHP Code:
if (!IsPlayerNearPlayer(playerid, id))
return SendClientMessage(playerid, -1, "O jogador nгo estб perto de vocк.");