Raised This Month: $ Target: $400
 0% 

[The Specialists] Trying to create an entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shinkoru
New Member
Join Date: Aug 2008
Old 05-11-2009 , 18:02   [The Specialists] Trying to create an entity
Reply With Quote #1

I've been trying to create an entity using the following:
PHP Code:
public Slowmo(id){
    new 
ent create_entity("ts_slowmotion");

    
DispatchKeyValue(ent,"model","*3")  
    
DispatchKeyValue(ent,"duration","100")    
    
DispatchKeyValue(ent,"slowamt","0.1")
    
DispatchKeyValue(ent,"targetname","slow")   
    
DispatchKeyValue(ent,"spawnflags","4")  

    
DispatchSpawn(ent)

    new 
Float:origin[3]
    
entity_get_vector(id,EV_VEC_origin,origin)
    
entity_set_origin(ent,origin)
    new 
Float:maxs[3] = {35.0,35.0,50.0},
    new 
Float:mins[3] = {-35.0,-35.0,-50.0}
    
entity_set_size(ent,mins,maxs)


    
client_print(id,print_chat,"Entity created.")

The debug message is shown, however, the entity has no effect. I've searched the forum, and I really couldn't find anything that helped this problem. I'm assuming I set a flag wrong, or it's something to do with the entity itself. Anyway, heres the entity information from the .fgd :
Code:
//Ts SlowMotion (trigger entity)
//this entity must be called from somewhere (a door, a trigger, a TS dm hill, a powerup...).
//"duration": self explanatory.
//"slowmotion ammount(0.0/1.0)": works exactly like the "globalslow" cvar or TS, it's a number between 0.0 and 1.0 (0.3,0.7 etc).
//"range": if set to "entity size" this entity will works as a trigger, the player that collide with it will be slowed; 
//if you set "all map" the entity size doesnt count and the entity works for the whole map.
//you can use the target.
//=========================================

@SolidClass base(Targetname,Target) = ts_slowmotion : "TS SlowMotion" 
[
    duration(string) : "Duration(sec)" : "5"
    slowamt(string) : "SlowMotion ammount(0.0/1.0)" : "0.5"
        
    spawnflags(flags) =
    [
        1: "Start ON" : 0
        2: "All map" : 0
        4: "Slow bullets" : 0
    ]

    message(string) : "message when triggered" : ""
]
And heres a screenshot of the entity in use (if it's any help).
[IMG]http://img12.**************/img12/5599/inuse.png[/IMG]
I've tried a multitude of ways to get it to work but I can't seem to get the effect.
Edit: My bad, posted in wrong section, thanks for moving it whoever did it.

Last edited by Shinkoru; 05-12-2009 at 10:26. Reason: Wrong section
Shinkoru is offline
 



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 01:35.


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