Description:
Many players suffer from some kind of player that ruins the run of the zombie escape by pressing some button (close the door on the team, call on the team,...etc) for that this plugin is for this kind of problem that gives you the name of the true criminal
How this plugin work:
This Plugin Show the Player Who Pressed The Button(LOG) on the chat only to admins with a flag (ADMIN_SLAY)
Author:Amnesia(Me)
Example:
***BUTTON PRESSED BY Human: Amnesia***
***BUTTON PRESSED BY Zombie: Amnesia***
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#define PLUGIN "[ZP] Plugin: Show Button Pressed"
#define VERSION "1.0"
#define AUTHOR "Amnesia"
#define ADMIN_FLAG ADMIN_SLAY
new anti_flood_last_ent[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Use, "func_button", "fw_UseStationary")
RegisterHam(Ham_Use, "func_rot_button", "fw_UseStationary")
}
public fw_UseStationary(entity, caller, activator, use_type)
{
if(anti_flood_last_ent[caller] == entity)
return HAM_IGNORED
static class[32]
static name[32]; get_user_name(caller, name, 31);
entity_get_string(entity, EV_SZ_targetname, class, 31)
if(!class[0])
entity_get_string(entity, EV_SZ_target, class, 31)
if(get_user_team(caller) == 1)
{
// Display message as red if the user is a terrorist
client_printcolor(0, "*** BUTTON PRESSED BY Zombie %s ***", name)
}
else
{
// Display message as blue if the user is not a terrorist
client_printcolor(0, "*** BUTTON PRESSED BY Human %s ***", name)
}
anti_flood_last_ent[caller] = entity
remove_task(caller)
set_task(3.0, "anti_flood_reset", caller)
return HAM_IGNORED
}
public anti_flood_reset(id) anti_flood_last_ent[id] = 0
stock client_printcolor(const id,const input[], any:...)
{
new msg[191], players[32], count = 1; vformat(msg,190,input,3);
replace_all(msg,190,"!g","^4"); // green
replace_all(msg,190,"!y","^1"); // normal
replace_all(msg,190,"!t","^3"); // team
replace_all(msg,190,"!r","^1"); // red
replace_all(msg,190,"!b","^4"); // blue
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
This Is My First Plugin, I Hope this is useful ^^
This Plugin Is Very Useful For Zombie Escape and ty