SA-MP Forums Archive
Little help with spectate/respawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little help with spectate/respawn (/showthread.php?tid=90497)



Little help with spectate/respawn - urkiefly101 - 08.08.2009

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?


Re: Little help with spectate/respawn - urkiefly101 - 08.08.2009

Anyone could help?


Re: Little help with spectate/respawn - urkiefly101 - 08.08.2009

PLEASE


Re: Little help with spectate/respawn - Paladin - 08.08.2009

[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);
}
}




Re: Little help with spectate/respawn - TheKingWillem - 08.08.2009

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


Re: Little help with spectate/respawn - Paladin - 09.08.2009

Код:
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


Re: Little help with spectate/respawn - Woet - 09.08.2009

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