Resolved Button button_detector flood stop.

Coding Help/Re-API Supported
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 115 times
Age: 22
Contact:

Re: Button button_detector flood stop.

#21

Post by Raheem » 2 Years Ago

Rain1153 wrote:
2 Years Ago
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
[Zombie Escape] [Zombie Escape] Chris Pressed the BUTTON!
This is the one i'm talking about!
You tested my code?
Loading Raheem's signature, Please wait...
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 2 Years Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 19
Contact:

#22

Post by Rain1153 » 2 Years Ago

yes but it seems to not work players can still spam
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 2016
Joined: 3 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 115 times
Age: 22
Contact:

#23

Post by Raheem » 2 Years Ago

Rain1153 wrote:
2 Years Ago
yes but it seems to not work players can still spam
For this i tested it and it's working without any problem. Just make sure to change the cvar to any value you need as it's 0.5 sec so maybe you don't see the cvar: viewtopic.php?p=5473#p5473
Loading Raheem's signature, Please wait...
Image

User avatar
sam_bhosale4
Mod Tester
Mod Tester
India
Posts: 109
Joined: 3 Years Ago
Location: INDIA
Has thanked: 5 times
Been thanked: 2 times
Age: 22
Contact:

#24

Post by sam_bhosale4 » 2 Years Ago

I guess hes talking about my plugin Press Button Info not escape button!
Because even i get flood by this button people spams too much!
plugin needs no flood delay..
-=SeRious-GaminG|Zombie Escape[Alien vs. Predator]|Asia=-
206.189.132.169:40000
Image

Obada
Member
Member
Palestine
Posts: 27
Joined: 2 Years Ago
Has thanked: 0
Been thanked: 0
Contact:

#25

Post by Obada » 2 Years Ago

sam_bhosale4 wrote:
2 Years Ago
I guess hes talking about my plugin Press Button Info not escape button!
Because even i get flood by this button people spams too much!
plugin needs no flood delay..
About this,, you can use this edited plugin, ofcourse thanks to @Raheem

Code: Select all

#include <zombie_escape>
#include <amxmisc>

#define PLUGIN "Cooldown type command"
#define VERSION "1.0"
#define AUTHOR "Freeman"

#define MAX_PLAYERS 32

new CvarCooldown
new Float:CommandNextTime[MAX_PLAYERS+1]

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    CvarCooldown = register_cvar("amx_cmd_cooldown", "60")

    RegisterHam(Ham_Use, "func_button", "Fw_ButtonUsed_Post", 1)
}

public Fw_ButtonUsed_Post(iEnt, id)
{
    new Float:gametime = get_gametime()
    new Float:command_next_time = CommandNextTime[id]

    if( gametime < command_next_time )
    {
        //new Float:timeleft = command_next_time - gametime
        //client_print(id, print_chat, "You must wait %.0f second%s to use this command", timeleft, (1.0 <= timeleft < 2.0) ? "s" : "")

        return
    }

    CommandNextTime[id] = gametime + get_pcvar_float(CvarCooldown) - 55
	
	new szTargetName[51]; get_entvar(iEnt, var_target, szTargetName, charsmax(szTargetName))
	new szCallerName[32]; get_user_name(id, szCallerName, charsmax(szCallerName))
	
			// Player Pressed button is Human?
		if (!ze_is_user_zombie(id))
		{
					ze_colored_print(0, "!tButton pressed by!y: !g%s", szCallerName)		
		}
		
		
    
}  
This make a delay for 5 second per player.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests