[HELP] Timers whene dying
#1

Hi , i have a big problem with the timers (i do not know how to use them propely) , so i want to set a timer whene a player disconnect & go to hospital , he must wait 20 sec in the hospital before exit.
So there is my Questions :
1-How to set this timer (players after dead they must wait 20sec in the hospital ) ?

2-i addeded setplayerpos function under the callback Public OnPlayerDeath , but this cause a problem , whene a player just dead , the screen begin to move right and left..(it is normal in GTA) , but i can't see my dead player so he teleport fastley..
-How to fix that ?

Yes i steel newbie in timers & some callback,sorry , i hope you help me .
Reply
#2

As for the 1st I will create it for you in a filterscript.


As for the 2nd it sets the player position when he dies not when he spawns so you must also think something on your own like create a pInfo or anything else.
Reply
#3

Use SetPlayerCameraPos
Reply
#4

thank you !
for the 2nd i don't want to set whene he spawns i want to set it whene player dead so teleport him to hospital , then he must wait 20sec then he go out thant's all
Reply
#5

There you go http://pastebin.com/BPejUfAF

Complie it in filterscripts folder then open server.cfg and add in Filterscripts line DeathTimer.

NOTE: You have to set the hospital coordinates yourself at
pawn Код:
TogglePlayerControllable(playerid, 0);
in the "public OnPlayerSpawn function under the TogglePlayerControllable(playerid, 0);"
Reply
#6

Thank you ! ++rep i will test it now
Reply
#7

I have a mistake at

pawn Код:
public DeathTimer(playerid)
{
        PlayerInfo[playerid][pJustDied] = 0;
        SendClientMessage(playerid, COLOR_YELLOW, "You have to wait 20 seconds.");
        return 1;
}
change it to:

pawn Код:
public DeathTimer(playerid)
{
        PlayerInfo[playerid][pJustDied] = 0;
        TogglePlayerControllable(playerid, 1);
        SendClientMessage(playerid, COLOR_YELLOW, "You have to wait 20 seconds.");
        return 1;
}
Reply
#8

yeah i edited & slaped my self but doesn't work i can send to u my server's IP if u want..
Reply
#9

yeah send it to me in pm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)