|
AlliedModders Donor
|

01-24-2010
, 21:46
Re: Adding show activity with Admin name , very simple
|
#2
|
Quote:
Originally Posted by ngEAr
PHP Code:
#include <amxmisc> #include <cstrike> #define DECREASE_FRAG; // Comment if you don't want to decrease player's frags #if defined DECREASE_FRAG #define KILL_FLAG 0 #else #define KILL_FLAG 1 #endif new g_iMaxPlrs; public plugin_init() { register_plugin("Slay Team", "1.0", "hleV"); register_concmd("amx_slayt", "cmdSlayT", ADMIN_SLAY, "- slays Ts"); register_concmd("amx_slayct", "cmdSlayCT", ADMIN_SLAY, "- slays CTs"); g_iMaxPlrs = get_maxplayers(); } public cmdSlayT(iCl, iLvl, iCmd) { if (!cmd_access(iCl, iLvl, iCmd, 1)) return PLUGIN_HANDLED; for (new iCl = 1; iCl <= g_iMaxPlrs; iCl++) if (is_user_alive(iCl) && cs_get_user_team(iCl) == CS_TEAM_T) user_kill(iCl, KILL_FLAG); return PLUGIN_HANDLED; } public cmdSlayCT(iCl, iLvl, iCmd) { if (!cmd_access(iCl, iLvl, iCmd, 1)) return PLUGIN_HANDLED; for (new iCl = 1; iCl <= g_iMaxPlrs; iCl++) if (is_user_alive(iCl) && cs_get_user_team(iCl) == CS_TEAM_CT) user_kill(iCl, KILL_FLAG); return PLUGIN_HANDLED; }
This is the plugin of the one guy , how to add activity and where it should be added to show.
Admin nick:slay team CT/T
Better if someone can simply reply with edited code for both ct and t.
|
Here is one from xray cat with my xp plugin
PHP Code:
public cmd_take_exp( id, level,cid ) { if( ! cmd_access ( id, level, cid, 3 ) ) return PLUGIN_HANDLED; new target[32], amount[21], reason[21]; read_argv( 1, target, 31 ); read_argv( 2, amount, 20 ); read_argv( 3, reason, 20 ); new player = cmd_target( id, target, 8 ); if( ! player ) return PLUGIN_HANDLED; new admin_name[32], player_name[32]; get_user_name( id, admin_name, 31 ); get_user_name( player, player_name, 31 ); new expnum = str_to_num( amount ); g_XP[player][XP][g_XP[player][Class]] -= expnum; switch(get_cvar_num("amx_show_activity")){ case 1: client_print( 0, print_chat, "ADMIN: took %i points from %s.", expnum, player_name ); case 2: client_print( 0, print_chat, "ADMIN %s: took %i points from %s.", admin_name, expnum, player_name ); } return PLUGIN_HANDLED; }
|
|