Source SDK

Source SDK

Karlo Rīsss Oct 18, 2015 @ 3:31am
CS:GO SDK Button gives weapon
Hello, i am very new at cs go sdk, and i have 1 question, i can't find answer to it...
I want to give player a weapon when he presses / shoots the button.
And i can't get it to work.... can somebody help me please ?
- Thank you for reading - Carlo
Last edited by Karlo Rīsss; Oct 18, 2015 @ 3:32am
< >
Showing 1-13 of 13 comments
gottagho Oct 18, 2015 @ 4:16am 
Look at this tutorial http://css.gamebanana.com/tuts/10352 Notice comment: "Good tutorial, but you don't actually need the 'env_entity_maker', you can just force spawn on your 'point_template'"
Last edited by gottagho; Oct 18, 2015 @ 4:19am
Karlo Rīsss Oct 18, 2015 @ 4:24am 
Thank you for your answer :)
No i don't have CS:S , about that dispencer... I don't want weapon to just drop on the ground, on the button press/shoot i want to give player the weapon, even if they shoot that button from the distance. ( If it's even possible ) Or make it so that weapon spawns / teleports to player feet.
Thank you again...
gottagho Oct 18, 2015 @ 5:47am 
Here is how I did it in Hammer with successful result:

func_button:
Name: button
Outputs: OnDamaged, weapon_spawner, ForceSpawn, Fire once only
Outputs: OnDamaged, weapon_awp_kill_item, kill, Fire once only
Flags: Don't Move (optional), Damage Activates

point_template:
Name: weapon_spawner
Template 1: awp

weapon_awp:
Name: awp

weapon_awp:
Name: weapon_awp_kill_item
Flags: Start constrained

The first awp is the one you don't see in the game.
The second awp is the one you want to see in the game.

Btw: Does the player stand in a certain spot, or does he shoot from a random place?
Last edited by gottagho; Oct 18, 2015 @ 5:49am
Karlo Rīsss Oct 18, 2015 @ 10:20am 
The player shoots from random spot
ember Oct 18, 2015 @ 10:44am 
Right now I'm picturing a spawnroom with a button on the other side that gives players an awp. I would see if you couldn't make it so that they have to stand in a certain spot to shoot the button. Rework the design to follow the resources that you have. I'm thinking like a booth that people stand in to select the weapon of their choice. Of course, I could have your map idea totally wrong, but something to consider.
Karlo Rīsss Oct 18, 2015 @ 11:00am 
Alright, i will try to rework it a little bit, thank you m8's for helping me !
Thanks :)
Moltard Oct 18, 2015 @ 10:54pm 
use a game_player_equip, with the flag "Use only" enabled.
Give it a name, what u want.
Turn off smart edit, and add the classname of the weapon(s) you want to give when the player press a button.
For example:
weapon_awp 1 (key is weapon_awp and value is 1).

Now on your button(s), do OnPressed name_of_player_equip,Use,,0,-1

The game_player_equip was made for that with "Use Only" flag.
Or to directly equip all players (with the weapons you set as KeyValue) if you dont check "Use Only".

The way Trond told you is pretty stupid and waste entities. (no offence, but stop copy pasting things you find on gamebanana. Most of them are outdated)
Last edited by Moltard; Oct 18, 2015 @ 10:57pm
Karlo Rīsss Oct 19, 2015 @ 5:50am 
That's it ! That's it ! Thank you m8, THANKS !!!
minfoh Jan 29, 2016 @ 1:24am 
Bit late here, but I can't figure out where to do the
"Now on your button(s), do OnPressed name_of_player_equip,Use,,0,-1"
step, been working on it for almost an hour and can't figure it out, I may be stupid, but i'll keep trying
Moltard Jan 29, 2016 @ 7:29am 
On your button outputs
CaMpeR Jan 30, 2016 @ 5:15pm 
Originally posted by Moltard:
On your button outputs

Which one i have to choose for "via this input" ?
Moltard Jan 31, 2016 @ 1:07am 
"Via this input" Use
It will show as red, but it's correct. It will work in game.

Also on your game_player_equip, check the flag "Use Only"
Daaninator Dec 20, 2016 @ 1:50am 
Originally posted by Moltard:
"Via this input" Use
It will show as red, but it's correct. It will work in game.

Also on your game_player_equip, check the flag "Use Only"
Yeh, I'm a bit late too but can you add me ?
< >
Showing 1-13 of 13 comments
Per page: 1530 50

Date Posted: Oct 18, 2015 @ 3:31am
Posts: 13