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

i need a help wif functions

foxkbt

Member
Joined
Sep 29, 2009
Messages
290
Reaction score
7
Location
Salvador
first: I want a function that checks whether the player has a certain monster summoned "as wolf or rat, you know?"

looking at the lua_functions i found this ...

getCreatureSummons(cid)

but I dont know as usal =(
i try that
getCreatureSummons(cid) == wolf
getCreatureSummons(cid) == "wolf"
getCreatureSummons(cid, "wolf")
getCreatureSummons(cid) == (getCreatureName("wolf"))
getCreatureSummons(cid, getCreatureName("wolf"))

but none of them work

second: I dont have idea of how to create a function to remove a summon XD

third: if someone have a script lua tfs manual or tutorial "no noob tutorial" please post here
i need it t mutch
 
Code:
getCreatureSummons(cid)
	Info
		This functions checks for creature summons list.

	Returns
		false if creature not found, otherwise table with creatures list (NOTE: Can be empty!)

	Example
		local summons = getCreatureSummons(cid)
		if(table.maxn(summons) <= 0) then -- no summons
			doPlayerSendCalcel(cid, "You don't have any summons..")
			return false
		end

	-- remove all summons ;)
		for _, pid in ipairs(summons) do
			doRemoveCreature(pid)
		end

If you want to remove a summon you can use the example posted above. If you want to remove a summon which has a specific name you can use the following code:

Code:
local summons = getCreatureSummons(cid)
for _, pid in ipairs(summons) do
	if (getCreatureName(pid) == "Wolf") then
	doRemoveCreature(pid)
	end
end
 
Back
Top