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

How to use local config?

kaszanalubizryc

New Member
Joined
Sep 10, 2015
Messages
148
Reaction score
1
hello i need know how i can here use local config?

Code:
local config = {
    [24345] = {coins = 10},
    [24346] = {coins = 20}
}

local function doPlayerAddPremiumPoints(cid, count)
        db.query('UPDATE accounts SET premium_points = premium_points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    doPlayerAddPremiumPoints(cid, 10)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have recived 10 shop points to your account.")
    doSendMagicEffect(getCreaturePosition(cid), 28)
    doRemoveItem(item.uid,1)
    return true
end
 
doPlayerAddPremiumPoints(cid, config[item.uid].coins) , but you need check if the item isInArray with the local config.

@edit: to say the true dont need check, you will put in xml only items that will call the script
 
Last edited:
Back
Top