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

isSummon(cid)

jestemPolakiem

New Member
Joined
Oct 17, 2009
Messages
48
Reaction score
2
Location
Poland
PHP:
function isSummon(sid)
	for i, pid in ipairs(getPlayersOnline()) do
		for c, cid in pairs(getCreatureSummons(pid)) do
			if (cid == sid) then
				return true
			end
		end 
	end
	return false
end
 
Code:
function isSummon(cid)
	return getCreatureMaster(cid) ~= cid
end

? ;d
 
Code:
function isSummon(cid)
	return getCreatureMaster(cid) ~= cid
end
fffffffuuuuuuuuuuuuuuu
Code:
	lua_pushnumber(L, master ? env->addThing(master) [B][COLOR="Red"]: cid[/COLOR][/B]);
:d will always be > 0
 
0.4 Ver.
Lua:
function isSummon(cid)
	return getCreatureMaster(cid);
end

:)
 
Last edited:
yep, that's why i wrote it. using TFS rev 3660:
PHP:
if(Creature* master = creature->getMaster())
		lua_pushnumber(L, env->addThing(master));
	else
		lua_pushnil(L);
 
Code:
    for i, [B]pid[/B] in ipairs(getPlayersOnline()) do
        for c, [B]cid[/B] in pairs(getCreatureSummons(pid)) do
            if ([B]cid == sid[/B]) then
                return true
wtf?,
edit: need to be more detailed, i mean "cid == sid" and "for i, pid" etc
 
Last edited:
Back
Top