AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] set key (https://forums.alliedmods.net/showthread.php?t=243733)

indraraj striker 07-08-2014 23:31

[help] set key
 
i want set key for clcmd
press j instead of /test
please someone can explain me

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say /test", "cmdTest")
}

public cmdTest (id)
{
client_print(id,print_chat,"Welcome to alliedmods")
}

Blizzard_87 07-08-2014 23:35

Re: [help] set key
 
Not possible to set players keys to commands anymore since latest update.

The client themselves must bind the keys only if they want to.

indraraj striker 07-09-2014 01:30

Re: [help] set key
 
Quote:

Originally Posted by Blizzard_87 (Post 2164288)
Not possible to set players keys to commands anymore since latest update.

The client themselves must bind the keys only if they want to.

k @Blizzard_87

can you write code for bind j key for /test
so players can bind his key am i right ??

fysiks 07-09-2014 01:37

Re: [help] set key
 
Just have them bind the command to their key the same way that you always do it. If you use "say /test" as the command in register_clcmd() then you simply bind that: bind "key" "say /test"

If you don't want it to be a chat command, simply rename the command to whatever you want and use that in the bind.

Blizzard_87 07-09-2014 02:53

Re: [help] set key
 
Quote:

Originally Posted by indraraj striker (Post 2164327)
k @Blizzard_87

can you write code for bind j key for /test
so players can bind his key am i right ??

No.

Like I said above it doesn't work anymore. You can't force players to bind keys that's final.

Clients are the only ones who can bind there own keys.

indraraj striker 07-09-2014 10:53

Re: [help] set key
 
Quote:

Originally Posted by fysiks (Post 2164334)
Just have them bind the command to their key the same way that you always do it. If you use "say /test" as the command in register_clcmd() then you simply bind that: bind "key" "say /test"

If you don't want it to be a chat command, simply rename the command to whatever you want and use that in the bind.

@fysiks
can u set bind j /test
for my above code
please give me example

mottzi 07-09-2014 11:12

Re: [help] set key
 
This is (1) slowhacking and (2) not going to work anymore.

Freezo Begin 07-09-2014 11:38

Re: [help] set key
 
Quote:

Originally Posted by mottzi (Post 2164589)
This is (1) slowhacking and (2) not going to work anymore.

1- No it will work
2- can you give me another way :twisted:

mottzi 07-09-2014 11:48

Re: [help] set key
 
It'll not. Take a look at this page under 'blocking':
https://developer.valvesoftware.com/...in_Slowhacking

Another way to accomplish this is to use client_print() to inform the player to bind the keys themselves.

fysiks 07-09-2014 11:59

Re: [help] set key
 
Quote:

Originally Posted by indraraj striker (Post 2164573)
@fysiks
can u set bind j /test
for my above code
please give me example

You can't do any binding for players. You can only have them bind it them selves.

Have them bind the command "test" (without the slash) and then use register_clcmd("test", "cmdTest").


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

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