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

[Talkaction] and [Vocation] Problem.. Rep+

Rthom19

New Member
Joined
Mar 2, 2009
Messages
50
Reaction score
0
Location
Australia
Hey,
I have this talkaction script but it doesnt work..
Code:
function onSay(cid, words, param, channel)
	if (isKnight(cid) ~= true or isPaladin(cid) ~= true) then
		doPlayerSendCancel(cid, "Your vocation can't use this command.")
		return true
	end

	if (param == "") then
		doPlayerSendCancel(cid, "You have to type !broadcast message.")
		return true
	end

	if (exhaustion.get(cid, 12345) ~= false) then
		doPlayerSendCancel(cid, "You are exhausted.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return true
	end

	for _, pid in ipairs(getPlayersOnline())
		if (isPaladin(pid) == true or isKnight(pid) == true) then
			doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, param)
		end
	end

	return true
end

I get this error in console
Code:
[27/09/2009 02:11:55] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/playerbroadcast.lua)
[27/09/2009 02:11:55] data/talkactions/scripts/playerbroadcast.lua:19: 'do' expected near 'if'

Also can it be made so all vocs can use but depending on the persons voc to who it broadcasts too?

E.G.
A Person with voc 1, 2 or 3 uses !broadcast MESSAGE and that only shows to other people with voc 1, 2 and 3.
Same with voc 4, 5 and 6.
7,8 and 9.
and 10, 11 and 12.


And the vocation problem(Very easy i assume)
How do i set a certain looktype to a certain vocation?

Thanks~
 
Lua:
function onSay(cid, words, param, channel)
	if (isKnight(cid) ~= true or isPaladin(cid) ~= true) then
		doPlayerSendCancel(cid, "Your vocation can't use this command.")
		return true
	end

	if (param == "") then
		doPlayerSendCancel(cid, "You have to type !broadcast message.")
		return true
	end

	if (exhaustion.get(cid, 12345) ~= false) then
		doPlayerSendCancel(cid, "You are exhausted.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		return true
	end

	for _, pid in ipairs(getPlayersOnline()) do
		if (isPaladin(pid) == true or isKnight(pid) == true) then
			doPlayerSendTextMessage(pid, MESSAGE_STATUS_WARNING, param)
		end
	end

	return true
end

Heres your script just fixed
 
Back
Top