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

Trash


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
doondook
Member
Join Date: Dec 2010
Old 07-09-2011 , 23:23   Trash
Reply With Quote #1

Trashed.

Last edited by doondook; 06-27-2012 at 02:55.
doondook is offline
juan2394
Member
Join Date: Sep 2010
Old 07-10-2011 , 01:25   Re: Hunting Bunnies v.1.0
Reply With Quote #2

Quote:
public client_connect(id){ //dunno need it or not, but i believe that's needed
g_hands[id] = false
LOL
juan2394 is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 07-10-2011 , 06:36   Re: Hunting Bunnies v.1.0
Reply With Quote #3

If I hold the space button I get kicked, this means LOTS of false detections and lots of complains from players.
BeasT is offline
Send a message via Skype™ to BeasT
doondook
Member
Join Date: Dec 2010
Old 07-10-2011 , 08:00   Re: Hunting Bunnies v.1.0
Reply With Quote #4

BeasT, fixed.
I tried new realisation of this principle, but the old one is still better.
doondook is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-10-2011 , 08:02   Re: Hunting Bunnies v.1.1
Reply With Quote #5

Btw, would be much better if you cache "is_user_bot" and "is_user_alive".
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
doondook
Member
Join Date: Dec 2010
Old 07-10-2011 , 09:17   Re: Hunting Bunnies v.1.1
Reply With Quote #6

I don't understand you. What does mean cache? There is the condition in PreThink.
doondook is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-10-2011 , 11:25   Re: Hunting Bunnies v.1.1
Reply With Quote #7

Look here:

http://forums.alliedmods.net/showthread.php?p=767048
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
doondook
Member
Join Date: Dec 2010
Old 07-11-2011 , 10:23   Re: Hunting Bunnies v.1.1
Reply With Quote #8

Can u gimme a code? Don't understand what u mean.
doondook is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-11-2011 , 11:26   Re: Hunting Bunnies v.1.1
Reply With Quote #9

I also forgot to say that it is a requirement to use pcvars. So I added it here. I hope, you understand what the code does.

PHP Code:
#include <amxmodx>
#include <colorchat>
#include <fun>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Hunting Bunnies"
#define VERSION "1.1"
#define AUTHOR "Doondook"

#define SetUserBot(%1)        g_bIsBot |= 1<<(%1&31)
#define ClearUserBot(%1)    g_bIsBot &= ~(1<<(%1&31))
#define IsUserBot(%1)        g_bIsBot & 1<<(%1&31)

#define SetUserAlive(%1)    g_bIsAlive |= 1<<(%1&31)
#define ClearUserAlive(%1)    g_bIsAlive &= ~(1<<(%1&31))
#define IsUserAlive(%1)        g_bIsAlive & 1<<(%1&31)

#define SetUserConnected(%1)    g_bIsConnected |= 1<<(%1&31)
#define ClearUserConnected(%1)    g_bIsConnected &= ~(1<<(%1&31))
#define IsUserConnected(%1)    g_bIsConnected & 1<<(%1&31)

new g_bIsBotg_bIsAliveg_bIsConnectedbhop_limit

new g_frames[33]
new 
g_bhops[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""Player_Spawn"1)
    
RegisterHam(Ham_Killed"player""Player_Killed")
    
    
bhop_limit register_cvar("bhop_limit""2")
}

public 
client_putinserver(id)
{
    
ClearUserAlive(id)
    
SetUserConnected(id)
    
    if(
is_user_bot(id) || is_user_hltv(id))
        
SetUserBot(id)
}

public 
client_disconnect(id)
{
    
ClearUserAlive(id)
    
ClearUserConnected(id)
    
ClearUserBot(id)
}

public 
Player_Spawn(id)
{
    if(
is_user_alive(id))
    {
        
SetUserAlive(id)
    }
}

public 
Player_Killed(victimkillershouldgib)
{
    
ClearUserAlive(victim)
}

public 
client_PreThink(id)
{
    if(~
IsUserBot(id) && IsUserAlive(id))
    {
        new 
button entity_get_int(idEV_INT_button)    
        new 
jump = (button IN_JUMP)
        
        if(
jump && get_speed(id)>floatround(get_user_maxspeed(id)) && g_frames[id]<5){
            
g_frames[id]++
            if(!
task_exists(id))
                
set_task(0.3"BHop_Check"id)
        }
        
        if(
get_speed(id)<=floatround(get_user_maxspeed(id)))
            
g_bhops[id]=0
    
}
}

public 
BHop_Check(id)
{
    if(~
IsUserConnected(id))
        return
    
    if(
g_frames[id]==1)
    {
        
g_bhops[id]++
        if(
g_bhops[id]==get_pcvar_num(bhop_limit))
        {
            new 
name[32]
            
get_user_name(idname31)
            
ColorChat(0RED"^4%s ^3has been kicked! ^1'Bunny Hop' scripts are detected."name)
            
server_cmd("kick #%d using 'Bunny Hop' scripts"get_user_userid(id))
        }
    }
    
g_frames[id]=0

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
doondook
Member
Join Date: Dec 2010
Old 07-11-2011 , 11:38   Re: Hunting Bunnies v.1.1
Reply With Quote #10

It has any advantages?
doondook is offline
Reply



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:37.


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