Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- vip_coin = 3723, -- Vip coin ID
- }
- function onSay(cid, words, param)
- if(words == "/buypremium") then
- local t = string.explode(param, ",")
- if(param == '') then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true
- end
- if not tonumber(t[1]) then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true
- end
- if doPlayerRemoveItem(cid, vip_coin, tonumber(t[2])) then
- doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
- doPlayerAddPremiumDays(cid, tonumber(t[2]))
- addEvent(doRemoveCreature, 5*1000, cid, true)
- db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
- doPlayerSendTextMessage(cid, 22, ""..getCreatureName(cid).." added "..t[2].." days of Premium Account, removed "..tonumber(t[2]).."vip coins.")
- else
- doPlayerSendTextMessage(cid, 22, "You need "..tonumber(t[2]).."vip coins to buy "..t[2].." days of Premium Account!")
- end
- return true
- end
- end
Add Comment
Please, Sign In to add comment