ID:143325
 
Code:
    Staff()
set name = "Teleport"
var/L = new/list()
for(var/mob/player/M in world)
L += M.name
L += "Cancel"
var/choice = input("Who would you like to Teleport next too?") in L
if(choice == "Cancel")
return
for(var/mob/player/M in world)


Problem description:
Basicly my staff have punish people using this and when they tried to punish a guy with a name "§¢£ A £¢§"

it said,

Sorry, the following is not valid: ¢£---A---£¢§
usage: parameter

Why did it say that ?
Domedaydevice141 wrote:
Code:
>   Staff()
> set name = "Teleport"
> var/L = new/list()
> for(var/mob/player/M in world)
> L += M.name
> L += "Cancel"
> var/choice = input("Who would you like to Teleport next too?") in L
> if(choice == "Cancel")
> return
> for(var/mob/player/M in world)
>

Problem description:
Basicly my staff have punish people using this and when they tried to punish a guy with a name "§¢£ A £¢§"

it said,

Sorry, the following is not valid: ¢£---A---£¢§
usage: parameter

Why did it say that ?
Try to block those kind of characters i their names because those characters ("%^!*$^£--) may cause errors while trying to punish them using commands.

[Not sure if i am correct, but its what i think]
In response to Dark Duo Productions
or you can just put "as anything" after the input() but before the "in list" portion.
In response to Ter13
Just a small tip, it saves you a line of code
    Staff()
set name = "Teleport"
var/L = new/list()
for(var/mob/player/M in world)
L += M.name
// L += "Cancel" <- there is no need for this
var/choice = input("Who would you like to Teleport next too?") in L + list("Cancel")
if(choice == "Cancel")
return
for(var/mob/player/M in world)
In response to Kakashi24142
Though, while longer to type it is more efficient to use the += operator when applicable. + just needlessly creates an extra list in these cases.
Your posted code obviously isn't whole; it wouldn't compile.
If already on the subject of tips;
--Use typecasting, especially when you're already typing the type path to use new() anyway (you still only need to type it once).

--It's probably faster to loop threw clients than atoms or mobs, even if it's a special type.

--You don't have to specifically add the name to the list; it's more useful to keep a reference, and if used with an input() box, the list will display the names anyway.

--Do not include a "Cancel" option in the list of choices; that's just bad practice and extra typing. input() has a built-in support for canceling; the 'as null' type filter. If you need the player to choose from a list then you use 'as null|anything in list()' (unsure about the order; 'null' may come last). Then check if the returned value of input() isn't false; you do this anyway when inputting text and perhaps numbers (if 0 is unallowed)

--You don't always have to store values in variables; you can use procs directly in an expression; though with input() that can create a very long and perhaps complex line, so it's ok to use a var if you're not comfortable with that.

--You should only use the name setting when required; moreover you should name the verb nodes according to what they do; as it is the path to /Staff isn't telling you that it's the teleport verb and can lead to confusion.
In response to Kakashi24142
In that case, just forget the friggin' Cancel entry and just use the button.
input() as ***null***|anything in L

without the stars. I put them in there for emphasis. To check to see if the person has clicked the cancel button, check to see if the choice variable is null.
if(!choice) return