SA-MP Forums Archive
Players health - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Players health (/showthread.php?tid=165205)



Players health - Shockey - 03.08.2010

For my server I want people to have infinite health like /god for that would I do this

Under on player spawn do I just add

SetPlayerHealth(playerid, 9999);


Re: Players health - Kar - 03.08.2010

Ya OnPlayerSpawn

SetPlayerHealth(playerid, 99999);

or do you want a timer that will that will set there health back to 9999 every second?(bad idea though)


Re: Players health - Shockey - 03.08.2010

Well I don't care asking as they have infinite health

thx =>


Re: Players health - Mauzen - 03.08.2010

The maximum health you can set is 100 I think, but you could add SetPlayerHealth(playerid, 100.0) to OnPlayerUpdate


Re: Players health - Kar - 03.08.2010

lol onplayerupdate....

// ongamemodeinit

pawn Код:
SetTimer("HealthRepair", 1000, true);//1 seconds
// Somewhere in your script
pawn Код:
forward HealthRepair();
public HealthRepair()
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        SetPlayerHealth(i,1000);
    }
    return 1;
}



Re: Players health - Shockey - 03.08.2010

I think I'm gonna use kar thingo he said


Re: Players health - Conroy - 03.08.2010

pawn Код:
SetPlayerHealth(playerid, 0x107FFF);
Will give infinite health with the same health bar as full health.