Strip Player's weapons?

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Strip Player's weapons?

Post by Cigs »

im making a dm map for Spearhead and there's a basement i want players to be in without weapons. as soon as they pass a metal detector :) they will be able to fight of enemies with only nades and maybe a handgun too !?

#1
I like to know how to strip a player's weapons (all OR all minus his/her handgun) with a trigger_multiple or ... ?
#2
I also like to know how to equip with nades i place on a table ? maybe point me to a thread ot tut, cause I haven't found one yet!

Cigs!
Image
TS217.172.173.37:9095
Spearhead SDK Q's
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

okay you've got your trigger_multiple with a setthread alue of whatever you want it to be, and you just use the take command.... since this is dm and you don't know what weapon they'll have, we jsut take all the primary weapons.... so repeat the following code for all the weapon names you can think of.... i put a bunch in there for good measure.

parm.other take item weapon/enfield.tik
parm.other take item weapon/thompsonsmg.tik
parm.other take item weapon/mp40.tik
parm.other take item weapon/mp44.tik
parm.other take item weapon/bazooka.tik
parm.other take item weapon/sten.tik

actually you might have to experiement with that a little, i've never had reason to take stuff from a palyer but try it out!
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

trigger_multiple

Post by Cigs »

tried setthread, easy way, didn't work. :?
i also tried differently. targetname/strip_trigger for trigger_multiple

Code: Select all

thread stripweapons

level waittill spawn 

end 


stripweapons:

while(1) 
{ 
$strip_trigger waittill trigger
waitframe

parm.other take item weapon/enfield.tik 
parm.other take item weapon/thompsonsmg.tik 
parm.other take item weapon/mp40.tik 
parm.other take item weapon/mp44.tik 
parm.other take item weapon/bazooka.tik 
parm.other take item weapon/sten.tik 

} 
end
but no taking away when i for instance had a sten in my hands!
what about
while(1)
{
for (local.i=1;local.i <= $player.size;local.i++)
{
$player[local.i] take item weapon/... ???
$player[local.i] take item weapon/... ???
$player[local.i] take item weapon/... ???
}
waitframe
}
end
i don't know how to do it right :?
do you :lol:, lool, ty
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

nothing gets taken away! i stay equiped with all my weapons :?
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
oddball
Corporal
Posts: 44
Joined: Tue May 27, 2003 3:49 pm
Contact:

Post by oddball »

try parm.other takeall
[VS-UK]Maj.OddBall[BnHQ]
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

thx, that worked! :)

Now, i can ask another Q ?
is there a_good_sound that would do for stripping a player's weapons? can it be played by my trigger_multiple; like $strip_trigger playsound a_good_sound

+

i like to give nades lying on a table.
will
parm.other give item weapon/weaponname.tik
work?

(i can place weapons to take, BUT nades ... you can only hear when picked up, you don't actually have nades)(maybe this is a problem with my SDK? dno :/ )
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Giving 1 grenade? tut ???

Post by Cigs »

I read Giving and Taking Stuff from the Player from MOH Miscellaneous Script Documentation.html (located in C:\Program Files\EA GAMES\MOHAA\SDK\docs)

$player ammo type amount (is how to give ammo) (*)


this is how i tried giving one grenade touching a trigger_multiple.
setthread/give_grenade

give_grenade:
$player ammo grenades 1
end

but it didn't work :x Is there a thread or tut on SUPLYING GRENADES ? :roll: addon_playerweapons_german_steilhandgranate spawns a grenade, makes a'sounds, but it doesn't g!ve the item :/
can i get explainations anywhere? :roll:


(*) possible types: grenades, pistol, rifle, smg (for sub-machineguns), mg (for machineguns), grenades, shotgun, heavy (for heavy explosive weapons like the bazooka)
Image
TS217.172.173.37:9095
Spearhead SDK Q's
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

tyes are

pistol
rifle
smg
mg
heavy
grenade
and in Spearhead
smokegrenade
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

parm.other item weapons/M2Frag_Grenade_sp.tik
parm.other item weapons/steilhandgranate.tik
parm.other ammo grenade 5
parm.other ammo agrenade 5
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

parm.other grenade 5 WORKED 8-) , all the other didn't

