ID:554194
 
(See the best response by Stephen001.)
Code:
mob
var
list
BlockList = list()
PM = 1
verb
PM()
set hidden = 1
var/list/players = list()
for(var/mob/Player/M in world)
if(M.creating) players-=M // NOT WORKING
if(M.client && M.PM) players += M // WORKING
if(M == usr) players-=M // WORKING
if(usr.key in M.BlockList) players-=M
players += "Nevermind"


Problem description:
Everything alse is restricted from list like it supposeto be just if(M.creating) player is not restricted.

Best response
It's basically an order issue. Consider the following case:

You have a player mob, with an attached (so not null) client, and they have PM enabled, and they are also "creating".

Your code will firstly remove them from the list of players (because they are "creating") but then immediately afterwards, add them back into the list of players because they have PM enabled. Just move the statement down, so that you do your additions to the list first, and removals afterwards to prune the list back.

Ideally, you'd actually just put the removals first, but replace 'players -= M' with 'continue', letting you skip over those mobs that shouldn't be in the list. Then you don't need to remove them, as they are never added in the first place.

Usual deal, as I see you've posted here /a lot/ lately. +1 the most helpful post please.
Ty and i have 1 more question

    Topic(href,href_list[])
switch(href_list["action"])
if("PM")
var/msg = input("What would you like to privately say to [src] ([src.key])?","Private Message") as text|null
usr.Filter_Text(msg,"Private-Message",src)
. = ..()

everytime PM is cliked it opens input twice.. Why ?
This is an unrelated issue, please post it off in a new topic. I think you're going to need to provide more context for that though, like what Filter_Text does, other Topic() procedures on the same mob type etc, as there's nothing enormously obvious in that short snippet.
Personally I would use

for(var/mob/Player/M in world)
if(M.creating || (M == usr) || usr.key in M.BlockList)
continue
else if (M.client && M.PM)
players += M