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

[Talkactions] Players cant say it

Ataro

Member
Joined
Oct 28, 2010
Messages
689
Reaction score
20
Location
Netherlands
I got an talk action that i can use (no ingame text :P) but players cant use it!
Whats wrong?
talkactions.xml
XML:
<talkaction words="!points" event="script" value="currentpoints.lua"/>
currenpoints.lua
LUA:
function onSay(cid, words)
	doPlayerPopupFYI(cid, "You currently have: " .. CurrentPoints(getPlayerAccount(cid)) .. " points.")
	return true
end
 
Ofc not if people are not going to steal
LUA:
function CurrentPoints(accountName)
	playerpoints = db.getResult('SELECT `premium_points` FROM `accounts` WHERE `name` = ' .. accountName .. ' LIMIT 1;')
	return playerpoints:getDataInt("premium_points")
end
 
LUA:
local exhaust = 12345
local time = 60

function onSay(cid, words, param, channel)

    if exhaustion.check(cid, exhaust) then
        doPlayerSendCancel(cid, 'You can\'t use this command yet['..exhaustion.get(cid, exhaust)..'].')
        return true
    else
        exhaustion.set(cid, exhaust, time)
    end
    
    local result = db.getResult('SELECT `premium_points` FROM `accounts` WHERE `accounts`.`id` = '.. getPlayerAccountId(cid))
    local data = result:getDataInt('premium_points')
    result:free()
    doPlayerPopupFYI(cid, 'You currently have: ' .. data .. ' points.')
    return true
end
 
Back
Top