Problem with F4 and spectate if suicide
#1

Quote:

public OnPlayerDeath(playerid, killerid, reason)

{
if(killerid == playerid)
{
SendClientMessage(playerid, COLORHERE, "You killed yourself");
SetTimerEx("StopSpeccing", 10000, false, "i", playerid);
}
else
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("StopSpeccing", 10000, false, "i", playerid);
}
}

This is under OnPlayerDeath, and i have to callback funtion of StopSpeccing at the bottom etc.. But when i get killed, and press F4 first, it doesn't go to the class selection, and if i do suicide it doesn't wait 10 seconds at all, it just respawns..
Reply
#2

When making my spectate script, I found it better to use OnPlayerStateChange, rather than OnPlayerSpawn and OnPlayerDeath.
Reply
#3

Can you be a bit more specific? If you are trying to help me ofcourse.
Reply
#4

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_WASTED)
    {
   
    }
}
I just found that this worked more reliably...

I'm not 100% sure what the problem is, do you wish for the spectator to witness the class selection, or just go back to speccing once the player has spawned?

Reply
#5

I just want when a player is killed, you have to go to spectate, it does that fine, but when i press f4 first, it doesn't to to the class selection menu, it just spectates and the respawns. And if i do suicide, it doesn't spectate at all, but f4 works there...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)