• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Command !soulpoints

Mbest

New Member
Joined
Dec 8, 2009
Messages
7
Reaction score
0
i need a !soulpoints command to refill soul points to 200 and only for premium accounts and cost 10000gp... anyone have something like this?
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	local cfg = { 
		full = 200,
		price = 10000
	}
	if(getPlayerSoul(cid) >= cfg.full) then
		doPlayerSendCancel(cid, "Your soul points are full already.")
	elseif(no isPremium(cid)) then
		doPlayerSendCancel(cid, "You must have premium account.")
	elseif(getPlayerMoney(cid) < cfg.price) then
		doPlayerSendCancel(cid, "You do not have enough money.")
	else
		doPlayerRemoveMoney(cid, cfg.price)
		doPlayerAddSoul(cid, cfg.full - getPlayerSoul(cid))
		doCreatureSay(cid, "Your soul points have been refilled!", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Last edited:
Code:
local cfg = { 
	full = 200,
	price = 10000
}
function onSay(cid, words, param, channel)
	local c = getPlayerSoul(cid) >= cfg.full and 1 or isPremium(cid) == FALSE and 2 or doPlayerRemoveMoney(cid, cfg.price) == FALSE and 3 or nil
	return TRUE, c and doPlayerSendCancel(cid, c == 1 and "Your soul points are full already." or c == 2 and "You must have premium account." or c == 3 and "You do not have enough money.") or doPlayerAddSoul(cid, cfg.full - getPlayerSoul(cid)) and doCreatureSay(cid, "Your soul points have been refilled!", TALKTYPE_ORANGE_1)
end
 
It works just fine... :confused:

Yes, but if table with config is inside function it'll be 'loaded' each time when script is executed, and if config table is outside function, it'll be 'loaded' only while loading script. :p
 
Back
Top