Raised This Month: $51 Target: $400
 12% 

Button Log (Zombie Escape) Cs 1.6


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
McTavish
Senior Member
Join Date: May 2021
Old 07-11-2021 , 16:48   Button Log (Zombie Escape) Cs 1.6
Reply With Quote #1

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
Attached Files
File Type: sma Get Plugin or Get Source (ButtonLog.sma - 228 views - 1.9 KB)

Last edited by McTavish; 12-31-2022 at 08:59. Reason: UPDATED!
McTavish is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode