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

Where are the addons saved?

exique

Natala-ot.com
Joined
Sep 28, 2008
Messages
1,673
Reaction score
25
Location
Sweden
I've changed the addon system on my server but some of the old players still have all the other addons :S How do I remove them? Where in the database?
It's not lookaddons i've tried that :S

Reputation 10x times xD :thumbup:
 
I just thought I replied to this one?! Wheres my post haha..

players_storage table, since addons is a storage I guess it would be in there as well.
 
If you want to know wich one is citizen addon for example, browse your addons npc script and look for each addon id, and then search for it on the table players_storage.
 
Look at this nothing about storage :S
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)    npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                        npcHandler:onThink()                        end

function buyAddons(cid, message, keywords, parameters, node)
    --TODO: buyAddons function in modules.lua
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local addon = parameters.addon
    local cost = parameters.cost
    local premium = (parameters.premium ~= nil and parameters.premium)

    if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
        if doPlayerRemoveMoney(cid, cost) == TRUE then
            doPlayerAddAddons(cid, addon)
            npcHandler:say('There, you are now able to use all addons!', cid)
        else
            npcHandler:say('Sorry, you do not have enough money.', cid)
        end
    else
        npcHandler:say('I only serve customers with premium accounts.', cid)
    end

    keywordHandler:moveUp(1)
    return true
end

local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 250000 gold coins?'})
    node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 250000, premium = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 500000 gold coins?'})
    node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 500000, premium = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 250000 gold coins and the second addons set for 500000 gold coins.'})

npcHandler:addModule(FocusModule:new())
 
That thing gives every storage value of addon set 1 or 2. If you want them all gone you will have to put in a command in SQL that deletes all storage values with the addon ids.
 
Look at this nothing about storage :S
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)    npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                        npcHandler:onThink()                        end

function buyAddons(cid, message, keywords, parameters, node)
    --TODO: buyAddons function in modules.lua
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local addon = parameters.addon
    local cost = parameters.cost
    local premium = (parameters.premium ~= nil and parameters.premium)

    if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
        if doPlayerRemoveMoney(cid, cost) == TRUE then
            doPlayerAddAddons(cid, addon)
            npcHandler:say('There, you are now able to use all addons!', cid)
        else
            npcHandler:say('Sorry, you do not have enough money.', cid)
        end
    else
        npcHandler:say('I only serve customers with premium accounts.', cid)
    end

    keywordHandler:moveUp(1)
    return true
end

local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 250000 gold coins?'})
    node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 250000, premium = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 500000 gold coins?'})
    node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 500000, premium = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 250000 gold coins and the second addons set for 500000 gold coins.'})

npcHandler:addModule(FocusModule:new())

Doesn't look like you were asking for anything btw.
 
I've changed the addon system on my server but some of the old players still have all the other addons :S How do I remove them? Where in the database?
It's not lookaddons i've tried that :S

Reputation 10x times xD :thumbup:

Hello!

Addons are located in database, table player_storage, from key 10001501 to key 10001521 +/-.

For example:
If you have the first citizen addon, in database will look like this:
Code:
key: 10001501 | value: 65537
If you have only second citizen addon, in database will look like this:
Code:
key: 10001501 | value: 65538
If you have full citizen addons (1 & 2), in database will look like this:
Code:
key: 10001501 | value: 65539

To delete all the addons, execute this query with otserver offline:
PHP:
DELETE FROM `player_storage` WHERE `player_storage`.`key` > 10001500 AND `player_storage`.`key` < 10001530;

Addons system used in TFS 0.3.5pl1
 
Last edited:
Back
Top