ID:171672
 
M as all mobs logged into the world

Ex: mob/M as mob in world
No idea what you're asking. Detail good.

Lummox JR
In response to Lummox JR
Example: M as mob in world

How would you code: M as ALL mobs in world
In response to ZLegend
what are you asking?
Explain it better.
In response to ZLegend
ZLegend wrote:
Example: M as mob in world

How would you code: M as ALL mobs in world

You just said the same thing. Elaborate. Give us some details. What are you trying to do?

Lummox JR
In response to ZLegend
for(var/mob/M in world)
world<<M.name


Loops through all the mobs, tells the world their name.
for(var/mob/M in world)


In response to Lummox JR
Im wanting to check everyone's inventory and erase everyone's items I think they should not have.

Elaborating further...

I have a professional draft system. Draft picks are issued to team owners in the form of objects.

I don't want people to be able to save their draft picks and unfairly use them in a later draft. In conclusion, I want to run a proc to scan everyone's inventory and deletes a certain item.
In response to ZLegend
for(var/mob/M in world)
var/obj/banned/O = /obj/banned
if([M.inventory] == /obj/banneditem)
del(O)


i THINK that should work, i'm not sure about the
if([M.inventory] == /obj/banneditem) but it does show you how to choose every mob.
In response to DeathAwaitsU
I did this. It deletes the demanded item in my inventory when I use it in a verb. I still haven't tested it with multiple mobs in the game.

proc/no_more_picks1()
for(var/mob/E in world)
for(var/obj/Round1_Pick1/A in E.contents)
if(A)
del A
In response to ZLegend
You're not using it as a verb by the way but that will work with more than 1 person logged in.

This is a slightly shorter version with a verb...

verb/no_more_picks1()
for(var/mob/M in world)
for(var/obj/Round1_Pick1/A in M.contents)
del A
In response to DeathAwaitsU
I am not displaying it in the forum currently as a verb. I used it as a verb though then made it into a proc again.