02.09.2018, 23:47
1. You already set playerid param why would you loop again through all players?
2. You must get the player position for the first time at spawn
2. You must get the player position for the first time at spawn
PHP код:
public OnPlayerSpawn(playerid)
{
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
return 1;
}
forward AFKCheck(playerid);
public AFKCheck(playerid)
{
new Float:Pos[3];
if(IsPlayerInRangeOfPoint(playerid,2,Pos[0],Pos[1],Pos[2]))
{
AFK[playerid]++;
}
else GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(AFK[playerid] == 60)
{
AFK[playerid] = 0;
Lounge[playerid] = true;
SetPlayerPos(playerid, -794.806396,497.738037,1376.195312);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid,10);
IsPlayerInLobby[playerid] = 1;
SetPlayerHealth(playerid, 99999);
ResetPlayerWeapons(playerid);
new string[250];
format(string, sizeof(string), "_AFK_%s", PlayerName[playerid]);
SetPlayerName(playerid, string);
SetPlayerColor(playerid, COLOR_GREY);
}
return 1;
}