• 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!

Reset in Name

gabrielks

New Member
Joined
Dec 2, 2011
Messages
12
Reaction score
0
I would like help because I wanted to know how I can add the amount of resets next to the name in real time example Calango [2] in the case the character has 2 resets
 
I would like help because I wanted to know how I can add the amount of resets next to the name in real time example Calango [2] in the case the character has 2 resets
hello bro, these days I did tested with this link. yes there is.. have a look there
the script made by @Itutorial
Lua:
function addReset(cid)
--1 - 30--
local resetsNum = {
[1] = "I", [2] = "II", [3] = "III", [4] = "IV", [5] = "V",
[6] = "VI", [7] = "VII", [8] = "VIII", [9] = "IX", [10] = "X",
[11] = "XI", [12] = "XII", [13] = "XIII", [14] = "XIV", [15] = "XV",
[16] = "XVI", [17] = "XVII", [18] = "XVIII", [19] = "XIX", [20] = "XX",
[21] = "XXI", [22] = "XXII", [23] = "XXIII", [24] = "XXIV", [25] = "XXV",
[26] = "XXVI", [27] = "XXVII", [28] = "XXVIII", [29] = "XXIX",[30] = "XXX"
}
    player = Player(cid)
    resets = getResets(cid)
    hp = player:getMaxHealth()
    resethp = hp*(config.percent/100)
    player:setMaxHealth(resethp)
    mana = player:getMaxMana()
    resetmana = mana*(config.percent/100)
    player:setMaxMana(resetmana)
    playerid = player:getGuid()
    player:setStorageValue(378378, resets+1)
    numeral = resetsNum[player:getStorageValue(378378)]
    newName = player:getName().." "..numeral
    player:remove()
    description = resets+1
    db.query("UPDATE `players` SET `level`="..config.newlevel..",`experience`= 0 WHERE `players`.`id`= ".. playerid ..";")
    db.query("UPDATE `players` SET `name` = "..newName.." WHERE `players`.`id`= ".. playerid ..";")
    return true
end
 
Back
Top