OnPlayerInteriorChange death
#1

The heading describes most of it.
When I enter the interior it should block me from dying,
and when out, set to the same health I had before entering the interior
instead it just sets my health to 0, why?

What I have:
Код:
new Float:oldHealth;
    if(newinteriorid != 0)
    {
        GetPlayerHealth(playerid, oldHealth);
        SetPlayerHealth(playerid, 99999);
    }
    if(newinteriorid == 0)
    {
         SetPlayerHealth(playerid, Float:oldHealth);
    }
[Under OnPlayerInteriorChange]

If anyone can make me the script, I'll rep him/her.

Thanks!
Reply
#2

the definition need be global and for each player

Код:
new Float:oldHealth[MAX_PLAYERS];

if(newinteriorid != 0)
    {
        GetPlayerHealth(playerid, oldHealth[playerid]);
        SetPlayerHealth(playerid, 99999);
    }
    if(newinteriorid == 0)
    {
         SetPlayerHealth(playerid, oldHealth[playerid]);
    }
Reply
#3

Oh, it works!
Thanks for explaining and posting the command!
Rep'ed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)