db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
Lua:db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
If you want to learn mysql queries: Common MySQL Queries
function onUse(cid, item, fromPosition, itemEx, toPosition)
db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
doRemoveItem(item.uid)
return true
end
I dident tested it but should work.function onUse(cid, item, fromPosition, itemEx, toPosition)
creature = getTopCreature(toPosition)
setCreatureMaxHealth(creature.uid, getCreatureMaxHealth(creature.uid)+500)
return true
end
I dident tested it but should work.
Add this script to an rune in actions
function onUse(cid, item, fromPosition, itemEx, toPosition)
db.executeQuery("UPDATE `players` SET `healthmax` = healthmax + 1000 WHERE `id` = " .. getPlayerGUID(cid))
doRemoveItem(item.uid)
return true
end
<action itemid="itemid" event="script" value="namescript.lua"/>
function onUse(cid, item, frompos, item2, topos)
if (getPlayerStorageValue(cid, STORAGE) < 1) then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000)
doSendMagicEffect(getPlayerPosition(cid), 27)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your health now is : " .. getCreatureMaxHealth(cid) .. ".")
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, 22, "You can't use this.")
end
end
Take this
Lua:<action itemid="itemid" event="script" value="namescript.lua"/>
Lua:function onUse(cid, item, frompos, item2, topos) if (getPlayerStorageValue(cid, STORAGE) < 1) then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000) doSendMagicEffect(getPlayerPosition(cid), 27) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your health now is : " .. getCreatureMaxHealth(cid) .. ".") doRemoveItem(item.uid, 1) else doPlayerSendTextMessage(cid, 22, "You can't use this.") end end
Thanks so Much!!
it works Percefy rep++..
But if i can ask can u add to text be Like this
Just to it Says healt not mana xD
and to player can use it only once..