Time for an explosive like c4 timer
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. |
Re: Time for an explosive like c4 timer
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. |
Re: Time for an explosive like c4 timer
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. |
Re: Time for an explosive like c4 timer
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' |
| All times are GMT -4. The time now is 23:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.