spectate after death ?
#1

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

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;
                           
}
Reply
#3

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

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");
         }
}
Reply
#5

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

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

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 ?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)