View difference between Paste ID: KS4a7zkM and gjrp3pNh
SHOW: | | - or go back to the newest paste.
1
local config = {
2
	vip_coin = 3723, -- Vip coin ID
3
}
4
5
function onSay(cid, words, param)
6
 
7
	if(words == "/buypremium") then  
8
	local t = string.explode(param, ",")   
9
 
10
	if(param == '') then
11
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true
12
	end
13
 
14
	if not tonumber(t[1]) then  
15
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true
16
	end  
17
                               
18
	if doPlayerRemoveItem(cid, vip_coin, tonumber(t[2])) then
19-
		doPlayerAddPremiumDays(cid, tonumber(t[2]))
19+
		doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)
20-
			addEvent(doRemoveCreature, 5*1000, cid, true)
20+
			doPlayerAddPremiumDays(cid, tonumber(t[2]))
21-
				db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
21+
				addEvent(doRemoveCreature, 5*1000, cid, true)
22-
					doPlayerSendTextMessage(cid, 22, ""..getCreatureName(cid).." added "..t[2].." days of Premium Account, removed "..tonumber(t[2]).."vip coins.")
22+
					db.executeQuery("UPDATE `players` SET `name` = '[Vip] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
23-
				else
23+
						doPlayerSendTextMessage(cid, 22, ""..getCreatureName(cid).." added "..t[2].." days of Premium Account, removed "..tonumber(t[2]).."vip coins.")
24-
					doPlayerSendTextMessage(cid, 22, "You need "..tonumber(t[2]).."vip coins to buy "..t[2].." days of Premium Account!")
24+
					else
25-
				end
25+
						doPlayerSendTextMessage(cid, 22, "You need "..tonumber(t[2]).."vip coins to buy "..t[2].." days of Premium Account!")
26-
					return true
26+
					end
27-
				end
27+
						return true
28-
			end
28+
					end
29
				end