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

plugin only for steam id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
conn
Member
Join Date: Dec 2013
Old 11-30-2017 , 02:55   plugin only for steam id
Reply With Quote #1

hello i'd like to know if a plugin can be set by steam id
something in the code

in another words
that a certain plugin works only for my steam account and doesnt matter if others admins have all the flags.

the plugin i want to make work only for my steam id is:

PHP Code:
/*
 *
 *    Author:        Cheesy Peteza
 *    Date:        22-Apr-2004 (updated 2-March-2005)
 *
 *
 *    Description:    Enable bunny hopping in Counter-Strike.
 *
 *    Cvars:
 *            bh_enabled        1 to enable this plugin, 0 to disable.
 *            bh_autojump        If set to 1 players just need to hold down jump to bunny hop (no skill required)
 *            bh_showusage        If set to 1 it will inform joining players that bunny hopping has been enabled
 *                        and how to use it if bh_autojump enabled.
 *
 *    Requirements:    AMXModX 0.16 or greater
 *
 *
 */

#include <amxmodx>
#include <engine>

#define    FL_WATERJUMP    (1<<11)    // player jumping out of water
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground

public plugin_init() {
    
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza")
    
register_cvar("sbhopper_version""1.2"FCVAR_SERVER)

    
register_cvar("bh_enabled""1")
    
register_cvar("bh_autojump""1")
    
register_cvar("bh_showusage""1")
}

public 
client_PreThink(id) {
    if (!
get_cvar_num("bh_enabled"))
        return 
PLUGIN_CONTINUE

    entity_set_float
(idEV_FL_fuser20.0)        // Disable slow down after jumping

    
if (!get_cvar_num("bh_autojump"))
        return 
PLUGIN_CONTINUE

// Code from CBasePlayer::Jump (player.cpp)        Make a player jump automatically
    
if (entity_get_int(idEV_INT_button) & 2) {    // If holding jump
        
new flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(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)    // Play the Jump Animation
    
}
    return 
PLUGIN_CONTINUE
}

public 
client_authorized(id)
    
set_task(30.0"showUsage"id)

