ID:160177
Oct 31 2008, 11:52 am
|
|
ADD_Var(mob/M as mob in world) set category = "Add Admin" var/X = input("Which var?","Var") in M.vars var/N = input("Add how much to [X]") as num M.X+= N usr<<"You Added [N] [X] to [M]" is there a way to make this work? I'm missing how to allow M.X? |
In response to IainPeregrine
|
|
Note associative lists do support just doing List[key] += num and as such directly.
|
Variable names accessed via the . operator must be identifiers, not non-constant values like text strings. In order to use a non-constant value to access a variable, you can use the vars list.