Raised This Month: $ Target: $400
 0% 

how to get if user press a key!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
haimmaik
Senior Member
Join Date: Jul 2005
Old 11-02-2005 , 21:02  
Reply With Quote #1

you can also register a clcmd and bind it into the key u want...
lets say if u want the key "ENTER" to do something then:
Code:
public plugin_init() {      register_clcmd("action","function") }
and then make a function that will force the player
to bind ur clcmd when he connects
Code:
public client_connect ( id ) {      client_cmd("bind ENTER action") }
and then u can do ur function
Code:
public function() {      .      .      .      . }
now every time client presses on Enter it will send "action" in his console and it will trigger ur function

my way is may binding a key for the client (which can be VERY annoying for him) but it also saves u a prethink function which takes ALOT of memory.. if u do it big.. ull get low FPS when many ppl join the server.

goodluck
haimmaik is offline
Reply



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 00:02.


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