Raised This Month: $ Target: $400
 0% 

uc_buttons help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-26-2013 , 11:59   uc_buttons help
Reply With Quote #1

how to check whether the user pressed drop weapon button <default g> via uc_buttons...
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 12-26-2013 , 12:29   Re: uc_buttons help
Reply With Quote #2

There is not "uc_button" for that. You should just register the "drop" command as a client command.

register_clcmd("drop","HookDrop");
akcaliberg is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-27-2013 , 06:56   Re: uc_buttons help
Reply With Quote #3

Quote:
Originally Posted by akcaliberg View Post
There is not "uc_button" for that. You should just register the "drop" command as a client command.

register_clcmd("drop","HookDrop");

but suppose if user is holding CSW_M4A1, how can i avoid user to drop it
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2013 , 11:34   Re: uc_buttons help
Reply With Quote #4

Hook Ham_CS_CanDrop or however the function is called (last word is CanDrop for sure), return FALSE and supercede it when the item type is CSW_M4A1.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-26-2013 , 12:41   Re: uc_buttons help
Reply With Quote #5

so...
PHP Code:
register_logevent("drop","hookDrop")
// in plugin init
 
public hookDrop(id)
client_print(id,print_chat,"you dropped a weapon"); 
is correct
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2013 , 12:46   Re: uc_buttons help
Reply With Quote #6

It is correct as long as you don't care if dropped weapon is the active weapon or another one including shield.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-26-2013 , 12:50   Re: uc_buttons help
Reply With Quote #7

thank you sir ConnorMcLeod and akcaliberg
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 12-26-2013 , 15:33   Re: uc_buttons help
Reply With Quote #8

drop is not a logevent

Use: register_clcmd
akcaliberg is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-26-2013 , 23:57   Re: uc_buttons help
Reply With Quote #9

and what to use if i want to detect user's weapon switch <default q>
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2013 , 05:35   Re: uc_buttons help
Reply With Quote #10

default q, or whatever the key, is bound to command "drop", you can hook that command as you do, but you may have to check if command has arguments that could make drop another weapon than the active one, or without arguments it could make drop player shield if player has one.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:12.


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