AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Auto binding classe ? (https://forums.alliedmods.net/showthread.php?t=337510)

Surimi 04-25-2022 09:00

Auto binding classe ?
 
How to make it so the special abilities of these 2 plugin are automatically binded to the key V, without the need to do it manually :

https://forums.alliedmods.net/showthread.php?t=134614
https://forums.alliedmods.net/showth...=90309?t=90309

OciXCrom 04-25-2022 12:43

Re: Auto binding classe ?
 
You can't. That would be slowhacking which is against the rules.
Why would I want some server to bind a random command and remove my own bindings?

kww 04-25-2022 13:24

Re: Auto binding classe ?
 
Quote:

Originally Posted by Surimi (Post 2777883)
How to make it so the special abilities of these 2 plugin are automatically binded to the key V, without the need to do it manually :

https://forums.alliedmods.net/showthread.php?t=134614
https://forums.alliedmods.net/showth...=90309?t=90309

maybe you could bind it to F key (replace flashlight)...
or to T key (replace spray)

Spoiler

Craxor 04-25-2022 13:41

Re: Auto binding classe ?
 
You can't , just advise the users to bind them manualy .

Surimi 04-25-2022 15:42

Re: Auto binding classe ?
 
Quote:

Originally Posted by kww (Post 2777914)
maybe you could bind it to F key (replace flashlight)...
or to T key (replace spray)

Spoiler

Yes please, if i want it binded to F, how please ?

kww 04-25-2022 18:06

Re: Auto binding classe ?
 
Quote:

Originally Posted by Surimi (Post 2777930)
Yes please, if i want it binded to F, how please ?

If this suits you...

Add this to plugin_init()
PHP Code:

register_impulse(100"impulse_flashlight"

then add this somewhere in ur code:
PHP Code:

public impulse_flashlight(idimpulse)
{
    
foo(id// here you run ability or somewhat you need
    
    
return PLUGIN_HANDLED // block flashlight



fysiks 04-25-2022 19:01

Re: Auto binding classe ?
 
Quote:

Originally Posted by Surimi (Post 2777930)
Yes please, if i want it binded to F, how please ?

FYI, it doesn't bind it to "F". It binds it to the function which is the default bind for the F key. If someone changes their flashlight bind to a different key, this new function will be on that new key. It will not be on F.

So, you can't tell your users that "it is bound to F". You would have to tell them that it's linked to the flashlight.

Craxor 04-26-2022 00:10

Re: Auto binding classe ?
 
Indeed, i would more suggest to book Drop or Reload .

kww 04-26-2022 01:43

Re: Auto binding classe ?
 
Press [flashlight] key to use the Ability

Quote:

Originally Posted by Craxor (Post 2777964)
Indeed, i would more suggest to book Drop or Reload .

can we hook +reload command without checking every frame if user pressed IN_RELOAD?
Quote:

bind "r" "+reload"

Craxor 04-27-2022 22:31

Re: Auto binding classe ?
 
https://forums.alliedmods.net/showth...ht=hook+reload

But i sugest to hook drop woth regisyer_clcmd would be easier , check if user is zombie so humans can drop weapons too . (If youre making for zp)


All times are GMT -4. The time now is 21:22.

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