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
im having a problem with stopwatch
Moderator: Moderators
-
Lt.Audie L Murphy
- Lance Corporal
- Posts: 22
- Joined: Wed Feb 16, 2005 8:47 am
-
Master-Of-Fungus-Foo-D
- Muffin Man
- Posts: 1544
- Joined: Tue Jan 27, 2004 12:33 am
- Location: cali, United States
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:
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]-
Lt.Audie L Murphy
- Lance Corporal
- Posts: 22
- Joined: Wed Feb 16, 2005 8:47 am
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
i use the bombthinkers
but then you have to add a couple values to your spawned explosives.
but basically
$explosives_targetname is the targetname of your explosives.
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
-
Lt.Audie L Murphy
- Lance Corporal
- Posts: 22
- Joined: Wed Feb 16, 2005 8:47 am
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Ahh. Cool thinking. Well... never tried it, but this should work (to start the watches for all players):
...it loops thrugh the $player array, starting a stopwatch for everyone that is alive.
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
}
}


