Page 1 of 1

im having a problem with stopwatch

Posted: Mon Feb 21, 2005 4:38 pm
by Lt.Audie L Murphy
im having a problem with stopwatch here my code

im using



spawn_a_flak88:
println "[threadStart] spawn_a_flak88"
//******************************
//* The flak88 gun
//******************************
local.flak = spawn script_model "targetname" "exploder"
local.flak model "statweapons/flak88turret.tik"
local.flak.destroyed_model = "models/statweapons/flak88_d.tik"
local.flak.set = 1
local.flak origin ( -6575 2033 489 )
local.flak.angles = ( 0 -90 0 )

//******************************
//* The flak88 base
//******************************
local.base = spawn script_model "targetname" "flak88base"
local.base model "statweapons/flak88base.tik"
local.base.origin = ( -6575 2033 432 )
local.base.angles = ( 0 0 0 )

//******************************
//* The bomb model
//******************************
local.bomb = spawn script_model "targetname" "bomb"
local.bomb model "items/pulse_explosive.tik"
local.bomb.origin = ( -6571 2185 446 )
local.bomb.angles = ( 0.0 0.0 0.0 )
local.bomb.exploder_set = 1
iprintlnbold "The bomb have been planted!" ////// code i added

local.bomb.explosion_fx = "models/fx/fx_explosion.tik"
local.bomb.trigger_name = "bomb_trigger"
local.bomb.target = "exploder"

//******************************
//* The bomb trigger
//******************************
local.trigger = spawn trigger_use "targetname" "bomb_trigger"
local.trigger setsize ( -6571 2185 445 ) ( -6571 2185 446 )





bomb works fine allies can set the bomb

axis can defuse the bomb

when bomb explodes level ends and restarts



only after bomb is set stop watch dont appear



ive tried all codes posted tried stock scr code but all same result ,,,

i added this to the bomb script without a problem

iprintlnbold "The bomb have been planted!"



thank you in advance

Posted: Mon Feb 21, 2005 4:54 pm
by Master-Of-Fungus-Foo-D
uhmm in case you didnt notice, there ISNT ANY stopwatch code in your script... you cant expect it to be there if you didnt ascript it to...

here, go to your trigger's sethhread, Then palce this line after your bomb has started ticking:

Code: Select all

$player stopwatch 30 //<-- # = [amount of time]

Posted: Mon Feb 21, 2005 6:32 pm
by Lt.Audie L Murphy
yes i noticed ,,,, this is my problem ,,,,, i have stop watch code just cant seem to get it to work with code im using

ive placed it everywhere in that code i posted but same result

Posted: Mon Feb 21, 2005 8:48 pm
by Green Beret
i use the bombthinkers
but then you have to add a couple values to your spawned explosives.

but basically

Code: Select all

$explosives_targetname thread global/obj_dm.scr::bomb_thinker
$explosives_targetname is the targetname of your explosives.

Posted: Mon Feb 21, 2005 10:46 pm
by Lt.Audie L Murphy
i tried your code Green Beret kinda worked ,,,, only stop watch appeard after bomb blows up

hehe :D

getting further : ) is all that matters

Posted: Mon Feb 21, 2005 10:49 pm
by Bjarne BZR
Ahh. Cool thinking. Well... never tried it, but this should work (to start the watches for all players):

Code: Select all

for(local.i = 1; local.i <= $player.size; local.i++) {
	local.player = $player[local.i]
	if(isAlive local.player) {
		$player stopwatch 30
	}
}
...it loops thrugh the $player array, starting a stopwatch for everyone that is alive.