Raised This Month: $ Target: $400
 0% 

Problem on my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 07-29-2014 , 08:03   Problem on my plugin
Reply With Quote #1

hey,
i find this mod:
https://forums.alliedmods.net/showthread.php?t=128984

and i edit hem to this:

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

public plugin_init() {
register_clcmd("say /enablebhop","client_PreThink")
register_clcmd("say /disablebhop","client_PreThink1")
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & ADMIN_IMMUNITY)
        {
            
            new 
oldbuttons get_user_oldbutton(id);
        
            
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }
}  

public 
client_PreThink1(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & ADMIN_IMMUNITY)
        {
    
    
    }
    }

but i dont know what i need to do to disable bhop when i type /disablebhop...
thanks about the help.
sorry about my bad english...

Last edited by Eviatar Mor; 07-29-2014 at 08:04.
Eviatar Mor is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-29-2014 , 08:22   Re: Problem on my plugin
Reply With Quote #2

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

new g_bBhop33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    
g_bBhopid ] = true
}

public 
DisableCommand(id)
{
    
g_bBhopid ] = false
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }

HamletEagle is offline
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 07-29-2014 , 08:38   Re: Problem on my plugin
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
#include <amxmodx>
#include <engine>

new g_bBhop33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    
g_bBhopid ] = true
}

public 
DisableCommand(id)
{
    
g_bBhopid ] = false
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }

thanks you hemlet
Eviatar Mor is offline
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 07-29-2014 , 13:50   Re: Problem on my plugin
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
#include <amxmodx>
#include <engine>

new g_bBhop33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    
g_bBhopid ] = true
}

public 
DisableCommand(id)
{
    
g_bBhopid ] = false
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }

Hamlet I Edit Your code And I have one Warning.
here is the code:
PHP Code:
#include <amxmodx>
#include <engine>

new g_bBhop33 ]

new 
szName33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    
g_bBhopid ] = true

    get_user_name
(idszNamecharsmax(szName)) 
    
client_print(idprint_chat"%s U Enabled Bhop"szName)
}

public 
DisableCommand(id)
{
    
g_bBhopid ] = false
    get_user_name
(idszNamecharsmax(szName))
    
client_print(idprint_chat"%s U Disabled Bhop"szName)
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
    
client_print(idprint_chat"This Command Only For Admins")
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }

Eviatar Mor is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-29-2014 , 15:00   Re: Problem on my plugin
Reply With Quote #5

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

new g_bBhop33 ]

new 
szName33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    if(!(
get_user_flags(id) & ADMIN_IMMUNITY))
    {
    
client_print(idprint_chat"This Command Only For Admins")
    return 
PLUGIN_HANDLED
    
}
    
g_bBhopid ] = true
    
    get_user_name
(idszNamecharsmax(szName)) 
    
client_print(idprint_chat"%s U Enabled Bhop"szName)
    return 
PLUGIN_HANDLED
}

public 
DisableCommand(id)
{
    if(!(
get_user_flags(id) & ADMIN_IMMUNITY))
    {
    
client_print(idprint_chat"This Command Only For Admins")
    return 
PLUGIN_HANDLED
    
}
    
    
g_bBhopid ] = false
    get_user_name
(idszNamecharsmax(szName))
    
client_print(idprint_chat"%s U Disabled Bhop"szName)
    return 
PLUGIN_HANDLED
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }    
    }

__________________
JailBreak & HNS

Last edited by MrKiller2010; 07-29-2014 at 15:03.
MrKiller2010 is offline
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 07-29-2014 , 15:04   Re: Problem on my plugin
Reply With Quote #6

Quote:
Originally Posted by MrKiller2010 View Post
here:
PHP Code:
#include <amxmodx>
#include <engine>

new g_bBhop33 ]

new 
szName33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    if(!(
get_user_flags(id) & ADMIN_IMMUNITY))
    {
    
client_print(idprint_chat"This Command Only For Admins")
    return 
PLUGIN_HANDLED
    
}
    
g_bBhopid ] = true
    
    get_user_name
(idszNamecharsmax(szName)) 
    
client_print(idprint_chat"%s U Enabled Bhop"szName)
    return 
PLUGIN_HANDLED
}

public 
DisableCommand(id)
{
    if(!(
get_user_flags(id) & ADMIN_IMMUNITY))
    {
    
client_print(idprint_chat"This Command Only For Admins")
    return 
PLUGIN_HANDLED
    
}
    
    
g_bBhopid ] = false
    get_user_name
(idszNamecharsmax(szName))
    
client_print(idprint_chat"%s U Disabled Bhop"szName)
    return 
PLUGIN_HANDLED
}

public 
client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }    
    }

when i type /enablebhop or /disablebhop i not see any message..
Eviatar Mor is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-29-2014 , 15:11   Re: Problem on my plugin
Reply With Quote #7

Quote:
Originally Posted by Eviatar Mor View Post
when i type /enablebhop or /disablebhop i not see any message..
If you are admin with flag 'a' you will not see the message.

Only players and admins without immunity flag will see the player!
__________________
JailBreak & HNS
MrKiller2010 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 07-29-2014 , 16:38   Re: Problem on my plugin
Reply With Quote #8

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_bBhop

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
register_clcmd("say /bhop","ToggleBHop")
}

public 
ToggleBHop(id)
{
    if(
get_user_flags(id) & ADMIN_IMMUNITY)
    {
        
g_bBhop ^= (1<<id-1)
        
client_print(idprint_chat"Bhop is %s for you"g_bBhop & (1<<id-1)? "Enabled":"Disabled")
    }
    return 
PLUGIN_HANDLED
}


public 
client_PreThink(id)
{
    if(
is_user_alive(id) && g_bBhop & (1<<id-1))
    {
        
entity_set_int(idEV_INT_oldbuttonsget_user_oldbutton(id) & ~IN_JUMP)
    }

__________________
Hey ^_^
NikKOo31 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-30-2014 , 02:47   Re: Problem on my plugin
Reply With Quote #9

Quote:
Originally Posted by MrKiller2010 View Post
If you are admin with flag 'a' you will not see the message.

Only players and admins without immunity flag will see the player!
What are you talking about ?

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

new g_bBhop33 ]
new 
szName33 ]

public 
plugin_init() 
{
    
register_clcmd("say /enablebhop","EnableCommand")
    
register_clcmd("say /disablebhop","DisableCommand")
}

public 
EnableCommand(id)
{
    
g_bBhopid ] = true
    get_user_name
(idszNamecharsmax(szName)) 
    
client_print(idprint_chat"%s U Enabled Bhop"szName)
}

public 
DisableCommand(id)
{
    
g_bBhopid ] = false
    get_user_name
(idszNamecharsmax(szName))
    
client_print(idprint_chat"%s U Disabled Bhop"szName)
}

//don't put messages here.
public client_PreThink(id)
{
    if(
is_user_alive(id))
    {
        if(
g_bBhop id ] && get_user_flags(id) & ADMIN_IMMUNITY)
        {
            new 
oldbuttons get_user_oldbutton(id);
            
oldbuttons &= ~IN_JUMP;
            
entity_set_int(idEV_INT_oldbuttonsoldbuttons);
        }
    }

HamletEagle is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-30-2014 , 04:40   Re: Problem on my plugin
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
What are you talking about ?

Read his code, what he tried to do was blocking the plugin only for admins.. Right?
And that's what I did for him.
__________________
JailBreak & HNS
MrKiller2010 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 13:03.


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