mob/Admin/RuleEnforcer1
verb
Warn(client/C in world)
set category = "Admin"
if(!C) return
switch(alert("Are you sure you want to warn [C.key]?","Warn [C]","Yes","No"))
if("No") return
if("Yes")
var/Warn=input("Include What In The Warning? (Admin Warning: \[Warning\])")
C << "<font color=red>Admin Warning: </font>[Warn] ~ [usr.key]"
AdminLog("Warn","[Warn]",C)
AdminMessage("[usr] Warned [C]: [Warn].")
return
Problem description: So what I am trying to do is pretty obvious: make a warning verb to well, warn them. However, when I test run this verb with multiple players, the verb only recognizes the first person to log in to the game, not all of the players in the world. I have it set up for client/C so that it won't loop through the rest of the NPCs, but I am not sure if that is the correct way to do so. I have also tried mob/PC/P in world, which have the same results. Any help will be much appreciated. Thanks!
1. as an input() in the actual contents of the proc; or
2. you create your own list to store clients upon connection, and remove them when they leave, and use that list in place of world, in the verb definition.
3. create a procedure to generate a list, and call that procedure in place of world, in the verb definition.
Secondly, you don't need that switch statement, it could be simplified to:
You also do not need the return at the end of your proc.
Can you provide a screenshot of what the prompt for players you get looks like? "client/C in world" would actually generate a list of every object in the world, because it does not recognize client as a valid type (verb arguments must be atomic or have no type). Your exact code (minus the three last lines) gives me this: