OnPlayerDeath help!
#2

Код:
    if(Injured[playerid] == 1) 
    { 
        Injured[playerid] = 2; 
        SetSpawnInfo(playerid, 0, PInfo[playerid][Skin], 2032.5200,-1416.2058,12, 0,0,0,0,0,0,0); 
        SpawnPlayer(playerid); 
        return 1; 
    }
    else
    { 
    GetPlayerPos(playerid, BTPos[playerid][0], BTPos[playerid][1], BTPos[playerid][2]); 
    GetPlayerFacingAngle(playerid, BTPos[playerid][3]); 
    SetSpawnInfo(playerid, 0, PInfo[playerid][Skin], BTPos[playerid][0],BTPos[playerid][1],BTPos[playerid][2]-0.1, BTPos[playerid][3],0,0,0,0,0,0); 
    SpawnPlayer(playerid); 
    Injured[playerid] = 1;
    }
I think this will do what you wanted. The problem in the code you posted is if your if statement return true, the code inside WILL be executed, but after that it will be overwritten by the code under it, I assume you wanted them for two different cases. Try the code above and tell me if it works the way you want it to.
Reply


Messages In This Thread
OnPlayerDeath help! - by dieuhanhphuc - 22.07.2014, 11:29
Re: OnPlayerDeath help! - by BlackM - 22.07.2014, 11:47
Re: OnPlayerDeath help! - by dieuhanhphuc - 22.07.2014, 11:55
Re: OnPlayerDeath help! - by dieuhanhphuc - 22.07.2014, 14:18

Forum Jump:


Users browsing this thread: 1 Guest(s)