Button button_detector flood stop.
Button button_detector flood stop.
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.
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.
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.
He who fails to plan is planning to fail
@[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.
@raheem this is the code of my edit
I tried to show this message only to admins only ...
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
I hope to get solution from some developers here.
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)
}
}
}
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)
}
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) } } } }
He who fails to plan is planning to fail
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
I'll try to do that but if you help me then we can save some time. <3
We can add delay but explain more how you need it to be.
He who fails to plan is planning to fail
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.
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.
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
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)
}
}
}
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 ...
Try this bro:
https://forums.alliedmods.net/showthread.php?t=280657
When i go home, i'll try to made it.
https://forums.alliedmods.net/showthread.php?t=280657
When i go home, i'll try to made it.
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
}
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() } } } } }
ze_button_message_flood_time 0.5
can take any value (Integer or Float) examples: 0.001 - 0.01 - 0.1 - 5 .. etcHe who fails to plan is planning to fail
Thank you!
OH, Fixed i should concentrate next time.. Sorry for this.
He who fails to plan is planning to fail
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
This is the one i'm talking about!
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
This is the one i'm talking about!
LOL
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: Bing [Bot] and 3 guests