Home   Help Search Login Register  

Author Topic: Ammo Trobble With M16+M203 and kozlice  (Read 1723 times)

0 Members and 2 Guests are viewing this topic.

CopyrightPhilly

  • Guest
Ammo Trobble With M16+M203 and kozlice
« on: 15 Apr 2004, 01:18:21 »
ok every other weapon work with the code i have been using but these to very anoying guns... what i want is for them to start with 1 round each so i used the following code...

===============================
M16 + M203 Code
===============================

_player=player
_wepmag="M16";
_wep="M16GrenadeLauncher";
_weap=PrimaryWeapon player

_player removeweapon _weap

_player addmagazine _wepmag
_player addweapon _wep
_player selectWeapon _wep
goto "done"

===============================
kozlice Code
===============================

_player=player
_wepmag="Kozliceshell";
_wep="Kozlice";
_weap=PrimaryWeapon player

_player removeweapon _weap

_player addmagazine _wepmag
_player addweapon _wep
_player selectWeapon _wep
goto "done"

===============================

This Methed Worked Fine For All The Others...

It Gives Me The Gun But Without The Ammo.

So Thanks In Any Advice You Game Give Me On This One...

Cheers, Philly
« Last Edit: 15 Apr 2004, 01:19:29 by CopyrightPhilly »

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #1 on: 15 Apr 2004, 02:04:49 »
If you are not removing the original magazines somewhere, the new ammo won't get loaded.  Removeweapon just removes the weapon, not its ammo too.  If you add "removemagazines xxxx" before adding, it should work right.

However, does kozliceshell work?  I don't think it does, only kozliceball.  I don't think kozliceshell is in the config as an ammo type for the kozlice.  You can give it to the guy, but it will never load into the shotgun and he will show zero ammo for his weapon, despite having kozliceshell in his inventory.


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #2 on: 15 Apr 2004, 02:17:24 »
The following is from the config for the Hunter in Res:

magazines[]={"KozliceShell","KozliceShell","KozliceShell","KozliceShell","KozliceShell","KozliceBall","KozliceBall","KozliceBall","KozliceBall","KozliceBall"};


Planck
I know a little about a lot, and a lot about a little.

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #3 on: 15 Apr 2004, 02:19:03 »
But what about the config entry for the kozlice weapon - does it show the shell as being an ammo?

It won't load on mine.  Just the ball.

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #4 on: 15 Apr 2004, 02:21:28 »
Make the player a resistance Hunter and check it out.  I have no option to load the shell, and once the ball is all shot, thats it.  The weapon shows no ammo and no option to load the shell shot - just ball.

The issue is the config entry for the weapon, not the vehicle.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #5 on: 15 Apr 2004, 02:24:17 »
I just tried it in the Editor.

I played as a HUnter so I had the kozlice.

To start off I was loaded with the ball, pressing space changed me to shell.

After firing the shell, I had to reload with R.


Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #6 on: 15 Apr 2004, 02:28:21 »
ok is there anyway i can say to delete jsut the primary ammo like i did primary gun i tryed...

_mags=Primarymagazines player

but i just got an error, i dont want to to remove all the player ammo just its primary

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #7 on: 15 Apr 2004, 02:31:28 »
I always thought removeAllWeapons removed the ammo also.

But I could be wrong there, try it anyway.


From Kozlice cofig:

class CfgAmmo
{
   
   class default {};

   class BulletSingle : Default
   {   };
   
   class KozliceBall : BulletSingle {};
   
   class BulletBurst: BulletSingle {};
   
   class KozliceShell : BulletBurst
   {
      hit=9;indirectHit=6;indirectHitRange=0.1;
   };
   
};


Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #8 on: 15 Apr 2004, 02:35:48 »
yes removeallweapons dose remove the ammo, but the part of the ALL means ALL so it deletes the player handguns and what ever else.

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #9 on: 15 Apr 2004, 02:39:53 »
"removeAllWeapons"

does remove the ammo, but he has "removeweapon"

which just pulls the weapon but leaves the ammo.

CopyrightPhil - you call "player removemagazines xxxx" where xxx is the magazine name you want to remove.

RE: The Kozlice - you're changing the weapon?  That is the trick!  I assumed it would accept two types of ammo, I didn't think it had two different muzzles requiring a weapon change to get to fire shell!  Thanks for the tip!


Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #10 on: 15 Apr 2004, 02:42:09 »
unit removemagazines weaponname

in your case

_player removemagazines _weap



Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #11 on: 15 Apr 2004, 02:43:07 »
yea i'll put _player removeweapon "xxxxxx" put i need to type it 16 times over for 16 files lol

_player removemagazines "AK47"
_player removemagazines "AK74"
_player removemagazines "6G30"
_player removemagazines "HuntingrifleMag"
_player removemagazines "M4"
_player removemagazines "MM1magazine"
_player removemagazines "UZIMag"
_player removemagazines "FAL"
_player removemagazines "HKG3Mag"
_player removemagazines "G36aMag"
_player removemagazines "SteyrMag"
_player removemagazines "M16"
_player removemagazines "HK"
_player removemagazines "M21"
_player removemagazines "SVDDragunov"
_player removemagazines "BizonMag"
_player removemagazines "Kozliceshell"


