29.04.2009, 14:57
I made this
It should spectate your killer for 3 seconds and then returning to normal, but when I'm killed or I suicide, my game crashes.
Код:
//-----------------------------death new Plookingforkiller[MAX_PLAYERS]; new death[MAX_PLAYERS];
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInDM[playerid] != 0)
{
GetPlayerName(killerid, name, sizeof(name));
format(string, sizeof(string), "%s has killed you", name );
GameTextForPlayer(playerid, string, 3000, 4);
SetCameraBehindPlayer(killerid);
TogglePlayerControllable(playerid, 0);
Plookingforkiller[playerid] = 1;
}
}
Код:
public OnPlayerSpawn(playerid)
{
if (Plookingforkiller[playerid]==1)
{
death[playerid] = SetTimerEx("deathspec", 3000, false, "i", playerid);
Plookingforkiller[playerid]=0;
}
}
Код:
forward deathspec(playerid);
public deathspec(playerid)
{
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
}

