20.03.2013, 16:24
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.
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; }