OnPlayerUpdate
#1

Howdy Guys.

pawn Код:
// Other code here...
          SendClientMessage(playerid, COLOR_CRIMSON, "The vehicle engine is totalled.");
         }
    }
    new Float:health;
    GetPlayerHealth(playerid,health);
    if (health < 2.0)
    {
     ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,0,0,0,1,1);
     TogglePlayerControllable(playerid,0);
     GameTextForPlayer(playerid, "~b~Heavily Injured ~n~ ~r~/die ~w~or ~r~/getcurated", 3000, 4);
    }
    return 1;
}
This code is not working, any fixes?
Reply
#2

Code is good. Let's debug

pawn Код:
GetPlayerHealth(playerid,health);
printf("Current health: %0.2f. Should happen? %d", health, health < 2.0);
Reply
#3

Nope, when I have 1hp I still die
Reply
#4

pawn Код:
// global variables:
new Float X[MAX_PLAYERS], Float Y[MAX_PLAYERS], Float Z[MAX_PLAYERS];

OnPlayerDeath()
{
GetPlayerPos( X[pid] Y[pid] Z[pid]);
ClearAnimations(pid);
}
OnPlayerSpawn()
{
SetPlayerPos( X[pid] Y[pid] Z[pid]);
TooglePlayerControllable(false);
ApplyAnimation(smth);
}
Reply
#5

Nope, not working.
Reply
#6

Код:
    
if (health < 10.0)
    {
     ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,0,0,0,1,1);
     TogglePlayerControllable(playerid,0);
     GameTextForPlayer(playerid, "~b~Heavily Injured ~n~ ~r~/die ~w~or ~r~/getcurated", 3000, 4);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)