Timer after the player dies
#1

Right guys, I have a gamemode, and when the player gets killed he just spawns straight away to hospital... So I made a timer for 3sec, so it will show the death animation and stuff, and then spawn him, it does kinda work in a hospital ( Most of the times he spawns with a cigar or bottle in his hands, and runs like he has a cj skin ) But then I tried to do the same with my new DM zone system, and it just shows me the requestplayspawn window, and then falls from the sky into the center of the world in the desert..

My code:
Next to all the new'ssss
HTML Code:
new bool:IsDead;
Then onplayerdeath I'm making a timer for 3sec
HTML Code:
SetTimerEx("Dead", 3000, false, "dd", playerid,0);
When the timer is done, I'm setting the spawn info
I tried method 1:
HTML Code:
forward Dead(playerid);
public Dead(playerid)
{
        if(PlayerDB[playerid][IsInDM] == true)
       {
                SetSpawnInfo(playerid, NO_TEAM, PlayerDB[playerid][DeathSkin], -2653.3843,637.0585,244.3842, 1.7319, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                return 1;
        }
        PlayerDB[playerid][HospitalTime] = 60;
        SetSpawnInfo(playerid, NO_TEAM, PlayerDB[playerid][DeathSkin], -2653.3843,637.0585,244.3842, 1.7319, 0, 0, 0, 0, 0, 0);
        ResetPlayerWeaponsEx(playerid);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
        SpawnPlayer(playerid);
     }
    return 1;
}
I have also tried to check on playerspawn if the player is dead, if he is then respawn, same stuff going on, trying putting the deadh checker on onplayerdeath and in the timer same stuff..

Any ideas ?

AND YEAH I KNOW SORRY FOR MY CRAPPY ENGLISH

Cheers guys
Reply


Messages In This Thread
Timer after the player dies - by chiornyybumer - 29.03.2019, 11:46
Re: Timer after the player dies - by introzen - 29.03.2019, 11:57
Re: Timer after the player dies - by chiornyybumer - 29.03.2019, 12:00
Re: Timer after the player dies - by chiornyybumer - 29.03.2019, 12:03

Forum Jump:


Users browsing this thread: 1 Guest(s)