Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

How can I fix that

$
0
0
So, I have a timer (6,5 seconds) that start when OnPlayerDeath is called and check if OnPlayerSpawn was called for player, if hasn't, i use SpawnPlayer(playerid). Everything is good, he is called, but i have a little problem.

When the player get afk in the animation when he died and he put the game in bar timer still runing behind (i think) for player, and when he come back, OnPlayerSpawn and Timer is simultaneously called and he will be spawned twice and when this happen, he doesn't spawn at his normal zone, he spawn in air or 0.0, 0.0, 0.0 (x,y,z) or grove street zone (another vw), typically samp. Or he get first spawn from the timer after 6,5 sec, and when he come back OnPlayerSpawn is called (same, spawned twice)...

I use a variabile (Alive[playerid]) to OnPlayerDeath " = 0 " and OnPlayerSpawn " = 1 " to check if the function was called.

How can I do to fix this? Or I can't?

Viewing all articles
Browse latest Browse all 18226

Trending Articles