I need help :'( (+REP)
#4

You must write it like this:
PHP код:
//global in the script:
new Float:DeathX[MAX_PLAYERS],Float:DeathY[MAX_PLAYERS],Float:DeathZ[MAX_PLAYERS],bool:death[MAX_PLAYERS];
public 
OnPlayerDeath(playeridkilleridreason)
{
    
death[playerid] = true;
    
GetPlayerPos(playerid,DeathX[playerid],DeathY[playerid],DeathZ[playerid]);
    if(
killerid != INVALID_PLAYER_ID)
    {
        
SetPlayerScore(killeridGetPlayerScore(killerid) + 1);
        
SendClientMessage(killerid,COLOR_LIGHTBLUE,"Good Job +1 For killing that enemy");
        
PlayerInfo[killerid][pKills]++;
    }
    
PlayerInfo[playerid][pDeaths]++;
    
PlayerPlaySound(playerid,4804,0.00.010.0);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
death[playerid] == true)
    {
        
SetPlayerPos(playerid,DeathX[playerid],DeathY[playerid],DeathZ[playerid]);
        
ApplyAnimation(playerid"PED""KO_shot_front",4.1,1,1,1,1,1);
    }
    return 
1;

After OnPlayerDeath is OnPlayerSpawn called and you will be spawn after you are death. So you need an boolean (a variable) to set a value that you are death and spawn you back in OnPlayerSpawn.

My english is bad, but I hope you understand me.
Reply


Messages In This Thread
I need help :'( (+REP) - by MarkNelson - 06.07.2016, 07:42
Re: I need help :'( (+REP) - by Mencent - 06.07.2016, 07:44
Re: I need help :'( (+REP) - by MarkNelson - 06.07.2016, 07:46
Re: I need help :'( (+REP) - by Mencent - 06.07.2016, 07:51
Re: I need help :'( (+REP) - by MarkNelson - 06.07.2016, 08:07
Re: I need help :'( (+REP) - by Mencent - 06.07.2016, 08:13
Re: I need help :'( (+REP) - by MarkNelson - 06.07.2016, 08:19
Re: I need help :'( (+REP) - by Mencent - 06.07.2016, 08:29

Forum Jump:


Users browsing this thread: 1 Guest(s)