Raised This Month: $344 Target: $400
 86%   Almost there!

Solved Spawning entities in specific location.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thEsp
Veteran Member
Join Date: Aug 2017
Old 01-01-2019 , 15:56   Spawning entities in specific location.
Reply With Quote #1

Hello peeps, I need help spawning entities in a specific (X Y Z) location.
for example:
Code:
entity_add(x,y,z)
So how should I do that?
Thanks in advance

Last edited by thEsp; 01-02-2019 at 05:31. Reason: Solved
thEsp is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 01-01-2019 , 16:36   Re: Spawning entities in specific location.
Reply With Quote #2

Quote:
set_pev(entity, pev_origin, Float:{0.0, 0.0, 0.0})
Replace 0.0 with your (hardcoded)-values.
__________________
Retired.

Last edited by Xalus; 01-01-2019 at 16:37.
Xalus is offline
thEsp
Veteran Member
Join Date: Aug 2017
Old 01-02-2019 , 05:30   Re: Spawning entities in specific location.
Reply With Quote #3

Quote:
Originally Posted by Xalus View Post
Replace 0.0 with your (hardcoded)-values.
Thank you .
thEsp is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 01-02-2019 , 06:29   Re: Spawning entities in specific location.
Reply With Quote #4

for some reasons its better to use entity_set_origin and not just set variable origin to your value.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-02-2019 , 10:29   Re: Spawning entities in specific location.
Reply With Quote #5

yes, because it calls *g_engfuncs.pfnSetOrigin (something related to game engine). [pev|EV_VEC]_origin will just update variable.

Quote:
#define SET_ORIGIN (*g_engfuncs.pfnSetOrigin)
__________________





Last edited by CrazY.; 01-02-2019 at 10:29.
CrazY. is offline
thEsp
Veteran Member
Join Date: Aug 2017
Old 01-02-2019 , 13:51   Re: Spawning entities in specific location.
Reply With Quote #6

Quote:
Originally Posted by Ghosted View Post
for some reasons its better to use entity_set_origin and not just set variable origin to your value.
Ahm, okay thanks for that. But can I use these (https://developer.valvesoftware.com/...st_of_entities) or only pev_* and where should I?
I'm so far away for learning fakemeta/engine/hamsandwich.
thEsp is offline
Reply


Thread Tools
Display Modes

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 11:34.


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