Right so I take the simple setPedArmour FOR EXAMPLE!!
function givePlayerArmor ( player, command )
setPedArmor ( player, 100 ) -- Set player's armor to 100 when he types the command 'addarmor'
end
addCommandHandler ( "addarmor", givePlayerArmor )
function removePlayerArmor ( player, command )
setPedArmor ( player, 0 ) -- Set player's armor to 0 when he types the command 'removearmor'
end
addCommandHandler ( "removearmor", removePlayerArmor )
Okay Now I change it so It works with health...
function setPlayerHealth ( player, command )
setElementHealth ( player, 100 ) -- Set player's health to 100 when he types the command 'health100'
end
addCommandHandler ( "health100", setPlayerHealth )
function setPlayerHealth ( player, command )
setElementHealth ( player, 0 ) -- Set player's health to 0 when he types the command 'dienow'
end
addCommandHandler ( "dienow", removePlayerArmor )
(ignore anymistakes in the script!!)
Now my question is.... Instead of Typing set health 100, (as in a solid number) how can i make it so they choose the health, as in health "then what they type for their health" i think its VAR but i am not sure,
example but defo wrong!!!
setElementHealth ( player, var ) -- Set player's health to 0 when he types the command 'dienow'
addCommandHandler ( "dienow", "var" , removePlayerArmor )
Sorry for the stupid questions but you guys on the forums keep me alive!!!