Raised This Month: $51 Target: $400
 12% 

Entity Input with delay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jerry12
Junior Member
Join Date: Feb 2011
Old 03-26-2011 , 13:16   Entity Input with delay
Reply With Quote #1

I use AcceptEntityInput()

...and want it to take effect after a certain time elapsed without using a timer. For setting the parameter of an Input I just use SetVariantFloat() for example. But how do I set the delay?

Last edited by Jerry12; 03-26-2011 at 13:19.
Jerry12 is offline
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 03-26-2011 , 13:49   Re: Entity Input with delay
Reply With Quote #2

Why no timer?
__________________
"I give sopport and knolage in making extractions"
"MASTER(D) - dun0: are you mocing me?" -Master the grate

Plugins
Godmode Until Attack | No Block Team Filter
Extensions
Rcon Hooks
Samantha is offline
Jerry12
Junior Member
Join Date: Feb 2011
Old 03-26-2011 , 14:10   Re: Entity Input with delay
Reply With Quote #3

I don't want to create an extra timer function just for that. It would make it a lot easier if I could just set up a normal Input like I would do in hammer. I already have a lot of timers and with IF- or switch-conditions the code just unnecessarily expands.

.
.
.
but actually, it's not THAT important. I thought I just overlooked how the delay for an input can be set. If setting a delay is not possible, this would answer my question.

Last edited by Jerry12; 03-26-2011 at 14:21.
Jerry12 is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-26-2011 , 14:49   Re: Entity Input with delay
Reply With Quote #4

You can always use an engine time offset and OnGameFrame if you insist
AtomicStryker is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 03-26-2011 , 14:53   Re: Entity Input with delay
Reply With Quote #5

Just use 0.01 sec timer.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
Cookies.net
Senior Member
Join Date: Jan 2011
Old 03-26-2011 , 15:09   Re: Entity Input with delay
Reply With Quote #6

try something like this

PHP Code:
stock KillEnt(entFloat:delay)
{
    
decl String:addoutput[64];
    
Format(addoutputsizeof(addoutput), "OnUser1 !self:kill::%f:1"delay);
    
SetVariantString(addoutput);
    
AcceptEntityInput(ent"AddOutput");
    
AcceptEntityInput(ent"FireUser1");

This is how you should format the output
<output name> <target name>:<input name>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
this is taken from http://developer.valvesoftware.com/wiki/AddOutput
Cookies.net is offline
Jerry12
Junior Member
Join Date: Feb 2011
Old 03-26-2011 , 19:03   Re: Entity Input with delay
Reply With Quote #7

Clever idea cookie! It only works for me if I use "!activator" in that output-string but thanks a bunch.

Quote:
just set up a normal Input like I would do in hammer
Hmm, I said the solution myself and added outputs to entities via code before... strange that I missed this one
Jerry12 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 15:13.


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