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

Solved !rebirth error

GoalTV

NANI?!
Joined
Jul 23, 2011
Messages
589
Reaction score
53
Hello.

I have problem with my Talkactions on rebirth system its works and give rebirth but level is same like before 717171 its same after rebirth for some reason level don't get restart this is my talkactions

PHP:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
if(getPlayerLevel(cid) >= level) then
doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` ='"..id.."';")
db.executeQuery("UPDATE `players` SET `name` = '"..getCreatureName(cid).."' WHERE `id` ='"..getPlayerGUID(cid).."';")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
end
return true
end


Best Regards
mlody.1039
 
Code:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
    if(getPlayerLevel(cid) >= level) then
        doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
        doRemoveCreature(cid)
        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` = " .. getPlayerGUID(cid))
        db.executeQuery("UPDATE `players` SET `name` = '"..getCreatureName(cid).."' WHERE `id` = " .. getPlayerGUID(cid))
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
    end
    return true
end
 
and this error come up in engine
Code:
[Error - TalkAction Interface]
data/talkactions/scripts/rebirth.lua:onSay
Description:
(internalGetPlayerInfo) Player not found when requesting player info #18

[Error - TalkAction Interface]
data/talkactions/scripts/rebirth.lua:onSay
Description:
data/talkactions/scripts/rebirth.lua:6: attempt to concatenate a boolean value
stack traceback:
        data/talkactions/scripts/rebirth.lua:6: in function <data/talkactions/scripts/rebirth.lua:2>
 
I am not sure why you wanted to set the players name to the players name, so I removed that part too.

Code:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
    if(getPlayerLevel(cid) >= level) then
        local guid = getPlayerGUID(cid)
        doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
        doRemoveCreature(cid)
        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` = " .. guid)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
    end
    return true
end
 
Oh that what I hate in this new forum actually I hate everything in this new forum I hope old forum will be back with vbullien

thank you again for your help I will try make this !rebirth for mysql now :)

best regards
mlody.1039
 
Back
Top