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

marcos16

Falkhonn
Joined
May 4, 2012
Messages
224
Reaction score
1
Hello,
I need to put 2 actions in this script.
Get to negotiate with 1 or 2 sqm of distances (maximum).
Business minimum of 2 days.
Get negotiated only if 2 days of premium is left in the account. Example:
You have 3 days premium, you will not get it because there will be only 1 day left.
4 days will work because 2 will be left over.
REP + for those who help

Code:
function onSay(cid, words, param, channel)

local t = string.explode(param, ",")
local target = getCreatureByName(t[1])
local points = tonumber(t[2])

if(param == '') then
    return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
end

if (target ~= nil) and isPlayer(target) and not isPlayerGhost(target) then
    if (points ~= nil) and (type(points) == 'number') and (points>0) then
        if (getAccountPoints(cid) >= points) then
            doTradeOrbs(cid, target, points)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You do not have enough points.")
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
    end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end

return true
end
 
I suggest you rewrite your post with a better explanation of what you need.

I really tried to understand what u said but I can't.

For example:
Get to negotiate with 1 or 2 sqm of distances (maximum).

- distances of what, who, where?

So much questions came to my mind while reading your post. Make it more clear.
 
Back
Top Bottom