Raised This Month: $ Target: $400
 0% 

Time for an explosive like c4 timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fearAR
Veteran Member
Join Date: Oct 2010
Old 06-23-2011 , 18:02   Time for an explosive like c4 timer
Reply With Quote #1

Hi, I am doing an explosive called TCOM, and I want to give it a timer like C4 in CS with cvar and sound. I want to make a sound plays every some seconds, but when time passes this sound plays in less seconds. Like C4, but I don't know how to do it.

Can anyone help me?

Greetings.
fearAR is offline
Send a message via MSN to fearAR
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-24-2011 , 01:44   Re: Time for an explosive like c4 timer
Reply With Quote #2

You could use set_task and set it every 1.0 seconds, and have it loop a certain amount of times. Every time you decrease the count, and if the count is equal to a certain number, then play the sound either using emit_sound or using client_cmd( id, "spk ..." ).

When the count is 0, then you explode the device.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fearAR
Veteran Member
Join Date: Oct 2010
Old 06-24-2011 , 11:37   Re: Time for an explosive like c4 timer
Reply With Quote #3

I was trying and I used a Variable, It decreases when entity thinks, and when entity thinks It plays a sound like C4, but I want to show all players a Hudmessage.

For play sound nearer when time passes I use "square root" with variable what decreases, and I was thinking in take a percentage, like it:

sqroot of 35.0 = 100%

sqroot of Timer = x

I use Simple three rule, to take percentage, thanks for help.
fearAR is offline
Send a message via MSN to fearAR
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 06-24-2011 , 11:39   Re: Time for an explosive like c4 timer
Reply With Quote #4

Wait so does it work? If not, you could set the entity's next think to 1 second, and then decrease the variable on entity think. Again, it would be the same thing. Set the HUD message to show for 1 second, and display something like

'Bomb will explode in %i seconds'
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 23:30.


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