• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Reset System

@Trader
Did you try to log on and off then try to kill a monster?
@Mraz
Hey, I suggest you give the guy his credits, since he did make the script.
All you did was translate it to English, so do the right things and give him
the credits that he deserves!
 
I made a reborn system but i haven't posted it because i'm getting problems when i set new exp with query, when player login, he get a higher exp than the added on the database, and after it, the higher exp is saved on the database, anyone knows why it happens?

Edit:

Anyways, i'll post it, i think is my server.
 
Hey mann

Nice script, worked for me!!

I changed somethings. Now, just to see how many resets of the player, but is not working.
How do I return an Int value of the query?

Code:
function getPlayerResets(cid)
    local Info = db.getResult("SELECT resets FROM players WHERE `id` = " .. [B]cid [/B].. " LIMIT 1")
        if Info:getID() ~= LUA_ERROR then
        local resets= Info:getDataInt("resets")
        Info:free()
        return resets
    end
     return LUA_ERROR
end

Thank you

---------------------------------------

SOLVED

Code:
    local Info = db.getResult("SELECT resets FROM players WHERE `id` = " .. [B][COLOR="#008000"]getPlayerGUID(cid)[/COLOR][/B] .. " LIMIT 1"):getDataInt("resets")
 
Last edited:
local function getStats(cid, __this)
if __this == "health" then
return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
elseif __this == "mana" then
return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
end
end

local t = {
skull = "yes",
red = "yes",
prot = "yes",
bat = "yes",
exp = 4200,
lvl = 8,
level = 450
}
t.skulls = getBooleanFromString(t.skulls)
t.red = getBooleanFromString(t.red)
t.prot = getBooleanFromString(t.prot)
t.bat = getBooleanFromString(t.bat)
function onSay(cid, words, param, channel)
reset = 0
c = {}
for _, v in ipairs(getPlayersOnline()) do
if #v > 0 and not t.skulls and not t.red and not t.prot and not t.bat and getPlayerLevel(v) >= t.level then
db.executeQuery("UPDATE `players` SET `level` = " .. t.lvl .. ", `experience` = " .. t.exp .." WHERE `id` = " .. getPlayerGUID(v))
setCreatureMaxHealth(v, getStats(v, "health"))
setCreatureMaxMana(v, getStats(v, "mana"))
doCreatureAddHealth(v, getCreatureMaxHealth(v) - getCreatureHealth(v), false)
doCreatureAddMana(v, getCreatureMaxMana(v) - getCreatureMana(v), false)
setmetatable(c, {__index = _G})
setfenv(0, c)
_G.v = _G.v
reset = reset + #v
else
doPlayerSendTextMessage(cid, 27, "Theres no players online.")
break
end
end
return true
end

is possible to make a "Reborn System" for the Magic Level and Skillls be divided x2?
 
[08/08/2011 23:58:30] mysql_real_query(): UPDATE `players` SET `level` = 8, exp` = 4200 WHERE `id` = 1098; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` = 4200 WHERE `id` = 1098' at line 1 (1064)

[08/08/2011 23:58:31] [Error - TalkAction Interface]
[08/08/2011 23:58:31] data/talkactions/scripts/reset.lua:eek:nSay
[08/08/2011 23:58:31] Description:
[08/08/2011 23:58:31] data/talkactions/scripts/reset.lua:24: attempt to index local 'voc_' (a nil value)
[08/08/2011 23:58:31] stack traceback:
[08/08/2011 23:58:31] data/talkactions/scripts/reset.lua:24: in function 'getNextVocation'
[08/08/2011 23:58:31] data/talkactions/scripts/reset.lua:35: in function <data/talkactions/scripts/reset.lua:27>
 
Anyone can tell me what script Work 100% ._. ... ¿You think you can put a maximum reset?
 
Back
Top