OnPlayerDeath [HELP]
#1

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
Reply
#2

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.
Reply
#3

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
Reply
#4

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
Reply
#5

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);
}
Reply
#6

Thanks, works Perfect!
Reply
#7

Thanks, works Perfect!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)