Home   Help Search Login Register  

Author Topic: Custom weapon crashes game on respawn!  (Read 842 times)

0 Members and 1 Guest are viewing this topic.

bradman

  • Guest
Custom weapon crashes game on respawn!
« on: 09 Apr 2003, 09:02:00 »
Ok, i've spend hours and hours trying to debug this problem!! I'm about to go nuts, so before I do that, I thought about asking for help  ;D

I've made a custom weapon based off of the sniper rifle.  I've also implimented a script that reloads the player's weapons after they die.  Now, for some odd reason...after their second respawn, operation flashpoint dies! Just shuts off! no dialogue box or anything!

Here's the cpp file I made.  It was strange because it didn't die when i respawned with m16, but did evertime with the sniper.  So i switched to m16 with the sniper and having the same probelm if i try to switch to one mode (single, snipermode, whatever).  Here's the code:

Code: [Select]
// Basic def.
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7

#define true 1
#define false 0

// type scope
#define private 0
#define protected 1
#define public 2


class CfgPatches
{
   class LegoWarz_weapons
   {
      units[]={};
      weapons[]={LEGOWARZ_sniper, LEGOWARZ_smg};
      requiredVersion=1.00000;
   };
};

class CfgModels
{
   class Default{};
 Â Â Â class Weapon: Default{};
 Â Â Â class LEGOWARZ_smg : Weapon{};
   class LEGOWARZ_sniper : Weapon{};

};

class CfgAmmo
{
   class default {};
   class BulletSingle: default {};
   class BulletSniper: BulletSingle {};
   class SniperAmmo: BulletSniper {};
   class SMGAmmo: BulletSniper{};
};


class CfgWeapons
{
   class Default {};
   class MGun: Default {};
   class Riffle: MGun {};   
   class M16: Riffle {};
   
   class LEGOWARZ_sniper: M16
   {
      model="\LEGOWARZ_weapons\LEGOWARZ_sniper";
      modelOptics="\LEGOWARZ_weapons\optic_sniper.p3d";
      displayName="LegoWarz Sniper";
      displayNameMagazine="Sniper Mag";
      magazines[]={"LEGOWARZ_sniper"};
      //ammo=BulletSingleW;
      picture="\LEGOWARZ_weapons\sniper.paa";
      opticsZoomMin=0.04;
      opticsZoomMax=0.12;
      distanceZoomMin=400;
      distanceZoomMax=80;
      modes[] = {Snipemode};
      class Snipemode
      {
         ammo = BulletSniper;
         multiplier=1;
         burst=1;
         displayName="LegoWarz Sniper";
         dispersion=0.00003;
         sound[]={"LEGOWARZ_sniper\sniper",db0,1};
         soundContinuous=false;
         reloadTime=0.15;
         ffCount=1;
         recoil=riffleSniper;
         autoFire = false;
         aiRateOfFire=5.0; // delay between shots at given distance
         aiRateOfFireDistance=500; // at shorter distance delay goes lineary to zero

         useAction = false;
         useActionTitle = "";
      };
      
   };

   class LEGOWARZ_smg: M16
   {
      model="\LEGOWARZ_weapons\LEGOWARZ_smg";
      modelOptics="\LEGOWARZ_weapons\optic_smg.p3d";
      displayName="LegoWarz SMG";
      displayNameMagazine="SMG Mag";
      magazines[]={"LEGOWARZ_smg"};
      ammo=BulletBurst;
      picture="\LEGOWARZ_weapons\smg.paa";   
      
   };

};


class CfgNonAIVehicles
{
   class ProxyWeapon {};
   class ProxyLEGOWARZ_sniper : ProxyWeapon {};
   class ProxyLEGOWARZ_smg : ProxyWeapon {};

};

If anyone's familiar with this, thanks for the help!!!  ;D ;D
« Last Edit: 09 Apr 2003, 10:04:20 by bradman »