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

TFS 1.X+ Working for GOD but not for players

Svira

Active Member
Joined
Jan 27, 2008
Messages
267
Solutions
11
Reaction score
36
Hello, I want the script to be for all players, unfortunately, works only for GOD

Code:
local function doPlayerAddPremiumPoints(cid, count)
   db.query('UPDATE znote_accounts SET points = points+'.. count ..' WHERE id = ' .. getAccountNumberByPlayerName(getCreatureName(cid)))
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local player = Player(cid)
   doPlayerAddPremiumPoints(cid, 500)
   player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have recived 500 shop points to your account.")
   player:getPosition():sendMagicEffect(28)
   item:remove(1)
   return true
end

TFS 1.2
ZNOTE DB
Actions ItemID
 
Solution
Can't see any line that require God group/access to use, How is it added to XML?
Maybe try this one
Lua:
local addpoints = 500 -- amount of points to add

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if isPlayer(player) and doRemoveItem(item.uid, 1) then
        db.query("UPDATE znote_accounts SET points = points + "..addpoints.." WHERE account_id = '" ..player:getAccountId().. "';")
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points has been added to your account.")
        return true
    else
        return false
    end
end
Can't see any line that require God group/access to use, How is it added to XML?
Maybe try this one
Lua:
local addpoints = 500 -- amount of points to add

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if isPlayer(player) and doRemoveItem(item.uid, 1) then
        db.query("UPDATE znote_accounts SET points = points + "..addpoints.." WHERE account_id = '" ..player:getAccountId().. "';")
        doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, ""..addpoints.." premium points has been added to your account.")
        return true
    else
        return false
    end
end
 
Solution
Back
Top