Does anyone know how to make it so it updates the max health of a player?
This function "setCreatureMaxHealth(cid, 1200)" does not work, when you log off, you don't have that health anymore.
I was thinking some kind of database updater that can do it but I don't know how to do that since I'm very noob at life![Frown :( :(](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
This function "setCreatureMaxHealth(cid, 1200)" does not work, when you log off, you don't have that health anymore.
I was thinking some kind of database updater that can do it but I don't know how to do that since I'm very noob at life
Lua:
function onSay(cid, words, param, channel)
config = {
archer_items = {8849, 8892, 2649, 2641, 2461, 2543}
}
local container = doPlayerAddItem(cid, 1988, 1)
if isPlayer(cid) and getPlayerVocation(cid) == 0 and getPlayerStorageValue(cid, 6500) == -1 then
doPlayerSetVocation(cid, 3)
doCreatureSay(cid, "You are an archer!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid), 14)
for _, id in ipairs(config.archer_items) do
doPlayerAddItem(cid, id, 1)
end
doAddContainerItem(container, 2120, 1)
doAddContainerItem(container, 5912, 5)
doAddContainerItem(container, 5888, 2)
doAddContainerItem(container, 2789, 1)
doAddContainerItem(container, 13173, 1)
setCreatureMaxHealth(cid, 1200) <!-- THIS DOES NOT WORK -->
else
doPlayerSendCancel(cid, 'You already chose your vocation.')
doSendMagicEffect(getPlayerPosition(cid), 2)
end
return true
end