Auto Health Not Working
#2

There's not such as parameter 'playerid'. You've to loop through the players, use either foreach (recommended) or normal for loop.

pawn Код:
// Foreach
public autohealth()
{
    new Float:health;
    foreach(playerid : Player)
    {
        GetPlayerHealth(playerid,health);
        if (health < 99.0)
        {
            SetPlayerHealth(playerid, 100.0);
        }
     }
     return 1;
}
pawn Код:
// Normal For Loop
public autohealth()
{
    new Float:health;
    for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        GetPlayerHealth(playerid,health);
        if (health < 99.0)
        {
            SetPlayerHealth(playerid, 100.0);
        }
     }
     return 1;
}
Reply


Messages In This Thread
Auto Health Not Working - by GreTex - 02.06.2013, 12:40
Re: Auto Health Not Working - by Konstantinos - 02.06.2013, 12:45
Re: Auto Health Not Working - by GreTex - 02.06.2013, 12:46
Re: Auto Health Not Working - by MP2 - 02.06.2013, 14:12

Forum Jump:


Users browsing this thread: 2 Guest(s)