Nerevr back
Member
- Joined
- Nov 7, 2014
- Messages
- 269
- Reaction score
- 7
i need to edite this script to remove items for one day premium
cost = 1,
id = 9970
= one day premium if i need to buy 2 days must have 2 items 9970
cost = 1,
id = 9970
= one day premium if i need to buy 2 days must have 2 items 9970
Code:
local cfg = {
cost = 1,
id = 9970
}
function onSay(cid, words, param)
if getPlayerPremiumDays(cid) <= 365 then
if param == "" then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not a valid param.")
return TRUE
end
if getPlayerPremiumDays(cid) + param <= 365 then
local cost = param * cfg.id,cfg.cost
if doPlayerRemoveItem(cid, cfg.id, cfg.cost) == TRUE then
doPlayerAddPremiumDays(cid, param)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought ".. param .." days of premium account.")
else
doPlayerSendCancel(cid, "You don't have " .. getItemNameById(cfg.id) .. "to buy premium.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You can not buy more than one year of Premium Account.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return TRUE
end