While learn3r has a good idea about using tokens, for something like this, I think using mIRC's user list is a better idea.
on *:text:!adduser*:*:{
.user add $$2-
}
on *:text:!remuser*:*:{
.user rem $$2-
}
alias user {
var %users = $replace($2-,$chr(44),$chr(32)), %a = 1, %b = $numtok(%users,32)
while %a <= %b {
$iif($1 == add,.auser -a,.ruser) user $gettok(%users,%a,32)
inc %a
}
}
on user:text:!addevent*:#:{
.write -il1 events.txt $2-
}
on user:text:!event:#:{
.play $nick events.txt
}
To add/remove valid users via a client other than the one running the code:
!adduser <nick(s)>
!remuser <nick(s)>
To add/remove valid users via the client running the code:
/user add <nick(s)>
/user rem <nick(s)>
If specifying multiple nicks, they can be space and/or comma separated.