• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ maxHealth

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
74
there is some issues with C++ and I am not sure if its a server-related

Trying to change max health of character and its working fine when checking the value using lua scripts such as:

LUA:
function onCastSpell(cid, var)
    player = Player(cid)
    print(player:getMaxHealth())
end

However, when you go to the database: the added maxHealth became Health as well as mana

y9gf76M.png


I have an XML file that I specify how much health/mana I want for the character to be added so the 3500 you see above is that I want my character to have additional 3000 health.

In-game it works fine, but it has some bugs when using function such as setMaxHealth(getMaxHealth + 1000) etc.

I dunno if its something that can be fixed, if anyone can let me know plz do

tfs 1.0
 
Last edited:
show the script you're using to edit the player's max health

it should be something like:
Code:
player:setMaxHealth(player:getMaxHealth() + 1000)

or
Code:
player:setMaxHealth(player:getBaseMaxHealth() + 1000)

I'm not sure if getMaxHealth() includes item's attribute, test both.
Your database will be updated as soon as the player logout
 
Back
Top