Raised This Month: $32 Target: $400
 8% 

Change KeyValues of an already spawned entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KarlPolice
New Member
Join Date: Mar 2018
Old 07-21-2019 , 05:32   Change KeyValues of an already spawned entity
Reply With Quote #1

How can I change the KeyValues of an already spawned entity. What I know is, I've never seen or tried this is the actual Source SDK Hammer Editor. Not sure if it is possible doing it with a script.


But how can I do it with SourceMod?

Let's take this as an example: https://forums.alliedmods.net/showthread.php?t=288850

PHP Code:
new gunfire CreateEntityByName("env_gunfire"); 

DispatchKeyValue(gunfire"spread""1");
DispatchSpawn(gunfire); 
So now the gunfire entity is spawned.
Let's say I want to change the spread again. How can I do that? So what I know is I wouldn't be able to access the entity anymore by using the gunfire variable. I would need to get the entity first.

But if I get the entity, how can I change the KeyValues then?
__________________
Hotrod Turrets!

Last edited by KarlPolice; 07-21-2019 at 05:32.
KarlPolice is offline
 


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 04:43.


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