AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Did that button give you a weapon? (https://forums.alliedmods.net/showthread.php?t=183039)

Diegorkable 04-16-2012 10:49

Did that button give you a weapon?
 
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?

Diegorkable 04-16-2012 12:49

Re: Did that button give you a weapon?
 
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.

fysiks 04-16-2012 21:03

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by Diegorkable (Post 1690526)
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.

Diegorkable 04-17-2012 10:22

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by fysiks (Post 1690764)
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.

ConnorMcLeod 04-18-2012 00:29

Re: Did that button give you a weapon?
 
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.

fysiks 04-18-2012 03:10

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by Diegorkable (Post 1691015)
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.

Exolent[jNr] 04-18-2012 09:39

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by fysiks (Post 1691584)
like everyone that writes plugins should have

I use a LAN server because I'm lazy.

fysiks 04-19-2012 00:39

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by Exolent[jNr] (Post 1691749)
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.

Exolent[jNr] 04-19-2012 02:15

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by fysiks (Post 1692175)
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.

.Dare Devil. 04-19-2012 13:13

Re: Did that button give you a weapon?
 
Quote:

Originally Posted by Exolent[jNr] (Post 1692209)
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.


All times are GMT -4. The time now is 07:50.

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