marcos16
Falkhonn
- Joined
- May 4, 2012
- Messages
- 224
- Reaction score
- 1
Hello. I have this script for a tradevip. I want it to work only when the player has a vip amount that will remain more than 2 days. Ex:
The minimum transfer amount is 2 days.
Player has 3 days, he tries to transfer 2 [will be 1] but I do not want to give to transfer so, I want a way that the script only works when there is more than 2 days left in the account. [Eg when the player has 4 days And tries to transfer 2].
And when you try to transfer and you are not satisfied, you can send the message "You can not transfer that amount of VIP."
Can anyone make this modification? Thanks in advance.
One more thing, do not send the trade item, so that it only serves for the trade to work, not that when the trade is accepted the player who is receiving the vip does not receive the item.
The minimum transfer amount is 2 days.
Player has 3 days, he tries to transfer 2 [will be 1] but I do not want to give to transfer so, I want a way that the script only works when there is more than 2 days left in the account. [Eg when the player has 4 days And tries to transfer 2].
And when you try to transfer and you are not satisfied, you can send the message "You can not transfer that amount of VIP."
Can anyone make this modification? Thanks in advance.
One more thing, do not send the trade item, so that it only serves for the trade to work, not that when the trade is accepted the player who is receiving the vip does not receive the item.
Lua:
function onSay(cid, words, param, param2, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local itemxx = 5957
local t = string.explode(param, ",")
local creature = getCreatureByName(t[1])
local day = tonumber(t[2])
local storage1 = 223314
local storage2 = 224413
if os.time() > getPlayerStorageValue(cid, storage1) then
setPlayerStorageValue(cid, storage2, 0)
if (creature ~= nil) and isPlayer(creature) and not isPlayerGhost(creature) then
if (day ~= nil) and (type(day) == 'number') and (day>0) then
if (getPlayerPremiumDays(cid)-1) >= day then
doStartTrade(cid, creature, doPlayerAddItem(cid, itemxx, 1))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você deu trade no jogador "..getPlayerName(creature)..", com a intenção de trocar "..day.." dia(s) de VIP.")
doPlayerSendTextMessage(creature, MESSAGE_INFO_DESCR, "O Jogador "..getPlayerName(cid).." deu trade em você, e está disposto a trocar "..day.." dia(s) de VIP.")
setPlayerStorageValue(cid, storage1, os.time()+1*60)
setPlayerStorageValue(cid, storage2, day)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não pode transferir essa quantidade de VIP.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
end
else
doPlayerSendCancel(cid, "Invalid param specified.")
end
return true
end
Last edited by a moderator: