Home   Help Search Login Register  

Author Topic: Need help for a script (guns)  (Read 544 times)

0 Members and 1 Guest are viewing this topic.

LaOstia

  • Guest
Need help for a script (guns)
« on: 28 Oct 2004, 23:16:40 »
Hi all, i am creating a script and i need to know how can i get the name of pistol of someone soldier. For example (One soldier with a "M16" , "LAWLAUNCHER" and "Beretta"):
  For get the primary weapon:
     _Riffle = PrimaryWeapon _Unit; <-- I get "M16"
  For get the secondary weapon:
     _Launcher = SecondaryWeapon _Unit; <-- I get "LAWLAUNCHER"
  And how can i get the name of the pistol¿?¿?

Thx for your attention.
LaOstia
     

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Need help for a script (guns)
« Reply #1 on: 29 Oct 2004, 03:17:19 »
I did a script that changes a units sidearm (handgun).  To change his handgun it first finds out what is his handgun, so you could modify this script to suit you purpose.  It is attached.

Oops, I attached an old version of the script, good thing I double checked it.  Sorry about that, here is an updated version
« Last Edit: 30 Oct 2004, 03:13:45 by Raptorsaurus »

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Need help for a script (guns)
« Reply #2 on: 30 Oct 2004, 03:16:10 »
I updated the script, so the attachment in the previous post is now a working script.  Maybe you already found my error (two diffent variable for the same thing (_tempwpns vs. _wpns).  Also, I left out the magazine replacement section.  Anyway, this version is tested and works (I re-attached it in the previous post).