radio fireing flak88?
Posted: Thu May 27, 2004 8:27 pm
Hello
i was making a thing for map dm/mohdm5 (snowy park)
it could be used on any map but i was testing it on there.
What it does:
there is 1 radio spawned into the map at the centre bridge. all players can use this radio to fire a flak88 explosion. calling it with his binoculars.
if a has the radio he can shoot else it says he needs the radio.
---------
It all works great with 1 person and some times with more then 1. but sometimes a player without the radio can shoot and so can the radio guy. and some times the guy with the radio is messaged he needs the radio when he does it and sometimes the flak88 just doesnt fire at all:(.
--------
is there any reason why things like that may happen and how could they be fixed?
here is the code. i also include a download pk3 with radio mod on snowy park http://elgan.pwp.blueyonder.co.uk/zz-us ... wypark.pk3
i was making a thing for map dm/mohdm5 (snowy park)
it could be used on any map but i was testing it on there.
What it does:
there is 1 radio spawned into the map at the centre bridge. all players can use this radio to fire a flak88 explosion. calling it with his binoculars.
if a has the radio he can shoot else it says he needs the radio.
---------
It all works great with 1 person and some times with more then 1. but sometimes a player without the radio can shoot and so can the radio guy. and some times the guy with the radio is messaged he needs the radio when he does it and sometimes the flak88 just doesnt fire at all:(.
--------
is there any reason why things like that may happen and how could they be fixed?
here is the code. i also include a download pk3 with radio mod on snowy park http://elgan.pwp.blueyonder.co.uk/zz-us ... wypark.pk3
Code: Select all
local.master= spawn ScriptMaster
local.master aliascache flak_snd_fire1 sound/weapons/fire/TankCannonFire1.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "obj dm"
local.master aliascache flak_snd_fire2 sound/weapons/fire/Flak88Fire1.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "obj dm"
local.master aliascache flak_snd_fire3 sound/weapons/fire/Flak88Fire3.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "obj dm"
local.master aliascache flak_snd_fire4 sound/weapons/fire/Flak88Fire4.wav soundparms 1.5 0.0 1.0 0.0 2000 4000 weapon loaded maps "obj dm"
local.master aliascache snd_binoculars sound/mechanics/Mec_RadioNoise_11.wav soundparms 0.5 0.2 0.9 0.1 160 1600 item auto loaded maps "m moh obj dm team "
local.master aliascache leadinmp1 sound/weapons/explo/Exp_LeadIn_06.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "m moh obj dm team "
local.master aliascache leadinmp2 sound/weapons/explo/Exp_LeadIn_07.wav soundparms 0.8 0.2 0.7 0.5 160 3000 auto loaded maps "m moh obj dm team "
local.master aliascache leadinmp3 sound/weapons/explo/Exp_LeadIn_08.wav soundparms 0.8 0.2 0.7 0.5 160 300 auto loaded maps "m moh obj dm team "
local.master aliascache m3l2_radio_pickup sound/items/Item_ToolBox_01.wav soundparms 1.5 0.0 1.0 0.0 100 2000 item loaded maps "m3l2 dm moh obj train"
level.radio_spot = ( 2103 -4838 167 )
goto spawn_radio
end
spawn_radio:
local.radio = spawn script_model "targetname" "radio"
local.radio model "items/walkietalkie.tik"
local.radio.origin = level.radio_spot
local.radio.angles = ( 0 0 0 )
local.radio.scale = 1.0
local.radio_trigger = spawn trigger_use "targetname" "radio_trigger"
local.radio_trigger.origin = level.radio_spot
local.radio_trigger setsize ( -30 -30 -30 ) ( 30 30 30 )
local.radio_trigger setthread radio_trigger
local.radio_trigger message "You Have a Radio"
local.radio_trigger wait 1 // How often the trig acts
local.radio_trigger delay 0 // How long before trig acts
end
binocular_fire:
local.player=parm.other
if(local.player.can!=1)
{
local.player iprint "i need radio"
end
}
if(level.canshoot==1)
{
local.player iprint "Please wait..."
end
}
thread canshoot
wait 1
self playsound flak_snd_fire1
wait .1
self playsound flak_snd_fire2
self playsound snd_binoculars
if ($world.farplane == NIL ) {
level.bnok_sight_max = 22000
} else {
if ($world.farplane < 1) {
level.bnok_sight_max = 22000
} else {
level.bnok_sight_max = $world.farplane
}
}
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "Bip01 Head"
local.hit_location = trace (local.start + local.fwd_vec * 64) (local.start + local.fwd_vec * level.bnok_sight_max) 0
local.org = spawn script_origin
local.org.origin = local.hit_location
wait 1
self playsound leadinmp1
wait 1
self playsound leadinmp2
wait 1
self playsound leadinmp3
wait 1
local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
local.Exp3 = spawn "animate/fx_mortar_higgins.tik"
exec global/earthquake.scr .23 4 0 0
local.Exp1.origin = local.org.origin
local.Exp1 anim start
local.Exp2.origin = local.org.origin
local.Exp2 anim start
local.Exp3.origin = local.org.origin
local.Exp3 anim start
wait 1
local.Exp1 remove
local.Exp2 remove
local.Exp3 remove
end
radio_trigger:
local.player=parm.other
level.lighting=0
$radio playsound m3l2_radio_pickup
local.player.can = 1
local.player playsound m3l2_radio_pickup
local.player iprint "You Have the Radio, You can now Fire the Flak88's"
//local.player light 1 0 0 300
local.player stufftext "say Ive got the radio!!!"
$radio remove
$radio_trigger nottriggerable
while (1)
{
if !(isalive local.player)
{
level.lighting = 1
thread radio_lights
local.player light 0 0 0 0
level.radio_spot = local.player.origin
local.player.can = 0
$radio_trigger triggerable
thread spawn_radio
break
}
wait 1
}
end
radio_lights:
while(level.lighting==1)
{
wait 1
$radio light 0 0 0 0
$radio light 1 0 0 200
wait 1
$radio light 0 0 0 0
$radio light 0 1 0 200
}
$radio light 0 0 0 0
end
canshoot:
level.canshoot=1
wait 5
level.canshoot=0
end