Raised This Month: $ Target: $400
 0% 

registering +speed troubles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 01-26-2010 , 08:24   registering +speed troubles
Reply With Quote #1

hello!

I've been trying to bind a self-made function to the "+speed" command.
Somehow everything I try fails with that command.

Can anybody check if there is anything wrong with my code?

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

new player_combos[32][2][33]

public 
plugin_init() {
    
register_plugin("Speed Combo System""1.0""SSJ2GOKU")
    
    
register_clcmd("+speed""set_combo_on");
    
register_clcmd("-speed""set_combo_off");
}


/**************************/
/**** COMBO SYSTEM BOX ****/
/**************************/

public showComboSystemNotice(id){
    if(
player_combos[id][0][0] == 1) {        
        
set_hudmessage(025500.00.506.02.0)
        
show_hudmessage(id"Combo System Active!")
        
        
set_task(2.0"showComboSystemNotice");
    }
}

public 
set_combo_on(id){
    
client_print(idprint_chat"COMBO INITIATED");
    
    
player_combos[id][0][0] = 1;
    
    
showComboSystemNotice(id);
}
public 
set_combo_off(id){
    if(
player_combos[id][0][0] != 0){
        
client_print(idprint_chat"COMBO STOPPED");
        
client_print(idprint_chatplayer_combos[id][1]);
        
        
player_combos[id][0][0] = 0;
    }

SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 01-26-2010 , 08:57   Re: registering +speed troubles
Reply With Quote #2

There's already a command using +speed, it's by default bound to your shift key. It makes you move slower. You shuld try using something else.
__________________

Last edited by DarkGod; 01-26-2010 at 09:01.
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 01-26-2010 , 10:20   Re: registering +speed troubles
Reply With Quote #3

Quote:
Originally Posted by DarkGod View Post
There's already a command using +speed, it's by default bound to your shift key. It makes you move slower. You shuld try using something else.
well the plugin I want to make works on that +speed command
but I cannot seem to get a grip on it when people use it????
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 01-27-2010 , 05:25   Re: registering +speed troubles
Reply With Quote #4

*bumpy*

nobody knows a possible solution for this problem?
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 01-27-2010 , 08:27   Re: registering +speed troubles
Reply With Quote #5

As he had already told you, you're using the same bind as a default game bind. Change it, and don't bump unless 15 days have passed.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-27-2010 , 08:35   Re: registering +speed troubles
Reply With Quote #6

I don't think he intends to register this as a new command, I think he's trying to hook the +\-speed command to make his functions fire when used...which isn't possible either.
__________________
Bugsy is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-27-2010 , 09:18   Re: registering +speed troubles
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
I don't think he intends to register this as a new command, I think he's trying to hook the +\-speed command to make his functions fire when used...which isn't possible either.
His "speed" key if it is counter strike would be walking.. Is their a way to register IN_WALK?
Doc-Holiday is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-27-2010 , 09:55   Re: registering +speed troubles
Reply With Quote #8

its possible to hook walking but not by hooking a +/- command
__________________
Bugsy is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-27-2010 , 13:10   Re: registering +speed troubles
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
its possible to hook walking but not by hooking a +/- command

So if he hooks walking then he can do what ever he wants there right?

Conor showed me something in the battlefield code that would work for what he wants i think.

button pushed and button released... ill see if i can get it out and post it.

PHP Code:
const m_afButtonPressed 246;
const 
m_afButtonReleased 247;

register_forward(FM_PlayerPostThink"fw_Medic");

public 
fw_use_key(id)
{    
     if(
get_pdata_int(idm_afButtonPressed) & IN_USE )
     {
          
//Pressed the use key
     
}
     if(
get_pdata_int(idm_afButtonReleased) & IN_USE )
     {
          
//Released the use key
     
}


Last edited by Doc-Holiday; 01-27-2010 at 13:16.
Doc-Holiday is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 02-01-2010 , 18:45   Re: registering +speed troubles
Reply With Quote #10

I am indeed trying to link the WALK button or +speed

in that new Naruto Mod for half-life, the +speed button is linked to initiating a jutsu combination

I would love add some new stuff on my server, and therefore I need to be able to know when the player starts the combination

+speed is the initial key, after that its simply the forward, backward, left, right buttons

the +speed button is the only one that I cannot hook in my amxx plugin
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
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 07:23.


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