AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=43)
-   -   Custom key down for heroes (+power1) (https://forums.alliedmods.net/showthread.php?t=277296)

Debute 01-06-2016 13:28

Custom key down for heroes (+power1)
 
I made some changes to my SH server, everything is working like I expected, but now I stucked at something, which I cannot find solution on the internet. You know, that hero with bindable power can be executed with bind "+power1". In my server, there is possible to have only one bindable hero, so I would like to have custom bind. For example, "+ability".
In file superheromod.sma with nvault save type, in plugin_init() function, after registering client commands, which I mean this:
PHP Code:

    for (new 1<= SH_MAXBINDPOWERSx++) {
        new 
powerDown[10], powerUp[10]
        
formatex(powerDowncharsmax(powerDown), "+power%d"x)
        
formatex(powerUpcharsmax(powerUp), "-power%d"x)

        
register_clcmd(powerDown"powerKeyDown")
        
register_clcmd(powerUp"powerKeyUp")
    } 

I tried replace with my custom code:
PHP Code:

    register_clcmd("+ability""powerKeyDown")
    
register_clcmd("-ability""powerKeyUp"

But unfortunately this doesn't work. Can you help me, what I need to edit to be able use +ability command?

maxolahird 12-21-2016 00:56

Re: Custom key down for heroes (+power1)
 
I dont really know coding much but shouldnt it be

PHP Code:

        new powerDown[10], powerUp[10
        
formatex(powerDowncharsmax(powerDown), "+ability"
        
formatex(powerUpcharsmax(powerUp), "-ability"

        
register_clcmd(powerDown"powerKeyDown"
        
register_clcmd(powerUp"powerKeyUp"

Not sure about that at all tho. Or is that the same as you did?

Good luck.


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

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