Resolved Button button_detector flood stop.

Coding Help/Re-API Supported
xxGamerxx
Member
Member
Jordan
Posts: 12
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

Button button_detector flood stop.

#1

Post by xxGamerxx » 1 Year Ago

Hello developers,

Can anyone edit this plugin ze_escape_button_detector.sma and make it no flood, i mean when someone press "e" every time the message occur and spam the chat. So if we can make a delay between every button message from same player like 1 second delay.

I see this plugin have same idea but it for radio flood not for button detector.

And thanks in advanced.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#2

Post by Raheem » 1 Year Ago

Welcome, ze_escape_button_detector plugin is for only detecting the button name and then you don't need it at all. First you use it to detect the button name then when you get name place it in zombie_escape.ini and remove this plugin at all. Only enable the escape button message plugin. Hope you get me.
You don't know? Learn and you will know.

xxGamerxx
Member
Member
Jordan
Posts: 12
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by xxGamerxx » 1 Year Ago

@@Raheem Thank you for your replay, i make edit on this button to show the player name who called the button, to force play team and no one closed/break on team. So i decide to make this plugin only for admins and no flood button msg.

xxGamerxx
Member
Member
Jordan
Posts: 12
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#4

Post by xxGamerxx » 1 Year Ago

@raheem this is the code of my edit

Code: Select all

#include <zombie_escape>
#include <cstrike>

public plugin_init ()
{
	register_plugin("[ZE] Escape Button Detector", "1.1", "Raheem")
	RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
}

public Fw_ButtonUsed_Post(iEnt, iCallerID)
{
	new szTargetName[51]; get_entvar(iEnt, var_target, szTargetName, charsmax(szTargetName))
	new szCallerName[32]; get_user_name(iCallerID, szCallerName, charsmax(szCallerName))
	new CsTeams:team = cs_get_user_team(iCallerID) // Getting team 
	//ze_colored_print(iCallerID, "!tButton pressed by!y: !g%s", szCallerName) //this just show for self player
	
	//CS_TEAM_CT or CS_TEAM_T	
	if (team == CS_TEAM_CT){
		ze_colored_print(0, "!tButton pressed by!y: !g%s", szCallerName)
	}
}

I tried to show this message only to admins only ...

Code: Select all

#include <zombie_escape>
#include <cstrike>

public plugin_init ()
{
	register_plugin("[ZE] Escape Button Detector", "1.1", "Raheem")
	RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
}

public Fw_ButtonUsed_Post(iEnt, iCallerID)
{
	new szTargetName[51]; get_entvar(iEnt, var_target, szTargetName, charsmax(szTargetName))
	new szCallerName[32]; get_user_name(iCallerID, szCallerName, charsmax(szCallerName))
	new CsTeams:team = cs_get_user_team(iCallerID) // Getting team 
	//ze_colored_print(iCallerID, "!tButton pressed by!y: !g%s", szCallerName) //this just show for self player
	
	//CS_TEAM_CT or CS_TEAM_T	
	if (team == CS_TEAM_CT){
	if(is_user_admin(iCallerID)){
		ze_colored_print(0, "!tButton pressed by!y: !g%s", szCallerName)
		}
	}
}
But the problem this edited only show only when the caller is admin.

I need to replace "iCallerID" by each player id if the player admin or no.

Like

Code: Select all

for(every player in server == admin){
ze_colored_print(0, "!tButton pressed by!y: !g%s", szCallerName)
}
I hope to get solution from some developers here.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#5

Post by Raheem » 1 Year Ago

Here:
  • Code: Select all

    #include <zombie_escape>
    #include <amxmisc>
    
    public plugin_init ()
    {
    	register_plugin("[ZE] Escape Button Detector", "1.1", "Raheem")
    	RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
    }
    
    public Fw_ButtonUsed_Post(iEnt, iCallerID)
    {
    	new szTargetName[51]; get_entvar(iEnt, var_target, szTargetName, charsmax(szTargetName))
    	new szCallerName[32]; get_user_name(iCallerID, szCallerName, charsmax(szCallerName))
    	
    	// Player Pressed button is Human?
    	if (!ze_is_user_zombie(iCallerID))
    	{
    		for(new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
    		{
    			if (is_user_admin(id))
    			{
    				ze_colored_print(id, "!tButton pressed by!y: !g%s", szCallerName)
    			}
    		}
    	}
    }
You don't know? Learn and you will know.

xxGamerxx
Member
Member
Jordan
Posts: 12
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#6

Post by xxGamerxx » 1 Year Ago

Thank you very much @raheem, bro do you have idea about abusing this fucntion so if we can do delay between first message and next message?

I'll try to do that but if you help me then we can save some time. <3

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#7

Post by Raheem » 1 Year Ago

We can add delay but explain more how you need it to be.
You don't know? Learn and you will know.

Obada
Member
Member
Palestine
Posts: 27
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#8

Post by Obada » 1 Year Ago

the purpose from delay is to prevent flood. for example if someone click on button for many times in less than 1 seconds you'll see the chat flooded by button message.

I search around i see this plugin https://cs-bg.info/plugin/936/ but this plugin for stop flooding the radio.

I go to try to make similar on button message, but no luck.

xxGamerxx
Member
Member
Jordan
Posts: 12
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#9

Post by xxGamerxx » 1 Year Ago

Raheem wrote:
1 Year Ago
We can add delay but explain more how you need it to be.
Like @Obada said my brother.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 626
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#10

Post by Mohamed Alaa » 1 Year Ago

Try this:

Code: Select all

#include <zombie_escape>
#include <amxmisc>

public plugin_init ()
{
	register_plugin("[ZE] Escape Button Detector", "1.1", "Raheem")
	RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
}

public Fw_ButtonUsed_Post(iEnt, iCallerID)
{
	new szTargetName[64], szCallerName[32]
	get_entvar(iEnt, var_target, szTargetName, charsmax(szTargetName))
	get_user_name(iCallerID, szCallerName, charsmax(szCallerName))
	
	// Player Pressed button is Human?
	if (!ze_is_user_zombie(iCallerID))
	{
		set_task(30, "print", szCallerName, _, _, "a", 1)
	}
}

public print(szCallerName)
{
	for(new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
	{
		if (is_user_admin(id))
		{
			ze_colored_print(id, "!tButton pressed by!y: !g%s", szCallerName)
		}
	}
}
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest