Raised This Month: $ Target: $400
 0% 

Binding keys when player connects


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2009 , 06:56   Binding keys when player connects
Reply With Quote #1

Hey. I found this in the trash. I wanted to see how it worked, but it is totally wrong.

If I use this command:
PHP Code:
client_cmd(id,"bind F12 say AntiCheat: F12 Pressed."); 
What is does is binding the key to the say command and makes the player say what ever I change it to.

However, when I connect to the server with this running, it wont bind it.
I found out why. I have to write it like this in console:
Code:
bind F12 "say AntiCheat: F12 Pressed"
But I can not use those " in the code, since I am getting errors when compiling it then. So my question is:
Is there any way to get this to work, so I can use " in the client_cmd?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-28-2009 , 06:57   Re: Binding keys when player connects
Reply With Quote #2

1. Slowhacking is not allowed here.
2. Detecting cheaters with binding keys is the worst method ever.
__________________
xPaw is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-28-2009 , 07:35   Re: Binding keys when player connects
Reply With Quote #3

I can not help in this matter...
Quote:
Originally Posted by xPaw View Post
1. Slowhacking is not allowed here.
micke1101 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2009 , 07:00   Re: Binding keys when player connects
Reply With Quote #4

I know this is totally crap.

It is not the plugin I am concerned about. Lets say I wanted them to say "jelle is awesome" when they press a button.
I just want to know if it is possible to use the " in a code, any code at all. Not only regarding this, but all plugins.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-28-2009 , 07:22   Re: Binding keys when player connects
Reply With Quote #5

Yes it is possible
micke1101 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2009 , 07:27   Re: Binding keys when player connects
Reply With Quote #6

Then howcome I can not compile this code?
PHP Code:
#include <amxmodx>

#define PLUGIN "AntiCheatBind"
#define VERSION "1.0"
#define AUTHOR "Xf0X"

public plugin_init()
{
    
register_plugin(PLUGIN,VERSION,AUTHOR)
}

public 
client_connect(id)
{
    
client_cmd(id,"bind F12 "say AntiCheatF12 Pressed."");
    
client_cmd(id,"bind -F12 "say AntiCheatF12 Pressed."");
    
client_cmd(id,"bind -end "say AntiCheatEND Pressed."");
    
client_cmd(id,"bind end "say AntiCheatEND Pressed."");
    
client_cmd(id,"bind insert "say AntiCheatINSERT Pressed."");
    
client_cmd(id,"bind -insert "say AntiCheatINSERT Pressed."");
    
client_cmd(id,"bind -F11 "say AntiCheatF11 Pressed."");
    
client_cmd(id,"bind F11 "say AntiCheatF11 Pressed."");

I get:
error: expected token "," but found "-identifier-" on line 14
error: Undefined symbol "say" on line 14

and a warning:
Expression has no effect, still on line 14.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2009 , 07:39   Re: Binding keys when player connects
Reply With Quote #7

Well, My intention is not slowhacking. My intention is to learn this, and how it is done.

I just wanted to learn why I can not use the client_cmd like this:
"bind F12 "say blah blah blah"")

Or any other matter, whatsoever.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 10-28-2009 , 07:46   Re: Binding keys when player connects
Reply With Quote #8

Slow hacking is when you make a setting on the client side which is what youre doing with your code.

But if it isnt your intention (which i doubt)

Code:
client_print(id, print_chat, "^"")
micke1101 is offline
drakeris
Senior Member
Join Date: Jul 2009
Old 10-28-2009 , 07:44   Re: Binding keys when player connects
Reply With Quote #9

why dont you simple download the bind.sma plugins and look how its done there?
drakeris is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-28-2009 , 07:45   Re: Binding keys when player connects
Reply With Quote #10

Searching for bind.sma gets me only this post. Any link?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:31.


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