Raised This Month: $ Target: $400
 0% 

Wath is wrong in this code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 01-01-2010 , 15:42   Wath is wrong in this code?
Reply With Quote #1

I copie some parts of codes and tried to made a plugin that give autobhop to players when they type /bhop. But it didn't worked.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <engine>

#define PLUGIN "Bhop"
#define AUTHOR "AUTHOR"
#define VERSION "0.1"

#define MAX_PLAYERS 32
#define PLAYER_JUMP  6
#define PLAYER_MAX_SAFE_FALL_SPEED  580
#define MULTI  0
#define WALL  1
#define AUTOBHOP 2
#define LONGJUMP 3
#define NORMAL  5
#define CANCEL  9
#define KEYS ((1<<MULTI)|(1<<WALL)|(1<<AUTOBHOP)|(1<<LONGJUMP)|(1<<NORMAL)|(1<<CANCEL))

new g_pCvarAutoBhops
new g_iJumpType[MAX_PLAYERS+1]
new 
g_iJumps[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
    
RegisterHam(Ham_Spawn"player""Player_Spawn"1)
    
    
    
register_clcmd("say /bhop""ClientCommand_Jump")
    
    
g_pCvarAutoBhops register_cvar("ja_autobhop_limit""300")
}
public 
Player_Spawn(id)
{
    if( !
is_user_alive(id) )
    {
        
g_iJumpType[id] = NORMAL
    
}
}
public 
ClientCommand_Jump(id)
{
    if( !
is_user_alive(id) )
    {
        
g_iJumpType[id] = AUTOBHOP
    
}
}
public 
Player_Jump(id)
{
    if( !
is_user_alive(id)
    || 
pev(idpev_waterlevel) >= )
{
    return
}
switch( 
g_iJumpType[id] )
{
    case 
AUTOBHOP:AutoBhop(id)
    }
}
AutoBhop(id)
{
static 
iFlags iFlags pev(idpev_flags)
if( !(
iFlags FL_ONGROUND) )
{
    return
}
static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
if( !(
iOldButtons IN_JUMP) )
{
    
g_iJumps[id] = 0
    
return
}
set_pev(idpev_oldbuttonsiOldButtons IN_JUMP)
static 
iLimit iLimit get_pcvar_num(g_pCvarAutoBhops)
if( 
iLimit && g_iJumps[id]++ >= iLimit )
{
    return
}

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it

Last edited by benamo6; 01-02-2010 at 02:21.
benamo6 is offline
Send a message via MSN to benamo6
 


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 04:16.


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