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

summons name

Strack

Member
Joined
May 15, 2009
Messages
199
Reaction score
14
How can I check summons name?

f.ex.: an script which sends to player a message with the name of his summons

Thanks
 
Code:
function onSay(cid, words, param, channel)
	local summons,str = getCreatureSummons(cid), "Your summons are: "
	for i = 1,#summons do
		str = str .. getCreatureName(summons[i]) .. (i == #summons and "" or ", ")
	end
	if #summons == 0 then
		str = "You dont have any summons."
	end
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
	return true
end
 
Last edited:
tested, when I have no summons runs correct:
15:02 You dont have any summons.

but when I have 1 or more summons:
Code:
[03/08/2010 15:02:21] [Error - Action Interface] 
[03/08/2010 15:02:21] data/actions/scripts/testear.lua:onUse
[03/08/2010 15:02:21] Description: 
[03/08/2010 15:02:21] data/actions/scripts/testear.lua:5: attempt to index global 'summon' (a nil value)
[03/08/2010 15:02:21] stack traceback:
[03/08/2010 15:02:21] 	data/actions/scripts/testear.lua:5: in function <data/actions/scripts/testear.lua:1>
 
Back
Top