Raised This Month: $32 Target: $400
 8% 

[L4D2] Auto Bunnyhop


Post New Thread Reply   
 
Thread Tools Display Modes
Tank Rush
Senior Member
Join Date: May 2019
Location: Argentina
Old 03-01-2021 , 22:38   Re: [L4D2] Auto Bunnyhop
Reply With Quote #11

Modify the code so that the !autobhop command is only used by administrators
PHP Code:
public OnPluginStart()
{
    
RegAdminCmd("sm_autobhop"Cmd_AutobhopADMFLAG_SLAY);

The problem is that the game starts with autobhop activated, the other players will have bunnybhop and cannot deactivate it. I try to make bhop only used by admins.
What should I change for the plugin to start disabled?
__________________
Sorry i don't speak english very well

--->My name is Source and I'm on Steam<---
Discord: Source#9382
Tank Rush is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-02-2021 , 19:24   Re: [L4D2] Auto Bunnyhop
Reply With Quote #12

Looking at the code I think the logic is inverted at OnPlayerRunCmd.

Also is missing a variable reset on client disconnect.

Try the attached version (updated to new syntax).
Attached Files
File Type: sp Get Plugin or Get Source (sm_bhop.sp - 356 views - 2.1 KB)
__________________

Last edited by Marttt; 03-02-2021 at 19:29.
Marttt is offline
weffer
Member
Join Date: Oct 2020
Old 03-04-2021 , 12:41   Re: [L4D2] Auto Bunnyhop
Reply With Quote #13

Quote:
Originally Posted by Tank Rush View Post
Modify the code so that the !autobhop command is only used by administrators
PHP Code:
public OnPluginStart()
{
    
RegAdminCmd("sm_autobhop"Cmd_AutobhopADMFLAG_SLAY);

The problem is that the game starts with autobhop activated, the other players will have bunnybhop and cannot deactivate it. I try to make bhop only used by admins.
What should I change for the plugin to start disabled?
try adding this conditional

PHP Code:
public Action:OnPlayerRunCmd(int clientint &buttons)
{
    new 
AdminId:AdminID GetUserAdmin(client);
    if (!
g_AutoBhop[client] && IsPlayerAlive(client) && AdminID != INVALID_ADMIN_ID)
    {
        if (
buttons IN_JUMP)
        {
            if (
GetEntPropEnt(clientProp_Send"m_hGroundEntity") == -1)
            {
                if (
GetEntityMoveType(client) != MOVETYPE_LADDER)
                {
                    
buttons &= ~IN_JUMP;
                }
            }
        }
    }
    return 
Plugin_Continue;


Last edited by weffer; 03-04-2021 at 12:42.
weffer 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 04:47.


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