Aurolio
New Member
- Joined
- Aug 26, 2018
- Messages
- 45
- Reaction score
- 3
Hi, I am trying to implement a reborn system to my ots, but I don't know how to increase dmg by certain percentage with every single reborn player makes.
This is the code I am using:
Also, when I run this script, instead of updating the reset description "Have x resets", it just adds another description so it looks like : Have 2 resets. Have 3 resets. Have 4 resets and so on.
This is the code I am using:
Lua:
function onSay(cid, words, param)
config = {
level=450, -- level necessary to reset.
RemainingLvl=8, -- that level will be reset after.
exper=4200, -- experience that will be reset after.
pid=getPlayerGUID(cid),
skull="yes", -- players with white skull can reset? ("yes" or "no").
redskull="yes", -- players with red skull can reset? ("yes" or "no").
prot="yes", -- players need to be in protection zone to reset? ("yes" or "no").
bat="yes" --Players must be no fight to reset ("yes" or "no").
}
function getResets(cid)
reset = getPlayerStorageValue(cid,1020)
if reset < 0 then
reset = 0
end
return reset
end
if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"only players without white skull can reset.")
return TRUE
end
if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"only player without red skull can reset.")
return TRUE
end
if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"you need stay in PZ to reset.")
return TRUE
end
if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"players without battle can reset.")
return TRUE
end
if getPlayerLevel(cid) >= config.level then
setPlayerStorageValue(cid,1020,getResets(cid)+1)
doPlayerSetNameDescription(cid, " Have a "..getResets(cid)+(1).." reset\'s.")
doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.")
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid)
else
doPlayerSendCancel(cid, "You need to have level "..config.level.." or more you may be reset.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end
Also, when I run this script, instead of updating the reset description "Have x resets", it just adds another description so it looks like : Have 2 resets. Have 3 resets. Have 4 resets and so on.