SetNum 

Usage:
/SetNum (options) variable value

Description:
       This command will set any number variable to a value. If the value is 0, the event for that variable being set to zero will be executed (z_variable). If the value begins with a +, the value is added to or subtracted from the current value (depending on if the number is negative) If the value is "+1", all records will be updated as if this key was incremented normally. The alltime record will be updated, and any "a_" events will be executed.

Option:

Option Range Default Description
ring primary, secondary, server, game primary Specifies the target keyring for this addition. Primary and secondary refer to player keys for the current event or command.

Example:


/SetNum example

# This is the !gender player command from the qlad_base.cfg script
# It toggles between two values on a key, using /SetNum to set them.

on pcmd_gender cmd {
  if ($(ps-gender)==1) {/say_resp * You will now be known as male;/setnum s-gender 0;};
  else {/say_resp * You will now be known as female;/setnum s-gender 1;};
};

# This is an event to check if a player has said gay, and keeps a count on that.

on a_say cmd if ($rmatch($(a0-),*gay*)) /SetNum saidgay +1;