Raised This Month: $ Target: $400
 0% 

Did that button give you a weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-16-2012 , 10:49   Did that button give you a weapon?
Reply With Quote #1

Hey guys

I want to detect if a button a user just pressed gave him a weapon. How can I check it? What method should I use?

Should I just hook the Ham_Use for all the button types and get_user_weapon then set task to 0.1 seconds checking if that changed? or?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-16-2012 , 12:49   Re: Did that button give you a weapon?
Reply With Quote #2

Nvm I figured it out, sorry for posting, I just have a really famous jb server and I cant test on it so I ask here. For the people who are interested of what I figured out. setting task to 0.2 after Ham_use is called, get_user_weapon gets you the right answer.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-16-2012 , 21:03   Re: Did that button give you a weapon?
Reply With Quote #3

Quote:
Originally Posted by Diegorkable View Post
I just have a really famous jb server and I cant test on it
LOL. You should have a local test server to test it so you can answer some of your own questions quicker.
__________________
fysiks is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 04-17-2012 , 10:22   Re: Did that button give you a weapon?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
LOL. You should have a local test server to test it so you can answer some of your own questions quicker.
Yeah just that I never dealed with local servers so I don't know how to set up one and install plugins on it.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-18-2012 , 00:29   Re: Did that button give you a weapon?
Reply With Quote #5

It's really easy, most easy is to use HLDS from your steam account, but you can also use hlds update tools.
Then you have a ready to use server, just need to install metamod and amxx on it.

About your thing, when a player is using a button, you should use that button pev_target and check which other entity is involved.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-18-2012 , 03:10   Re: Did that button give you a weapon?
Reply With Quote #6

Quote:
Originally Posted by Diegorkable View Post
Yeah just that I never dealed with local servers so I don't know how to set up one and install plugins on it.
Why am I not surprised to see a response like that from you?

If you get the Standalone HLDS like everyone that writes plugins should have then it is EXACTLY the same as a public server (some may not agree but it's best to test in an environment as close as possible to the final home). Would you like to know why? It's EXACTLY the same program! Game server providers don't get a special version.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-18-2012 , 09:39   Re: Did that button give you a weapon?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
like everyone that writes plugins should have
I use a LAN server because I'm lazy.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-19-2012 , 00:39   Re: Did that button give you a weapon?
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
I use a LAN server because I'm lazy.
Huh? All three types can be LAN servers. I'm guessing you mean either Steam Dedicated Server (which is closer to Standalone HLDS but you can't play on the server) or the Listen Server.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-19-2012 , 02:15   Re: Did that button give you a weapon?
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
Huh? All three types can be LAN servers. I'm guessing you mean either Steam Dedicated Server (which is closer to Standalone HLDS but you can't play on the server) or the Listen Server.
Listen server, lol.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-19-2012 , 13:13   Re: Did that button give you a weapon?
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Listen server, lol.
Same, i do not see any reason why i need to start dedicated server and then start my cs and connect in it.
Listen server is lot more faster way to testing.
.Dare Devil. 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 07:50.


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