Page 1 of 2
Button button_detector flood stop.
Posted: 14 Jan 2018, 12:55
by xxGamerxx
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.
Re: Button button_detector flood stop.
Posted: 14 Jan 2018, 20:00
by Raheem
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.
Re: Button button_detector flood stop.
Posted: 14 Jan 2018, 20:13
by xxGamerxx
@[mention]Raheem[/mention] 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.
Re: Button button_detector flood stop.
Posted: 15 Jan 2018, 16:41
by xxGamerxx
@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.
Re: Button button_detector flood stop.
Posted: 15 Jan 2018, 19:41
by Raheem
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)
}
}
}
}
Re: Button button_detector flood stop.
Posted: 15 Jan 2018, 20:25
by xxGamerxx
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
Re: Button button_detector flood stop.
Posted: 20 Jan 2018, 11:27
by Raheem
We can add delay but explain more how you need it to be.
Re: Button button_detector flood stop.
Posted: 25 Jan 2018, 12:01
by Obada
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.
Re: Button button_detector flood stop.
Posted: 25 Jan 2018, 22:42
by xxGamerxx
Raheem wrote: ↑6 years ago
We can add delay but explain more how you need it to be.
Like @Obada said my brother.
Re: Button button_detector flood stop.
Posted: 26 Jan 2018, 12:15
by Night Fury
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)
}
}
}
Re: Button button_detector flood stop.
Posted: 26 Jan 2018, 12:36
by xxGamerxx
I got error when i compile it:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team
//// ze_escape_button_detector_no_flood.sma
//
// D:\scripting\ze_escape_button_detector_no_flood.sma(19) : warning 213: tag mismatch
// D:\scripting\ze_escape_button_detector_no_flood.sma(19) : error 035: argument type mismatch (argument 3)
//
// 1 Error.
// Could not locate output file D:\scripting\compiled\ze_escape_button_detector_no_flood.amx (compile failed).
//
// Compilation Time: 0.91 sec
// ----------------------------------------
Press enter to exit ...
Re: Button button_detector flood stop.
Posted: 26 Jan 2018, 13:15
by Obada
Re: Button button_detector flood stop.
Posted: 26 Jan 2018, 14:21
by Obada
Try this:
Code: Select all
#include <zombie_escape>
#include <amxmisc>
new not_allow
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))
if(!not_allow)
{
// 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)
not_allow = true
set_task(5.0, "allow")
}
}
}
}
}
public allow(id)
{
not_allow = false
}
Re: Button button_detector flood stop.
Posted: 26 Jan 2018, 16:19
by Raheem
OK, Here it's:
Code: Select all
#include <zombie_escape>
#include <amxmisc>
// Variables
new Float:g_flLastUsed[33]
// Cvars
new pCvarFloodTime
public plugin_init ()
{
register_plugin("[ZE] Admin Button Message", "1.1", "Raheem")
// Hams
RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
// Cvar
pCvarFloodTime = register_cvar("ze_button_message_flood_time", "0.5")
}
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))
{
if ((get_gametime() - g_flLastUsed[iCallerID]) > get_pcvar_float(pCvarFloodTime))
{
ze_colored_print(id, "!tButton pressed by!y: !g%s", szCallerName)
g_flLastUsed[iCallerID] = get_gametime()
}
}
}
}
}
Cvar
ze_button_message_flood_time 0.5
can take any value (Integer or Float) examples: 0.001 - 0.01 - 0.1 - 5 .. etc
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 02:14
by xxGamerxx
Thank you!
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 16:10
by Rain1153
Raheem it's not working players can still spam button
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 16:17
by Raheem
OH, Fixed i should concentrate next time.. Sorry for this.
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 16:20
by Rain1153
i'm trying obada's one i think it should help
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 16:36
by Rain1153
It's ok bro what did you modify in the code? btw
Re: Button button_detector flood stop.
Posted: 27 Jan 2018, 16:43
by Rain1153
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
This is the one i'm talking about!