well that makes 17 file now lol

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #12 on: 15 Apr 2004, 02:46:27 »
Still Trooble With The M16, Havnt Tryed The Other One Yet.

My M16 code is now:
======================================

_player=player
_wepmag="M16";
_wep="M16GrenadeLauncher";
_weap=PrimaryWeapon player

_player removeweapon _weap
_player removemagazines "AK47"
_player removemagazines "AK74"
_player removemagazines "6G30"
_player removemagazines "HuntingrifleMag"
_player removemagazines "M4"
_player removemagazines "MM1magazine"
_player removemagazines "UZIMag"
_player removemagazines "FAL"
_player removemagazines "HKG3Mag"
_player removemagazines "G36aMag"
_player removemagazines "SteyrMag"
_player removemagazines "M16"
_player removemagazines "HK"
_player removemagazines "M21"
_player removemagazines "SVDDragunov"
_player removemagazines "BizonMag"
_player removemagazines "Kozliceshell"

_player addmagazine _wepmag
_player addweapon _wep
_player selectWeapon _wep
goto "done"

======================================

so that didnt go to plan lol

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #13 on: 15 Apr 2004, 02:47:08 »
Yeah the guide is misleading, it *says* you call "removemagazines weaponname", but it won't work.  You have to actually use the *magazine* name.

I suppose it would work as listed on some of the default BIS weapons, but not all, and certainly won't work for most addon weapons where the magazine name is different from the weapon name.


CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #14 on: 15 Apr 2004, 02:49:38 »
yea all the names are the right magaize names, i dobble checked that...

but still no darn luck

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #15 on: 15 Apr 2004, 02:50:20 »
It might be easier to use the "typeOf" function to figure out what kind of guy you are working with, then figure out what his standard loadout is and work from there.

How exactly are you going to use this script?  Do you really need to check for every magazine type?


RE: Your last post, what happens with the m16 when you run the script?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #16 on: 15 Apr 2004, 02:52:35 »
Did you try JUST using:

_player removemagazines _weap


Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #17 on: 15 Apr 2004, 02:52:50 »
its a buy weapons scipt for a dialog, u can buy every thing at this min but its only them two guns i cant get any ammo for..

and _player removemagazines _weap didnt work...
« Last Edit: 15 Apr 2004, 02:54:47 by CopyrightPhilly »

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #18 on: 15 Apr 2004, 02:57:48 »
I just made a script with the code you posted, and ran it on a guy carrying an m4, and it ran fine - no errors, he had an m16/m203 with one m16 mag when it was done.

What exactly happens on your end when you run it?  Does he have the magazine in his inventory or not?  Or is the original ammo not getting removed, what?



CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #19 on: 15 Apr 2004, 03:00:55 »
it changes the weapong fine, i just get a + shape pointer and it will not even try to fire the gun..

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #20 on: 15 Apr 2004, 03:01:29 »
Did you try JUST using:

_player removemagazines _weap


Planck

That will only work where the magazine name is identical to the weapon name - like the BIS M16.  It won't work on the BIS M16/M203, as there is no magazine named "m16grenadelauncher".  Ditto, on any weapon that can accept more than one magazine, like the Kozlice, it won't work, as there is *no ammo* called "kozlice".

It has to be called with the name of a magazine, despite what the reference says.

Kammak

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #21 on: 15 Apr 2004, 03:03:30 »
it changes the weapong fine, i just get a + shape pointer and it will not even try to fire the gun..

?

What does the guy have originally - weapon and magazine?  Are they gone after your script runs - what is in his inventory?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #22 on: 15 Apr 2004, 03:04:47 »
I understand what you mean.

What about the G36a and its magazine.......G36aMag.


Planck
I know a little about a lot, and a lot about a little.

CopyrightPhilly

  • Guest
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #23 on: 15 Apr 2004, 03:12:28 »
pmsl, soz guys i found out why... help when u press the space bar

thanks a lot for your help

is there anyway to tell it to start on the seleted insted of pressing space bar its aready selected?

cheers, philly
« Last Edit: 15 Apr 2004, 03:14:46 by CopyrightPhilly »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #24 on: 15 Apr 2004, 03:20:32 »
Maybe you could change it from Kozlice as a weapon to

Kozliceshell and Kozliceball

So in effect it is 2 weapons instead of one.

Just an idea.....may not work.


Planck
« Last Edit: 15 Apr 2004, 03:21:00 by Planck »
I know a little about a lot, and a lot about a little.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Ammo Trobble With M16+M203 and kozlice
« Reply #25 on: 15 Apr 2004, 10:58:17 »
is there anyway to tell it to start on the seleted insted of pressing space bar its aready selected?

player selectweapon (primaryweapon player)

;)