Little help with spectate/respawn
#1

Oke so i've got this

Quote:

public OnPlayerDeath(playerid, killerid, reason)

{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("StopSpeccing", 10000, false, "i", playerid);

and this at the bottom

Quote:

public StopSpeccing(playerid)
{
TogglePlayerSpectating(playerid, 0);
}

Everything works fine, so if you get shot you spectate that player etc.. But when i suicide like typing /kill, or fall to death, it doesn't respawn, it just looks in the sky without respawning, how can i make it to respawn if their is no killer id?
Reply
#2

Anyone could help?
Reply
#3

PLEASE
Reply
#4

[quote=urkiefly101 ]
Quote:

public OnPlayerDeath(playerid, killerid, reason)

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

Reply
#5

But it should wait 10 seconds, even when a player does suicide...
Reply
#6

Код:
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);
}
}
Then do that
Reply
#7

'You can bump topics when the last reply is at least 12 hours old.'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)