Raised This Month: $ Target: $400
 0% 

[REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suie
Junior Member
Join Date: Jul 2014
Old 07-16-2014 , 07:22   [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #1

Hello guys this is my first post here (nice to meet you all)

I have little to no experience to programming and i've searched for the last few days(with no luck) an autobunnyhop plugin witch would enable for users from a custom file (name and password or steamid).

The only solution i've found avaible was to link and existent plugin to a certain admin acces or to make it awaible for everyone on the server.

What i really need is to grant bunnyhop abilities only to certain users without giving them admin features.

This is what i would like the plugin to do(pseudocode):

on connect verify the name of the user and search it in the ini/txt file

if name is found then check for password

if the password is incorrect then kick the person and print a message "Reserved Name" or smth like this (this is not a must have, i could just grant name reservation from users.ini)

if name and password are correct enable the bunnyhop abilities

else do nothing

I would like to thank you in advance for the support and i'm sorry if i made typograpical mistakes english is not my first language

Last edited by suie; 07-18-2014 at 15:51.
suie is offline
Old 07-19-2014, 05:05
suie
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
suie
Junior Member
Join Date: Jul 2014
Old 07-30-2014 , 12:40   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #2

bump?
suie is offline
Old 07-30-2014, 20:10
Eagle07
This message has been deleted by Eagle07. Reason: xD
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-30-2014 , 20:45   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #3

Quote:
Originally Posted by Eagle07 View Post
Please, please, please stop posting non-related replies, because it's getting annoying. The register system has nothing to do with bunnyhop (the hell)... Just stop posting for post counts, also comments sort of "Np", "Yo're welcome", etc.
Someone may delete those...
__________________

Last edited by Flick3rR; 07-30-2014 at 20:47.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Mario AR.
Senior Member
Join Date: May 2011
Location: Lima, Perú
Old 07-31-2014 , 02:48   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #4

There are custom flags that give no special access to users. Use one of them.
Here's the Connor's bunny hop plugin edited to work only with users with flag 'o' (ADMIN_LEVEL_C).
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN    "Bhop Abilities"
#define VERSION "0.5.2"
#define AUTHOR    "ConnorMcLeod"

#define MAX_PLAYERS    32

#define OFFSET_CAN_LONGJUMP    356 // VEN
#define BUNNYJUMP_MAX_SPEED_FACTOR 1.7

#define PLAYER_JUMP        6

new g_iCdWaterJumpTime[MAX_PLAYERS+1]
new 
bool:g_bAlive[MAX_PLAYERS+1]
new 
bool:g_bAutoBhop[MAX_PLAYERS+1]

new 
g_pcvarBhopStyleg_pcvarFallDamage
new g_pcvarGravity

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_cvar("bhop_abilities"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
g_pcvarBhopStyle register_cvar("bhop_style""0")  // (1 : no slowdown, 2 : no speed limit)
    
g_pcvarFallDamage register_cvar("mp_falldamage""1.0")

    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
    
register_forward(FM_UpdateClientData"UpdateClientData")
    
register_forward(FM_CmdStart"CmdStart")
    
RegisterHam(Ham_Spawn"player""Check_Alive"1)
    
RegisterHam(Ham_Killed"player""Check_Alive"1)
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamage_player")

    
register_concmd("amx_autobhop""AdminCmd_Bhop"ADMIN_LEVEL_A"<nick|#userid> <0|1>")

    
g_pcvarGravity get_cvar_pointer("sv_gravity")
}

public 
Check_Alive(id)
{
    
g_bAlive[id] = bool:is_user_alive(id)
}

public 
Ham_TakeDamage_player(identidattackerFloat:damagedamagebits)
{
    if( 
damagebits != DMG_FALL )
        return 
HAM_IGNORED

    damage 
*= get_pcvar_float(g_pcvarFallDamage)
    
SetHamParamFloat(4damage)

    return 
HAM_HANDLED
}

public 
CmdStart(iduc_handleseed)
{
    if(    
g_bAlive[id]
    &&    
get_pcvar_num(g_pcvarBhopStyle)
    &&    
get_uc(uc_handleUC_Buttons) & IN_USE
    
&&    pev(idpev_flags) & FL_ONGROUND    )
    {
        static 
Float:fVelocity[3]
        
pev(idpev_velocityfVelocity)
        
fVelocity[0] *= 0.3
        fVelocity
[1] *= 0.3
        fVelocity
[2] *= 0.3
        set_pev
(idpev_velocityfVelocity)
    }
}

public 
Player_Jump(id)
{
    if( !
g_bAlive[id] )
    {
        return
    }
    
    static 
iBhopStyle iBhopStyle get_pcvar_num(g_pcvarBhopStyle)
    if(!
iBhopStyle)
    {
        static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
        if( 
g_bAutoBhop[id] && iOldButtons IN_JUMP && pev(idpev_flags) & FL_ONGROUND)
        {
            
iOldButtons &= ~IN_JUMP
            set_pev
(idpev_oldbuttonsiOldButtons)
            
set_pev(idpev_gaitsequencePLAYER_JUMP)
            
set_pev(idpev_frame0.0)
            return
        }
        return
    }

    if( 
g_iCdWaterJumpTime[id] )
    {
        
//client_print(id, print_center, "Water Jump !!!")
        
return
    }

    if( 
pev(idpev_waterlevel) >= )
    {
        return
    }

    static 
iFlags iFlags pev(idpev_flags)
    if( !(
iFlags FL_ONGROUND) )
    {
        return
    }

    static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
    if( !
g_bAutoBhop[id] && iOldButtons IN_JUMP )
    {
        return
    }

    
// prevent the game from making the player jump
    // as supercede this forward just fails
    
set_pev(idpev_oldbuttonsiOldButtons IN_JUMP)

    static 
Float:fVelocity[3]
    
pev(idpev_velocityfVelocity)

    if(
iBhopStyle == 1)
    {
        static 
Float:fMaxScaledSpeed
        pev
(idpev_maxspeedfMaxScaledSpeed)
        if(
fMaxScaledSpeed 0.0)
        {
            
fMaxScaledSpeed *= BUNNYJUMP_MAX_SPEED_FACTOR
            
static Float:fSpeed
            fSpeed 
floatsqroot(fVelocity[0]*fVelocity[0] + fVelocity[1]*fVelocity[1] + fVelocity[2]*fVelocity[2])
            if(
fSpeed fMaxScaledSpeed)
            {
                static 
Float:fFraction
                fFraction 
= ( fMaxScaledSpeed fSpeed ) * 0.65
                fVelocity
[0] *= fFraction
                fVelocity
[1] *= fFraction
                fVelocity
[2] *= fFraction
            
}
        }
    }

    static 
Float:fFrameTimeFloat:fPlayerGravity
    global_get
(glb_frametimefFrameTime)
    
pev(idpev_gravityfPlayerGravity)

    new 
iLJ
    
if(    (pev(idpev_bInDuck) || iFlags FL_DUCKING)
    &&    
get_pdata_int(idOFFSET_CAN_LONGJUMP)
    &&    
pev(idpev_button) & IN_DUCK
    
&&    pev(idpev_flDuckTime)    )
    {
        static 
Float:fPunchAngle[3], Float:fForward[3]
        
pev(idpev_punchanglefPunchAngle)
        
fPunchAngle[0] = -5.0
        set_pev
(idpev_punchanglefPunchAngle)
        
global_get(glb_v_forwardfForward)

        
fVelocity[0] = fForward[0] * 560
        fVelocity
[1] = fForward[1] * 560
        fVelocity
[2] = 299.33259094191531084669989858532
        iLJ 
1
    
}
    else
    {
        
fVelocity[2] = 268.32815729997476356910084024775
    
}

    
fVelocity[2] -= fPlayerGravity fFrameTime 0.5 get_pcvar_num(g_pcvarGravity)

    
set_pev(idpev_velocityfVelocity)

    
set_pev(idpev_gaitsequencePLAYER_JUMP+iLJ)
    
set_pev(idpev_frame0.0)
}

public 
UpdateClientData(idsendweaponscd_handle)
{
    
g_iCdWaterJumpTime[id] = get_cd(cd_handleCD_WaterJumpTime)
}

public 
client_putinserver(id)
{
    
g_bAutoBhop[id] = !!(get_user_flags(id) & ADMIN_LEVEL_C);

(Untested).
Mario AR. is offline
suie
Junior Member
Join Date: Jul 2014
Old 08-04-2014 , 10:55   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #5

Quote:
Originally Posted by Mario AR. View Post
There are custom flags that give no special access to users. Use one of them.
Here's the Connor's bunny hop plugin edited to work only with users with flag 'o' (ADMIN_LEVEL_C).
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN    "Bhop Abilities"
#define VERSION "0.5.2"
#define AUTHOR    "ConnorMcLeod"

#define MAX_PLAYERS    32

#define OFFSET_CAN_LONGJUMP    356 // VEN
#define BUNNYJUMP_MAX_SPEED_FACTOR 1.7

#define PLAYER_JUMP        6

new g_iCdWaterJumpTime[MAX_PLAYERS+1]
new 
bool:g_bAlive[MAX_PLAYERS+1]
new 
bool:g_bAutoBhop[MAX_PLAYERS+1]

new 
g_pcvarBhopStyleg_pcvarFallDamage
new g_pcvarGravity

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_cvar("bhop_abilities"VERSIONFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
    
g_pcvarBhopStyle register_cvar("bhop_style""0")  // (1 : no slowdown, 2 : no speed limit)
    
g_pcvarFallDamage register_cvar("mp_falldamage""1.0")

    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
    
register_forward(FM_UpdateClientData"UpdateClientData")
    
register_forward(FM_CmdStart"CmdStart")
    
RegisterHam(Ham_Spawn"player""Check_Alive"1)
    
RegisterHam(Ham_Killed"player""Check_Alive"1)
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamage_player")

    
register_concmd("amx_autobhop""AdminCmd_Bhop"ADMIN_LEVEL_A"<nick|#userid> <0|1>")

    
g_pcvarGravity get_cvar_pointer("sv_gravity")
}

public 
Check_Alive(id)
{
    
g_bAlive[id] = bool:is_user_alive(id)
}

public 
Ham_TakeDamage_player(identidattackerFloat:damagedamagebits)
{
    if( 
damagebits != DMG_FALL )
        return 
HAM_IGNORED

    damage 
*= get_pcvar_float(g_pcvarFallDamage)
    
SetHamParamFloat(4damage)

    return 
HAM_HANDLED
}

public 
CmdStart(iduc_handleseed)
{
    if(    
g_bAlive[id]
    &&    
get_pcvar_num(g_pcvarBhopStyle)
    &&    
get_uc(uc_handleUC_Buttons) & IN_USE
    
&&    pev(idpev_flags) & FL_ONGROUND    )
    {
        static 
Float:fVelocity[3]
        
pev(idpev_velocityfVelocity)
        
fVelocity[0] *= 0.3
        fVelocity
[1] *= 0.3
        fVelocity
[2] *= 0.3
        set_pev
(idpev_velocityfVelocity)
    }
}

public 
Player_Jump(id)
{
    if( !
g_bAlive[id] )
    {
        return
    }
    
    static 
iBhopStyle iBhopStyle get_pcvar_num(g_pcvarBhopStyle)
    if(!
iBhopStyle)
    {
        static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
        if( 
g_bAutoBhop[id] && iOldButtons IN_JUMP && pev(idpev_flags) & FL_ONGROUND)
        {
            
iOldButtons &= ~IN_JUMP
            set_pev
(idpev_oldbuttonsiOldButtons)
            
set_pev(idpev_gaitsequencePLAYER_JUMP)
            
set_pev(idpev_frame0.0)
            return
        }
        return
    }

    if( 
g_iCdWaterJumpTime[id] )
    {
        
//client_print(id, print_center, "Water Jump !!!")
        
return
    }

    if( 
pev(idpev_waterlevel) >= )
    {
        return
    }

    static 
iFlags iFlags pev(idpev_flags)
    if( !(
iFlags FL_ONGROUND) )
    {
        return
    }

    static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
    if( !
g_bAutoBhop[id] && iOldButtons IN_JUMP )
    {
        return
    }

    
// prevent the game from making the player jump
    // as supercede this forward just fails
    
set_pev(idpev_oldbuttonsiOldButtons IN_JUMP)

    static 
Float:fVelocity[3]
    
pev(idpev_velocityfVelocity)

    if(
iBhopStyle == 1)
    {
        static 
Float:fMaxScaledSpeed
        pev
(idpev_maxspeedfMaxScaledSpeed)
        if(
fMaxScaledSpeed 0.0)
        {
            
fMaxScaledSpeed *= BUNNYJUMP_MAX_SPEED_FACTOR
            
static Float:fSpeed
            fSpeed 
floatsqroot(fVelocity[0]*fVelocity[0] + fVelocity[1]*fVelocity[1] + fVelocity[2]*fVelocity[2])
            if(
fSpeed fMaxScaledSpeed)
            {
                static 
Float:fFraction
                fFraction 
= ( fMaxScaledSpeed fSpeed ) * 0.65
                fVelocity
[0] *= fFraction
                fVelocity
[1] *= fFraction
                fVelocity
[2] *= fFraction
            
}
        }
    }

    static 
Float:fFrameTimeFloat:fPlayerGravity
    global_get
(glb_frametimefFrameTime)
    
pev(idpev_gravityfPlayerGravity)

    new 
iLJ
    
if(    (pev(idpev_bInDuck) || iFlags FL_DUCKING)
    &&    
get_pdata_int(idOFFSET_CAN_LONGJUMP)
    &&    
pev(idpev_button) & IN_DUCK
    
&&    pev(idpev_flDuckTime)    )
    {
        static 
Float:fPunchAngle[3], Float:fForward[3]
        
pev(idpev_punchanglefPunchAngle)
        
fPunchAngle[0] = -5.0
        set_pev
(idpev_punchanglefPunchAngle)
        
global_get(glb_v_forwardfForward)

        
fVelocity[0] = fForward[0] * 560
        fVelocity
[1] = fForward[1] * 560
        fVelocity
[2] = 299.33259094191531084669989858532
        iLJ 
1
    
}
    else
    {
        
fVelocity[2] = 268.32815729997476356910084024775
    
}

    
fVelocity[2] -= fPlayerGravity fFrameTime 0.5 get_pcvar_num(g_pcvarGravity)

    
set_pev(idpev_velocityfVelocity)

    
set_pev(idpev_gaitsequencePLAYER_JUMP+iLJ)
    
set_pev(idpev_frame0.0)
}

public 
UpdateClientData(idsendweaponscd_handle)
{
    
g_iCdWaterJumpTime[id] = get_cd(cd_handleCD_WaterJumpTime)
}

public 
client_putinserver(id)
{
    
g_bAutoBhop[id] = !!(get_user_flags(id) & ADMIN_LEVEL_C);

(Untested).
it's not what i'm looking for sorry
suie is offline
suie
Junior Member
Join Date: Jul 2014
Old 08-22-2014 , 14:37   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #6

bump?
suie is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-22-2014 , 15:32   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #7

The file must be in your configs folder with the name PlayersBhop.ini
On each new line you must put the SteamID of the player, who will auto bunny hop.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

new Trie:g_tBhopPlayers

new g_AuthID[32][33]

public 
plugin_init()
{
    
register_plugin("Bhop From File""1.0""Flicker")
    
    
g_tBhopPlayers TrieCreate()
    
    
LoadBhoppers()
}

public 
client_connect(id)
    
get_user_authid(idg_AuthID[id], charsmax(g_AuthID))

public 
client_PreThink(id)
{
    
//Code thanks to Cheesy Petesa from his AutoBhop Plugin!
    
if(entity_get_int(idEV_INT_button) & && TrieKeyExists(g_tBhopPlayersg_AuthID[id]))
    {
        new 
flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP || entity_get_int(idEV_INT_waterlevel) >= || !(flags FL_ONGROUND))
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 250.0
        entity_set_vector
(idEV_VEC_velocityvelocity)

        
entity_set_int(idEV_INT_gaitsequence6)
    }
    
//Code thanks to Cheesy Petesa from his AutoBhop Plugin!
    
    
return PLUGIN_CONTINUE
}

public 
LoadBhoppers()
{
    new 
szFilePath[128]
    
get_configsdir(szFilePathcharsmax(szFilePath))
    
add(szFilePathcharsmax(szFilePath), "/PlayersBhop.ini")
    
    new 
fopen(szFilePath"rt")
    
    if(!
f
    { 
        new 
szMessage[128]
        
formatex(szMessagecharsmax(szMessage), "Unable to open %s"szFilePath)
        
set_fail_state(szMessage)
    } 
    
    new 
data[32]
    while(!
feof(f)) 
    { 
        
fgets(fdatacharsmax(data)) 
        
        
trim(data)
        
        if(!
data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/'
            continue
        
        
TrieSetCell(g_tBhopPlayersdata1)
    } 
    
fclose(f

__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
suie
Junior Member
Join Date: Jul 2014
Old 08-25-2014 , 15:19   Re: [REQ] AutoBunnyhop for users loaded from a txt/ini file with no admin acces
Reply With Quote #8

Quote:
Originally Posted by Flick3rR View Post
The file must be in your configs folder with the name PlayersBhop.ini
On each new line you must put the SteamID of the player, who will auto bunny hop.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

new Trie:g_tBhopPlayers

new g_AuthID[32][33]

public 
plugin_init()
{
    
register_plugin("Bhop From File""1.0""Flicker")
    
    
g_tBhopPlayers TrieCreate()
    
    
LoadBhoppers()
}

public 
client_connect(id)
    
get_user_authid(idg_AuthID[id], charsmax(g_AuthID))

public 
client_PreThink(id)
{
    
//Code thanks to Cheesy Petesa from his AutoBhop Plugin!
    
if(entity_get_int(idEV_INT_button) & && TrieKeyExists(g_tBhopPlayersg_AuthID[id]))
    {
        new 
flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP || entity_get_int(idEV_INT_waterlevel) >= || !(flags FL_ONGROUND))
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 250.0
        entity_set_vector
(idEV_VEC_velocityvelocity)

        
entity_set_int(idEV_INT_gaitsequence6)
    }
    
//Code thanks to Cheesy Petesa from his AutoBhop Plugin!
    
    
return PLUGIN_CONTINUE
}

public 
LoadBhoppers()
{
    new 
szFilePath[128]
    
get_configsdir(szFilePathcharsmax(szFilePath))
    
add(szFilePathcharsmax(szFilePath), "/PlayersBhop.ini")
    
    new 
fopen(szFilePath"rt")
    
    if(!
f
    { 
        new 
szMessage[128]
        
formatex(szMessagecharsmax(szMessage), "Unable to open %s"szFilePath)
        
set_fail_state(szMessage)
    } 
    
    new 
data[32]
    while(!
feof(f)) 
    { 
        
fgets(fdatacharsmax(data)) 
        
        
trim(data)
        
        if(!
data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/'
            continue
        
        
TrieSetCell(g_tBhopPlayersdata1)
    } 
    
fclose(f

works like a charm thank you very much
suie 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 09:51.


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