AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   registering +speed troubles (https://forums.alliedmods.net/showthread.php?t=116746)

SSJ2GOKU 01-26-2010 08:24

registering +speed troubles
 
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;
    }



DarkGod 01-26-2010 08:57

Re: registering +speed troubles
 
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.

SSJ2GOKU 01-26-2010 10:20

Re: registering +speed troubles
 
Quote:

Originally Posted by DarkGod (Post 1068071)
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 01-27-2010 05:25

Re: registering +speed troubles
 
*bumpy*

nobody knows a possible solution for this problem?

wrecked_ 01-27-2010 08:27

Re: registering +speed troubles
 
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.

Bugsy 01-27-2010 08:35

Re: registering +speed troubles
 
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.

Doc-Holiday 01-27-2010 09:18

Re: registering +speed troubles
 
Quote:

Originally Posted by Bugsy (Post 1069377)
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?

Bugsy 01-27-2010 09:55

Re: registering +speed troubles
 
its possible to hook walking but not by hooking a +/- command

Doc-Holiday 01-27-2010 13:10

Re: registering +speed troubles
 
Quote:

Originally Posted by Bugsy (Post 1069458)
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
     
}



SSJ2GOKU 02-01-2010 18:45

Re: registering +speed troubles
 
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


All times are GMT -4. The time now is 07:23.

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