> > > >

show_activity_id | amxmisc | AMX X Documentation

Includes

    1. Stocks
    1. Natives
    2. Forwards
    1. Natives
    2. Stocks
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    2. Forwards
    1. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Stocks
    1. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    1. Stocks
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Stocks
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Stocks
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Stocks

show_activity_id

Syntax
									stock show_activity_id(idtarget, idadmin, const name[], const fmt[], any:...)
									{
     if (idtarget == 0 || !is_user_connected(idtarget))
     {
          return;
     }

     static __amx_show_activity;
     if (__amx_show_activity == 0)
     {
          __amx_show_activity = get_cvar_pointer("amx_show_activity");

          // if still not found, then register the cvar as a dummy
          if (__amx_show_activity == 0)
          {
               __amx_show_activity = register_cvar("amx_show_activity", "2", FCVAR_PROTECTED);
          }
     }

     static prefix[10];
     if (is_user_admin(idadmin))
     {
          copy(prefix, charsmax(prefix), "ADMIN");
     }
     else
     {
          copy(prefix, charsmax(prefix), "PLAYER");
     }

     static buffer[512];
     vformat(buffer, charsmax(buffer), fmt, 5);

     switch (get_pcvar_num(__amx_show_activity))
     {
          case 5: // hide name only to admins, show nothing to normal users
          {
               if (is_user_admin(idtarget))
               {
                    client_print(idtarget, print_chat, "%L: %s", idtarget, prefix, buffer);
               }
          }
          case 4: // show name only to admins, show nothing to normal users
          {
               if (is_user_admin(idtarget))
               {
                    client_print(idtarget, print_chat, "%L %s: %s", idtarget, prefix, name, buffer);
               }
          }
          case 3: // show name only to admins, hide name from normal users
          {
               if (is_user_admin(idtarget))
               {
                    client_print(idtarget, print_chat, "%L %s: %s", idtarget, prefix, name, buffer);
               }
               else
               {
                    client_print(idtarget, print_chat, "%L: %s", idtarget, prefix, buffer);
               }
          }
          case 2: // show name to all
          {
               client_print(idtarget, print_chat, "%L %s: %s", idtarget, prefix, name, buffer);
          }
          case 1: // hide name to all
          {
               client_print(idtarget, print_chat, "%L: %s", idtarget, prefix, buffer);
          }
     }
}
								
Variable Description
idtarget
Client index to display message to
id
Client index performing the action
name
Name of client performing the action
fmt
Formatting rules
...
Variable number of formatting parameters

Description
Standard method to show admin activity to a single client. This depends on the amx_show_activity cvar. See documentation for more details.

Return
This function has no return value.
> > > >