Raised This Month: $ Target: $400
 0% 

[HELP] Spawn a entity CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZcaverZ
Junior Member
Join Date: Jul 2011
Old 01-04-2015 , 11:55   [HELP] Spawn a entity CS:GO
Reply With Quote #1

Hey there

Im currently trying to learn how to spawn in a entity so i wounder if anyone could teach me or atleast give some examples. Im currentliy trying to spawn in a soccerball where im aiming and i can get the origin from the aim but i can't really figure out how to spawn in the soccerball(entity)

I would be super happy if you could help me thx
ZcaverZ is offline
The1Speck
SourceMod Donor
Join Date: Oct 2014
Location: USA
Old 01-04-2015 , 14:16   Re: [HELP] Spawn a entity CS:GO
Reply With Quote #2

PHP Code:
new EntIndex CreateEntityByName("prop_physics");
    
SetEntityModel(EntIndex"models/props_junk/watermelon01.mdl");
    
DispatchSpawn(EntIndex);
    
ActivateEntity(EntIndex);
    
TeleportEntity(EntIndexpropOriginNULL_VECTORNULL_VECTOR); 
__________________

Add me on Steam for personal inquiries or direct assistance.
The1Speck is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 01-04-2015 , 18:34   Re: [HELP] Spawn a entity CS:GO
Reply With Quote #3

Also to spawn entity that uses specified model you need to precache it aswell to prevent crashes:

PHP Code:
public OnMapStart() // Models needs to be precached on map start if you want it to still work and not crash server after map changes?
{
    
PrecacheModel("models/props_junk/watermelon01.mdl")

__________________
...

Last edited by Oshizu; 01-04-2015 at 18:35.
Oshizu 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 04:36.


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