02.06.2013, 12:45
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;
}