Raised This Month: $ Target: $400
 0% 

CS:GO Spawn an entity (weapon) at a specific location


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 10-28-2019 , 13:56   CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #1

I've been searching for days and I can't find any clear simple example of how to do this.

I just want to gather a location(s) around the map, perhaps grabbing the clients current location.

Using that location, I want to spawn a weapon there on the floor.

I'm making the assumption that if a player can stand in a location, then a weapon can spawn there without problems.
SpartanK is offline
FuZ!on
Senior Member
Join Date: Aug 2007
Old 10-29-2019 , 07:41   Re: CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #2

You might be able to take a look at some code from this plugin: https://forums.alliedmods.net/showthread.php?t=193359

It gathers the a player's location on death and spawns an entity at that location.
FuZ!on is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 10-29-2019 , 08:26   Re: CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #3

I wrote a quick example which spawns an AK47 at a players position.

Spoiler
Kolapsicle is offline
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 11-01-2019 , 09:34   Re: CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #4

Quote:
Originally Posted by Kolapsicle View Post
I wrote a quick example which spawns an AK47 at a players position
Thanks for this, I'm going to try and implement it. I've not tested it but I've seen a lot of posts saying that spawned weapons, don't actually have the weapon properties.

Should this actually spawn an AK47 that is the same as an AK47 you'd get from the buy menu?

Hijacking my own thread but something else I'm stuck on is, how do you prevent people from spawning after the round has started. In my mod, new players should spawn at the start of the next round, just like in casual for instance?
SpartanK is offline
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 11-01-2019 , 09:35   Re: CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #5

Quote:
Originally Posted by FuZ!on View Post
You might be able to take a look at some code from this plugin: https://forums.alliedmods.net/showthread.php?t=193359

It gathers the a player's location on death and spawns an entity at that location.
Thanks, yes I already had this downloaded as an example to work from
SpartanK is offline
SpartanK
Junior Member
Join Date: Oct 2019
Location: Cambodia
Old 11-08-2019 , 07:25   Re: CS:GO Spawn an entity (weapon) at a specific location
Reply With Quote #6

Quote:
Originally Posted by Kolapsicle View Post
I wrote a quick example which spawns an AK47 at a players position
This actually worked as intended, I then modified it to spawn a weapon at a players aim.
SpartanK 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:36.


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