Raised This Month: $51 Target: $400
 12% 

Handling +use


Post New Thread Reply   
 
Thread Tools Display Modes
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 09-02-2005 , 08:05  
Reply With Quote #11

I made this:

Code:
public client_PreThink(id) {   user_print(id, print_chat, "You pressed E key!")   return PLUGIN_CONTINUE }

Well, I had "You pressed E key" all over my chat and console and I did not pressed anything. I need something that's executed only when user presses E key. I hoped there is logevent or event for this but did not found anything.
alien is offline
Send a message via ICQ to alien
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-02-2005 , 08:53  
Reply With Quote #12

I already told you..

Code:
public client_PreThink(id) {     if((get_user_button(id) & IN_USE) && !(get_user_oldbutton(id) & IN_USE))     {         client_print(id,print_chat,"You pressed E 'use' ");     } }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Casio
Member
Join Date: Jan 2005
Old 09-04-2005 , 18:42  
Reply With Quote #13

Would the below code work?

Code:
register_clcmd("+use","UseBlock",0)
register_concmd("+use","UseBlock",0)

public UseBlock()
{
return PLUGIN_HANDLED
}
Casio is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-04-2005 , 19:53  
Reply With Quote #14

You cannot hook default HL +/- commands like that.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 09-05-2005 , 11:00  
Reply With Quote #15

Hehe but you can make something like this:

Code:
plugin_init() ... register_clcmd("my_use", "use_hook", ADMIN_USER, ""); public client_connect() ... client_cmd(id, "bind e \"+use; my_use") public client_disconnect() ... client_cmd(id, "bind e +use) public use_hook() ... ...

But it's really really not elegant Not sure whether \" works in client_cmd, i'm still a nub I think client_PreThink works fine 4 this. Thanks v3x!
alien is offline
Send a message via ICQ to alien
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 11:48.


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