public 
showUsage(id) {
    if ( !
get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
        return 
PLUGIN_HANDLED

    
if ( !get_cvar_num("bh_autojump") ) {
        
client_print(idprint_chat"[AMX] Bunny hopping is enabled on this server. You will not slow down after jumping.")
    } else {
        
client_print(idprint_chat"[AMX] Auto bunny hopping is enabled on this server. Just hold down jump to bunny hop.")
    }
    return 
PLUGIN_HANDLED

conn is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-30-2017 , 03:01   Re: plugin only for steam id
Reply With Quote #2

Here
PHP Code:
#include <amxmodx>
#include <engine>

#define MY_STEAMID "<steamid>"

#define    FL_WATERJUMP    (1<<11)    // player jumping out of water
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground

public plugin_init() {
    
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza")
    
register_cvar("sbhopper_version""1.2"FCVAR_SERVER)
}

public 
client_PreThink(id) {
        new 
szSteamID[32];
        
get_user_steamid(idszSteamIDcharsmax(szSteamID));

    if (
equal(szSteamIDMY_STEAMID))
        return 
PLUGIN_CONTINUE

    entity_set_float
(idEV_FL_fuser20.0)        // Disable slow down after jumping

// Code from CBasePlayer::Jump (player.cpp)        Make a player jump automatically
    
if (entity_get_int(idEV_INT_button) & 2) {    // If holding jump
        
new flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(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)    // Play the Jump Animation
    
}
    return 
PLUGIN_CONTINUE

__________________

Last edited by Relaxing; 11-30-2017 at 07:19.
Relaxing is offline
conn
Member
Join Date: Dec 2013
Old 11-30-2017 , 03:13   Re: plugin only for steam id
Reply With Quote #3

sorry but i dont understand, the code you posted is the same i did, there is no modification, thanks for answering
conn is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-30-2017 , 08:41   Re: plugin only for steam id
Reply With Quote #4

It's different code but it's done terribly (getting a SteamID and comparing it to another string in prethink is terribly inefficient).

It's also absurd that someone would ask for something like this, IMO.
__________________

Last edited by fysiks; 11-30-2017 at 08:42.
fysiks is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 11-30-2017 , 09:17   Re: plugin only for steam id
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
It's different code but it's done terribly (getting a SteamID and comparing it to another string in prethink is terribly inefficient).

It's also absurd that someone would ask for something like this, IMO.
Show him a-nother way THEN.
__________________
Relaxing is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 11-30-2017 , 09:20   Re: plugin only for steam id
Reply With Quote #6

Check permission on client_putinserver and check for that on prethink instead of grabbing the Steam ID every time.
__________________
Kia is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 11-30-2017 , 10:10   Re: plugin only for steam id
Reply With Quote #7

Quote:
Originally Posted by Relaxing View Post
Show him a-nother way THEN.
compare it on connect and set a variable to true.

p.s. i didn`t see last comment
__________________
retired chump

Last edited by DjSoftero; 11-30-2017 at 10:11.
DjSoftero is offline
InsanityKARAI
Member
Join Date: Jul 2014
Old 12-01-2017 , 15:50   Re: plugin only for steam id
Reply With Quote #8

PHP Code:
/* 

*    Author:        Cheesy Peteza 
*    Date:        22-Apr-2004 (updated 2-March-2005) 


*    Description:    Enable bunny hopping in Counter-Strike. 

*    Cvars: 
*            bh_enabled        1 to enable this plugin, 0 to disable. 
*            bh_autojump        If set to 1 players just need to hold down jump to bunny hop (no skill required) 
*            bh_showusage        If set to 1 it will inform joining players that bunny hopping has been enabled 
*                        and how to use it if bh_autojump enabled. 

*    Requirements:    AMXModX 0.16 or greater 


*/ 

#include <amxmodx> 
#include <engine> 

#define STEAMID_1 "STEAM_0:0"
#define STEAMID_2 "STEAM_0:0"
#define STEAMID_3 "STEAM_0:0"

new bool:szBhop[33]

#define    FL_WATERJUMP    (1<<11)    // player jumping out of water 
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground 

public plugin_init() { 
    
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza"
    
register_cvar("sbhopper_version""1.2"FCVAR_SERVER

public 
client_putinserver(id)
{
    
szBhop[id] = false
    
    set_task
(1.0,"CmdCheckSteam",id)
}
public 
client_PreThink(id

    if(!
szBhop[id])
        return 
PLUGIN_CONTINUE
    
    entity_set_float
(idEV_FL_fuser20.0
    
    if (
entity_get_int(idEV_INT_button) & 2
    { 
        new 
flags entity_get_int(idEV_INT_flags
        
        if(
flags FL_WATERJUMP
            return 
PLUGIN_CONTINUE 
            
        
if(entity_get_int(idEV_INT_waterlevel) >= 2
            return 
PLUGIN_CONTINUE 
            
        
if(!(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)
    } 
    
    return 
PLUGIN_CONTINUE 

public 
CmdCheckSteam(id)
{
    new 
szAuthid[64]
    
get_user_authid(id,szAuthid,charsmax(szAuthid))
    
    if(
equal(szAuthid,STEAMID_1) || equal(szAuthid,STEAMID_2) || equal(szAuthid,STEAMID_3))
        
szBhop[id] = true
    
else
        
szBhop[id] = false


not tested

Last edited by InsanityKARAI; 12-01-2017 at 15:55.
InsanityKARAI is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-01-2017 , 16:04   Re: plugin only for steam id
Reply With Quote #9

If szBhop is false, continue. Whaaaat?
__________________
Relaxing is offline
InsanityKARAI
Member
Join Date: Jul 2014
Old 12-01-2017 , 17:44   Re: plugin only for steam id
Reply With Quote #10

Quote:
Originally Posted by Relaxing View Post
If szBhop is false, continue. Whaaaat?


already tested ? Put return PLUGIN_HANDLED or other and see what happens

Last edited by InsanityKARAI; 12-01-2017 at 17:45.
InsanityKARAI is offline
Reply


Thread Tools
Display Modes

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


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