• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Remove Premium Points using talkaction

Noval

Web Designing
Joined
Feb 5, 2013
Messages
2
Reaction score
1
Location
Sweden
Here you are
go in your lib folder and add in your function.lua this code:
Lua:
function doRemovePremiumPoints(cid, days)
    db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end

then go into talkaction/talkactions.xml and post the following:
XML:
	<talkaction log="yes" words="/removepoints" access="5" event="script" value="removepoint.lua"/>

then in talkactions/scripts create file name removepoint.lua and post the following:
Lua:
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
                        return true
                end
        end
 
 
        sender = getPlayerByNameWildcard(cid)
 
    doRemovePremiumPoints(pid, t[1])
    doPlayerSendTextMessage(cid, "You have removed ".. t[1] .." premium points to ".. t[2])
    doPlayerSendTextMessage(pid, sender .." just removed you ".. t[1] .." premium points.")    
        return true
end

if there any problems i will be glad to help you

Rep Me if it help you
 
Back
Top