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