SA-MP Forums Archive
spectate after death ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: spectate after death ? (/showthread.php?tid=181706)



spectate after death ? - Rocky Balboa - 06.10.2010

Hmmm,how to make something that will let the player spectate another random player for 20 minutes when he dies ?


Re: spectate after death ? - Hamza' - 06.10.2010

pawn Код:
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;
                           
}



Re: spectate after death ? - Rocky Balboa - 06.10.2010

Ok...so where is spectateover ?? and where is the spectating[plyaerid] used ?


Re: spectate after death ? - Hamza' - 06.10.2010

pawn Код:
forward Spectateover(playerid);
public Spectateover(playerid)
{
    if(Spectating[playerid] = 1)
    {
                TogglePlayerSpectating(playerid, false);
        Spectating[playerid] = 0;
                SendClientMEssage(playerid, COLOR_RED, "20 minutes passed, welcomeback");
         }
}



Re: spectate after death ? - Hamza' - 06.10.2010

pawn Код:
public OnPlayerDisconnect(playerid, reason)
        if(Spectating[playerid] = 1)
             {
                   KillTimer(Spectateover);
             }
         return 1;



Re: spectate after death ? - Memoryz - 06.10.2010

Why not use PVars? You dont need empty cells created if they probably arent going to be used.


Re: spectate after death ? - Rocky Balboa - 07.10.2010

Quote:
Originally Posted by Memoryz
Посмотреть сообщение
Why not use PVars? You dont need empty cells created if they probably arent going to be used.
and how would you do it ?


Re: spectate after death ? - Retardedwolf - 07.10.2010

https://sampwiki.blast.hk/wiki/Per-player_variable_system