(ps: in MOH Miscellaneous Script Documentation.html it stated 'grenades' is a type :evil: .... seems that is wrong, idd, it's 'grenade' that is, like you said!)

so parm.other grenade 5 gives 5 british grenades. what about steilhandgranate ? .... do i have to be a german... or...
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

give addon_.. a [b]setthread[/b] key ?? possible

Post by Cigs »

and another thing can i give an addon_playerweapon_german_steilhandgranate a setthread/give_nade for instance?
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

Post by Cigs »

NEVERMIND :D

just had to place the addon_playerweapons_....grenades (ANY NADE TYPE), put a trigger_multiple over it setthread/give_nade

Code: Select all

give_nade: 

waitframe
parm.other ammo grenade 1 // $player ammo type amount (type : grenade, pistol, rifle, smg (for sub-machineguns), mg (for machineguns), grenades, shotgun,  heavy (for heavy explosive weapons like the bazooka) 
self nottriggerable // so it gives only 1 nade
wait 20
self triggerable // so it can give a nade next time the thread is called

end
thx for helping out, guys ! 8-)
Great!
Image
TS217.172.173.37:9095
Spearhead SDK Q's
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

metaldetector (stripping weapons)

Post by Cigs »

Thx for the help guys!
I made a metaldetector Image
made a script to activate
a red light (script_model (model/fx/dummy.tik) targetname/md_light)
+
show a red corona. (addon_fx_corona_red-bright targetname/md_corona)
+
ofcourse the green trigger_multiple setthread/metaldetector to acivate the thread

here's the script:

Code: Select all

// prep

	$md_light light(1 0 0) 
	$md_light lightRadius 50 // CONTROL THE RADIUS OF THE LIGHT 
	$md_light notsolid 
	$md_light lightoff 

	for(local.d = 1;local.d <= $md_corona.size;local.d++) 
	$md_corona[local.d] hide 




level waittill spawn

end

//------------------
// metaldetector
//------------------
metaldetector:

if !(level.pulseing == 1) // allows only one thread to run 
{ 
   level.pulseing = 1 

   self nottriggerable 

   iprintln_noloc "No weapons allowed!"

   parm.other takeall

   local.timer = 0 

   while(local.timer < 1) 
   { 
   for(local.d = 1;local.d <= $md_corona.size;local.d++) 
   $md_corona[local.d] show 

   for(local.d = 1;local.d <= $md_light.size;local.d++) 
   { 
   $md_light[local.d] lighton 
   $md_light[local.d] playsound detector_alarm
   } 

   wait .5 

   for(local.d = 1;local.d <= $md_light.size;local.d++) 
   $md_light[local.d] lightoff 

   for(local.d = 1;local.d <= $md_corona.size;local.d++) 
   $md_corona[local.d] hide 

   wait .5 

   local.timer++ 
   } 
level.pulseing = 0 

wait .5 

self triggerable 

} 

end
it works just fine. maybe you like to make one of your own one day.
Thx again :)
Cigs!
Last edited by Cigs on Thu Jun 17, 2004 11:51 pm, edited 3 times in total.
Image
TS217.172.173.37:9095
Spearhead SDK Q's
HotShizzle
Corporal
Posts: 25
Joined: Wed Apr 28, 2004 1:22 am
Contact:

Post by HotShizzle »

hmmm cool i mite put it in my map
~.::[FS] 4 LyF3::.~
User avatar
Cigs
Colour Sergeant
Posts: 90
Joined: Fri May 28, 2004 1:04 pm
Location: Gent - BELGIUM

trigger_push PUSH PLAYER FORWARD, plz. - HORIZ.! NOT VERT.!

Post by Cigs »

im still working on a trigger_push, to force someone to go true - when they go thrue - and forces not being able to go back.
this SHOULD be easy :( ~ angle/value
the trigger_push target/pushhere pushes UP only :/ :!:

the angle is not -1 not -2. tried every angle (0,90,...) tried even no angle.
angle/value doesn't work
angles/values( x x x) doesn't work
and trigger_push targets script_origin targetname/pushhere

:?:
Image
TS217.172.173.37:9095
Spearhead SDK Q's
Post Reply