Home   Help Search Login Register  

Author Topic: drop weapon  (Read 549 times)

0 Members and 1 Guest are viewing this topic.

Cpl. Vagabond

  • Guest
drop weapon
« on: 02 Apr 2003, 12:09:21 »
i saw somewhere on the forum a script that makes the guy fall over went he's shot and i'm mixing that with the bleeding script to make the guy bleed to death on the floor....but is there a way to make the guy drop his weapons (not removeAllWeapons). and is the a universal name for a guy because in my capture script i only works for the guy named soldier

Knut Erik

  • Guest
Re:drop weapon
« Reply #1 on: 02 Apr 2003, 12:52:46 »
You mean trow his weapons away when he have been hit?
You can use the Removeallweapons soldier to remove the weapons from him.

That bleed script.. Where can i find it...  ::) ::)

Cpl. Vagabond

  • Guest
Re:drop weapon
« Reply #2 on: 02 Apr 2003, 16:45:15 »
no removeWeaponsAll just makes the weapons disappear i want to make him drop the currently equiptweapon on the floor so it can be picked back up later

hurlothrumbo

  • Guest
Re:drop weapon
« Reply #3 on: 03 Apr 2003, 19:18:59 »
look in the command reference for one called action 'dropweapon' or something along those lines

Offline SpaceMace

  • Members
  • *
  • God d**n the torpedoes...
Re:drop weapon
« Reply #4 on: 12 Apr 2003, 12:00:54 »
Try

Quote
unitname action ["DROP WEAPON", unitname, 0, 0,"weapon"]


Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:drop weapon
« Reply #5 on: 14 Apr 2003, 13:33:36 »
Continuing on this matter, would anyone know how to format this action? In my script the weapon is never any particular one. Here's what I've come up with so far, but this returns empty, and an note that there's no entry in the config of this unnamed weapon:

Quote
_unit action ["drop weapon",_unit,0,0,[format ["%1",(weapons _unit select 0)]]]

This doesn't work either:
Quote
_unit action [format ["drop weapon",_unit,0,0,"%1",(weapons _unit select 0)]]]

...my keybs spacebar just nearly died onme, better stop here. Btw if there's missing brackets it's yabb.
« Last Edit: 14 Apr 2003, 13:45:47 by MI_Fred »
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.

Cpl. Vagabond

  • Guest
Re:drop weapon
« Reply #6 on: 14 Apr 2003, 16:03:54 »
i got it so you drop the weapon but you stop and drop the weapon, i need it so you drop it quickly like if your shot and dropped it.

Offline MI_Fred

  • Members
  • *
  • AA
    • OFP Team Finlanders
Re:drop weapon
« Reply #7 on: 14 Apr 2003, 18:01:26 »
You could try that with eventhandlers and 'while do' loops...
place a trigger covering the map, and set side to which you want, condition to true. On activation:
Quote
{_x addEventHandler ["killed",{_this exec "dropwpn.sqf"}]} forEach thislist

dropwpn.sqf
Quote
_corpse = _this select 0
_mags = magazines _corpse
_guns = weapons _corpse
_magcount = count magazines _corpse
_guncount = count weapons _corpse

~3
? (alive _corpse) : exit
_wpnh = "weaponholder" createVehicle [(getPos _corpse select 0) - 2 + (random 2*2),(getPos _corpse select 1) - 2 + (random 2*2),0]

_c = 0
while "_c <= (_magcount - 1)" do {_wpnh addmagazineCargo [format ["%1",(_mags select _c)],1]; _c = _c + 1}
_c = 0
while "_c <= (_guncount - 1)" do {_wpnh addweaponCargo [format ["%1",(_guns select _c)],1]; _c = _c + 1}

deleteVehicle _corpse
exit
Note: Requires sqf form. IF MP, respawn has to be quicker than the delay (~3). All weapons, including rocketlaunchers, will be added to this one dropped model. In order to not duplicate the weapon amount, the corpse has to be deleted. And this all works kinda iffy. That's a modification of Toadlifes weapon respawn  ;)
There's gooks over there, there's mines over there, and watch out those goddamn monkeys talk, I'll bite ya.