Console commands to change max health and shields

I think this would be neat. To be able to edit your max HP and Armor using console commands.

Well, if you go to console under the administration modification of ULX, you can just type;

ulx hp “Blahblahblah” Or whatever your name is.

I’m not sure about Armor, and I will try to find it.

[lua]function HP(ply,cmd,args)
if args[1] == nil then return end
if not ply:IsAdmin() then return end
if string.find(args[1],"-") then return end
if (type(tonumber(args[1])) == “number”) then
PrintMessage(HUD_PRINTTALK,ply:Name()…"'s Health went to: "…args[1])
concommand.Add(“SetHealth”, HP)

function Armor(ply,cmd,args)
if not ply:IsAdmin() then return end
if string.find(args[1],"-") then return end
if args[1] != nil then
if (type(tonumber(args[1])) == “number”) then
PrintMessage(HUD_PRINTTALK,ply:Name()…"'s Armor went to: "…args[1])
concommand.Add(“SetArmor”, Armor)[/lua]

Does that only change the players health to number attached, or does make it so that the maximum is what he wanted?
He’s asking for something that sets the maximum, instead of a max of 100 hp maybe he wants it to be 300 maximum for the entire sever.
Judging by the concommand (SetHealth) it looks as though it only just changes the amount of health. I may be wrong cause I don’t lua code so I didn’t understand the code. Anyways, perhaps you could also make it so the admin can change the max health for one player or the entire server.

It’s best if the players health and armor is lower then 6 numbers or the client will crash over or equal to 100000.

What did that have to do in relation to my comment? I was asking whether that lua script you gave us only changed the players hp and armor, not the MAXIMUM hp and armor.

Im… not sure there is a way to change max health/armor. I will look into it.

I don’t think it’s possible.


Noone for armor though.

Is there a console command to simply change / add health / armor value to the player? (Almost like the ‘givecurrentammo’ command)