ID:146421
 
when i use a verb to display the guilds, (say there are 5 guilds) it will tell me the name of my guild 5 times. Please help?
Code:
mob/verb/Guild_Info()
set category="Guild"
usr<<"<b>Guilds"
for(var/T in guilds)
for(var/mob/players/P in world)
if(P.key)
usr<<"<font face=tahoma><b>[T]"
var/online=0

for(var/mob/players/M in world)
if(M.guild==T)
online+=1
if(T == usr.guild)
usr<<"<b><small>You have [online] members in your guild"



Yushiotto wrote:
Code:
> mob/verb/Guild_Info()
> set category="Guild"
> usr<<"<b>Guilds"
> for(var/T in guilds)
> for(var/mob/players/P in world)
> if(P.key)
> usr<<"<font face=tahoma><b>[T]"
> var/online=0
>
> for(var/mob/players/M in world)
> if(M.guild==T)
> online+=1
> if(T == usr.guild)
> usr<<"<b><small>You have [online] members in your guild"
>


So, if guilds is a list with guilds, you will get the guild's name for every mob/players with a client in world...
If mob/player is your usual client.mob it will tell you the guild players-in-world times.

> mob/verb/Guild_Info()
> set category="Guild"
> usr<<"<b>Guilds"
> for(var/T in guilds)
> P<<"<font face=tahoma><b>[T]"
> var/online=0
>
> for(var/mob/players/M in world)
> if(M.guild==T)
> online+=1
> if(T == usr.guild)
> usr<<"<b><small>You have [online] members in your guild"
>

Now it should work ^^