ID:1545329
 
(See the best response by MisterPerson.)
Code:
                    var/list/arenaplayers = list(/**/)
for(var/mob/player/M in world)

if(M == usr) arenaplayers =- M
if(M.level > 99) arenaplayers += M
if(M.creating)arenaplayers-=M
if(M.inspace)arenaplayers-=M
if(M.cansave)arenaplayers-=M
if(M.questzone)arenaplayers-=M
if(M in arena2)arenaplayers-=M


Problem description:
I want to remove usr from that list since he is using it and inviting other people. But if I use
 if(M == usr) arenaplayers =- M
to remove it I get runtime error: type mismatch: 0 += Phat (/mob/player). Can someone tell me what am I doing wrong here.

Assuming it's a verb, can't you just directly remove usr from the list? Also, the runtime error is because the list is null. You can't remove something from nothing. If they meet a certain criteria, it would be best to just NOT add them to the list.
Than again even if I make list full, it will do the same thing.

Like this:
                    var/list/arenaplayers = list(/**/)
for(var/mob/player/M in world)
arenaplayers += M
if(usr == M) arenaplayers -= M


Woah, your indentation is a bit off, there.


Don't remove the usr from the list, but call continue. I could post a snippet, but I'm on mobile.
nvm I fix it by doing this :

                    var/list/arenaplayers = list(/**/)
for(var/mob/player/M in world)
if(M!=usr)
if(M.level > 99) arenaplayers += M
Best response
For the record, your problem was that the line arenaplayers =- M

Should have been arenaplayers -= M

You were setting areanplayers = (-M), I think.