06.10.2010, 22:56
Hmmm,how to make something that will let the player spectate another random player for 20 minutes when he dies ?
public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerSpectating(playerid, true);
if(!IsPlayerInAnyVehicle(killerid)) PlayerSpectatePlayer(playerid, killerid);
else PlayerSpectateVehicle(playerid, GetPlayerVehicleID(killerid), SPECTATE_MODE_NORMAL);
Spectating[playerid] = 1;
SetTimerEx("Spectateover", 200000, true, "i", killerid);
return 1;
}
forward Spectateover(playerid);
public Spectateover(playerid)
{
if(Spectating[playerid] = 1)
{
TogglePlayerSpectating(playerid, false);
Spectating[playerid] = 0;
SendClientMEssage(playerid, COLOR_RED, "20 minutes passed, welcomeback");
}
}
public OnPlayerDisconnect(playerid, reason)
if(Spectating[playerid] = 1)
{
KillTimer(Spectateover);
}
return 1;