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

Lua Can someone check this?

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,782
Solutions
25
Reaction score
491
Location
Sweden
I wonder if someone can see if there's something wrong with my script. It don't work, nor it gives me any errors:

Code:
    function onDie(cid, corpse)
            if getPlayerLossPercent(cid, loss_experience) < 8 then
                    for i = 0, 3 do
                            getPlayerLossPercent(cid, i)
                            doPlayerSetLossPercent(cid, i, 8)
                    end
                            db.execute('DELETE FROM `player_storage` WHERE `player_id` = ' .. getPlayerGUID(cid) .. ' AND `key` >= 7777 AND `key` <= 7782;')
                    end
            end

Edit: Just like Cykotitan mentions, Avesta lacks db. functions. If you still are using Avesta you can just set the value to zero. It doesn't have to erase.

If you're using newer server, such as OTServ_SVN, you can use erasePlayerStorageValue(cid, key)
 
Last edited:
Register the creature event name in login.lua
(you can see the creature event name in creatureevents.xml)
 
hes trying to execute a query on avesta, he patched the db stuff from tfs but it obviously wont work :D.
doesn't avesta support something like luasql?
 
Bah, I need professional help with programing -.-

Does it need to be so dagn hard to get the god dagn storage to erase? wuuuuuwuwuwuw
 
Back
Top