player spectate killer
#1

I got this and I dont get it why isnt it working.

Basically if you get killed you should spectate the player that killed you (10 sec), but it wont work.


Код:
//Top of the script.
new Died[MAX_PLAYERS], KilledBy[MAX_PLAYERS];
forward EndDeathCam(playerid);

//OnPlayerConnect
Died[playerid] = -1;
KilledBy[playerid] = -1;

//OnPlayerDisconnect
Died[playerid] = 0;
KilledBy[playerid] = 0;

public OnPlayerDeath(playerid, killerid, reason)
{
    pInfo[killerid][Kills]++;
    pInfo[playerid][Deaths]++;
    
    Died[playerid] = 1;
    if(Died[playerid] == 1)
    {
        Died[playerid] = 0;
        if(KilledBy[playerid] != INVALID_PLAYER_ID)
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, killerid);
        SendClientMessage(playerid, WHITE, "You have been killed, you are now spectating your killer.");
        SetTimerEx("EndDeathCam", 10000, 1, "i", playerid); // 10 seconds
    }
    else
    {
        TogglePlayerSpectating(playerid, 0);
    }
    return 1;
}

public EndDeathCam(playerid)
{
    TogglePlayerSpectating(playerid, 0);
    Died[playerid] = 0;
}
Reply


Messages In This Thread
player spectate killer - by Squirrel - 20.03.2013, 16:24
Re: player spectate killer - by Misiur - 20.03.2013, 16:29
Re : player spectate killer - by thegreathom - 20.03.2013, 16:40
Re: player spectate killer - by Squirrel - 20.03.2013, 16:47
Re: player spectate killer - by Squirrel - 20.03.2013, 16:51
Re : player spectate killer - by thegreathom - 20.03.2013, 17:31
Re: player spectate killer - by Squirrel - 20.03.2013, 18:11
Re: player spectate killer - by Patrick - 20.03.2013, 18:20
Re: player spectate killer - by Squirrel - 20.03.2013, 18:46

Forum Jump:


Users browsing this thread: 1 Guest(s)