• 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!

[REQUEST] Talkation of Promotion- (normal promotion)

sophina

New Member
Joined
Jun 18, 2008
Messages
9
Reaction score
0
[REQUEST] Talkation of Promotion- (normal promotion)

plz help.

for tfs beta.
 
More info please? =o

Anyway, I think you mean buy prom via talkaction, so try this (Not tested yet):
Code:
local config {
	promotion = 1,	-- promotion level, default = 1 . Ignore if you don't have new vocations.
	minLevel = 20,	-- Level needed to buy promotion
	cost = 20000 	-- Promotion cost in gp
}

function onSay(cid, words, param)
	if(getPlayerPromotionLevel(cid) >= config.promotion) then
		doPlayerSendCancel(cid, "You are already promoted.")
	elseif(getPlayerLevel(cid) < config.minLevel) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. config.minLevel .. " to get 

promotion.")
	elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion 

cost " .. config.cost .. " gp.")
	else
		setPlayerPromotionLevel(cid, config.promotion)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. 

getVocationInfo(getPlayerVocation(cid)).name .. ".")
	end
	return TRUE
end
 
error

[10/12/2008 13:04:12] Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/promotion.lua
[10/12/2008 13:04:12] data/talkactions/scripts/promotion.lua:1: unexpected symbol near '{'
[10/12/2008 13:04:37] Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/promotion.lua
[10/12/2008 13:04:37] data/talkactions/scripts/promotion.lua:3: unexpected symbol near '='

:S errors:S
 

Similar threads

Back
Top