• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

CountOnlineGuildMembers(cid) EDIT

Scooty

Enemia.EU
Joined
Jul 24, 2010
Messages
564
Reaction score
14
Location
Kraków
Hi i have this function:

PHP:
function CountOnlineGuildMembers(cid)
local pguild = getPlayerGuildName(cid)
        count = 0
        for _, cid in pairs(getPlayersOnline()) do
                if getPlayerGuildName(cid) == pguild then
                        count = count + 1
                end
        end
        return count
end


but i want to do something like: CountOnlineGuildMembersWithDifferentIP(cid)

can someone edit it for me?

thanks
 
Not sure about this.

LUA:
function countOnlineGuildMembersWithDifferentIP(cid)
	if not isPlayer(cid) then
		return 0
	end
	local id, count, ip = getPlayerGuildId(cid), 0, {}
	
	if id <= 0 then
		return 0
	end
	
	for _, pid in pairs(getPlayersOnline()) do 
		if getPlayerGuildId(pid) == id then
			if not isInArray(ip, getPlayerIp(pid)) then
				count = count + 1
				table.insert(ip, getPlayerIp(pid))
			end
		end 
	end 
	return count 
end
 
Last edited:
dont work ;/

PHP:
[21:49:00.025] [Error - CreatureScript Interface]
[21:49:00.025] data/creaturescripts/scripts/gift.lua
[21:49:00.025] Description:
[21:49:00.025] (internalGetPlayerInfo) Player not found when requesting player info #11
0
 
Back
Top