SA-MP Forums Archive
OnPlayerDeath [HELP] - 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)
+--- Thread: OnPlayerDeath [HELP] (/showthread.php?tid=431379)



OnPlayerDeath [HELP] - Kudoz - 17.04.2013

Sup guys,

I've been developing a new gamemode for a long time now, and I'm making a bansystem at OnPlayerDeath. It's like this;
Код:
    SetPlayerCameraPos(playerid, -1327.1202,2538.7485,86.5109);
    SetPlayerCameraLookAt(playerid, -1323.4154,2531.3044,90.2787);
    GameTextForPlayer(playerid,"~w~YOU HAVE ~r~DIED ~w~IN THE HUNGER GAMES",5000,5);
    {
		Ban(playerid);
		}
There is ofcourse more above these lines, but these are the only ones which is necessary now. The problem is that it wont SetPlayerCameraPos, SetPlayerCameraLookAt nor send GameTextForPlayer .. They get banned straight away.. how can I fix this?

- Kudoz


Re: OnPlayerDeath [HELP] - HurtLocker - 17.04.2013

Under those lines that do not show up for the banned player, set a non-repeating timer which triggers the ban. So do not include ban inside onplayerdeath.


Re: OnPlayerDeath [HELP] - KiNG3 - 17.04.2013

Like he said, make a timer that doesn't repeat itself, then add the ban.

This script is a Hunger Games script I can tell.... I'd like to see it in the future


Re: OnPlayerDeath [HELP] - Kudoz - 17.04.2013

alright thanks!

Yea it's becoming The Hunger Games I hope it one day gets famous lol

( btw, how can this be set up? I'm not sure how


Re: OnPlayerDeath [HELP] - HurtLocker - 17.04.2013

Here, to get banned after 5 seconds:
pawn Код:
forward bantimer(playerid);

public OnPlayerDeath(playerid, killerid, reason)
{
    //code code code
    SetPlayerCameraPos(playerid, -1327.1202,2538.7485,86.5109);
    SetPlayerCameraLookAt(playerid, -1323.4154,2531.3044,90.2787);
    GameTextForPlayer(playerid,"~w~YOU HAVE ~r~DIED ~w~IN THE HUNGER GAMES",5000,5);
    SetTimerEx("bantimer", 5000, 0, "d", playerid);
    return 1;
}
       
public bantimer(playerid)
{
    Ban(playerid);
}



Re: OnPlayerDeath [HELP] - Kudoz - 17.04.2013

Thanks, works Perfect!


Re: OnPlayerDeath [HELP] - Kudoz - 17.04.2013

Thanks, works Perfect!