finduser 

$finduser(Search string, variable name)

The finduser function is the same as findplayer, except that it searches for watching the server from console. It will return 1 if it found one, 0 if not (and will set the variable to an error string).

Example:


$finduser() example

# Setup a msg command for players to privately message a watcher.

on pcmd_msg cmd {
 if ($(ac)<3) /say_resp * Sends a private message to a player, usage: !msg >name< %gt;msg<;
 else if (!$findplayer($(a1),plr)) {
  if (!$finduser($(a1),plr2)) /say_resp * $(serv,@plr);
  else {
   /setchar tmpmsg "$(a2-)";
   /say_resp .-> ($c@plr2) $(a2-);
# /say_resp with a name argument set sends the message to a console user
   /say_resp (name=$c@plr2) \[Message from $(pn)\] $a2-;
   };
  };
 else {
  /setchar tmpmsg "$(a2-)";
  /say_resp .-> ($($(serv,@plr),n)) $(a2-);
  doas ($(serv,@plr),$(pz)) /say_resp \[Message from $(sn)\] $(s,@tmpmsg);
 };
};