14.07.2010, 14:25
pawn Code:
new bool:beenspectating[MAX_PLAYERS];
forward spawnplayer(playerid);
public spawnplayer(playerid)
{
beenspectating[playerid] = true;
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, 0);
SpawnPlayer(playerid);
return 1;
}
public OnPlayerConnect(playerid)
{
beenspectating[playerid] = false;
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(beenspectating[playerid])
{
return 1;
}
else
{
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 1);
// SetPlayerCameraPos, SetPlayerCameraLookAt, etc.
SetTimerEx("spawnplayer", 5000, false, "i", playerid);
return 0;
}
}