05.11.2015, 11:02
PHP код:
new SpawnTimer[MAX_PLAYERS]; //At top of script
public OnPlayerSpawn(playerid)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X ,Y ,Z):
SetPlayerPos(playerid, X, Y, Z + 2);
TogglePlayerControllable(playerid,0);
SpawnTimer[playerid] = SetTimerEx("unfreezetimer", 2000, 0, "i", playerid);//Timer to unfreeze player
}
forward unfreezetimer(playerid);
public unfreezetimer(playerid)
{
TogglePlayerControllable(playerid,1);
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(SpawnTimer[playerid]);
return 1;
}