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

Lua !withdraw premium_points in game

marcelao777

New Member
Joined
Sep 9, 2011
Messages
81
Reaction score
0
Hi, I need withdraw (! withdraw "x) premium_points and appear in my bag gold ingot 's, and decrease my balance and deposit premium_points (! deposit" x) and the gold ingot disappeared from my bag and increase my balance premium_points, if you can help me I thank

local ingot = 9971
local ingotcost = 1

function onSay(cid, words, param, channel)
if param == "sacar" then


if(getAccountPoints(cid) >= ingotcost) then
if(doAccountRemovePoints(cid, ingotcost) == TRUE) then
doPlayerRemoveItem(cid, ingot, ingotcost)


doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " ..param.. " is not currently online.")
return TRUE
end
end
doAccountRemovePoints(cid, count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "" ..count.. " premium points were deleted from " ..getCreatureName(pid).. "\'s Account.")
return true
end
 
You can use:

!withdraw amount
!deposit amount

0.3.6 version.

Code:
local item_in_game = 1111 --Item the premium points convert to.

function onSay(cid, words, param, channel)

if (words == "!withdraw") then
    if not param or param == "" then return doPlayerSendCancel(cid, "You must type an amount to withdraw (100 max)") end
   
    paramNum = tonumber(param)
   
    if getPlayerPremiumDays(cid) >= paramNum then
        doPlayerRemovePremiumDays(cid, paramNum)
        doPlayerAddItem(cid, item_in_game, paramNum, true)
    end

elseif (words == "!deposit") then
    if not param or param == "" then return doPlayerSendCancel(cid, "You must type an amount to deposit (100 max)") end
   
    paramNum = tonumber(param)
   
    if getPlayerItemCount(cid, item_in_game) >= paramNum then
        doPlayerRemoveItem(cid, item_in_game, paramNum, true)
        doPlayerAddPremiumDays(cid, paramNum)
    end
end
return true
end
 
Back
Top