View Single Post
Author Message
Debute
New Member
Join Date: Jul 2011
Old 01-06-2016 , 13:28   Custom key down for heroes (+power1)
Reply With Quote #1

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?
Debute is offline