ExtracTioN 0 Posted December 5, 2002 Hi I have made a jeep with a 50Cal Machinegun but I am not good a cpp so I need a cpp file for my weapon and ammo any help would be apreciated Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 here is my cpp: // some basic defines #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 LRmgun { units[] = {LRmgun}; weapons[] = {}; requiredVersion = 1.0; }; }; class CfgModels { class default {}; class Vehicle: default {}; class Car: Vehicle {}; class LRmgun: Car {}; }; class CfgWeapons { class default {}; class MGun: Default {}; class MachineGun7_6: MGun {}; class MachineGun12_7: MachineGun7_6 {}; class LRmgun: MachineGun12_7 { displayName="MG50"; // sound[]={"\LRmgun\mgun.wav",db+40,1}; magazine="LRmgun"; displayNameMagazine="MG50"; shortNameMagazine="MG50"; count=500; soundContinous=0; magazineReloadTime=10; initSpeed=900; dispersion=0.00075; maxLeadSpeed=900; aiRateOfFire=2.0; aiRateOfFireDistance=20000; autoFire=1; optics=1; }; }; class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class LandVehicle: Land {}; class Car: LandVehicle {}; class Jeep: Car {}; class jeepMG: jeep {}; class LRmgun: jeepMG { displayName= "LR"; model=\LRmgun\LRmgun.p3d; camouflage=5; armor = 40; side = 1; type=VArmor cost=100000; weapons[]={"LRmgun50"}; magazines[]={"LRmgun50"}; dammageHalf[]= armorGlass=0.6; armorWheels=0.2; soundEngine[]={Vehicles\uazloop,db-30,1.25}; maxSpeed=120; // Max speed transportSoldier=7; // Right now just driver, no cargo unitInfoType="UnitInfoCar"; class TurretBase { gunAxis = "OsaHlavne"; turretAxis = "OsaVeze"; soundServo[]={"",1.0}; gunBeg = "usti hlavne"; gunEnd = "konec hlavne"; minElev=-10; maxElev=+20; minTurn=-360; maxTurn=+360; body = "OtocVez"; gun = "OtocHlaven"; }; driverAction="ManActJeepDriver"; gunnerAction="ManActJeepGunner"; hasCommander=0; }; }; }; Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 the error I got is: Config: 'a' encountered instead of '{' Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 no one that can help Share this post Link to post Share on other sites
DragoFire 0 Posted December 5, 2002 5--></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (ExtracTioN @ Dec. 05 2002,155)</td></tr><tr><td id="QUOTE">no one that can help <span id='postcolor'> Found problem! </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> dammageHalf[]= <span id='postcolor'> should be; </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> dammageHalf[]={}; <span id='postcolor'> DragoFire Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 I am gonna try it thx DragoFire m8 I notice you if it works Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 now ofp starts but on the menu it says: no entry 'config.bin/CfgWeapons.LRmgun50'. And when I select my model and start it chrash to desktop what is now wrong please help Share this post Link to post Share on other sites
DragoFire 0 Posted December 5, 2002 Here you go; </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> // some basic defines #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 LRmgun   {     units[] = {LRmgun};     weapons[] = {};     requiredVersion = 1.0;   }; }; class CfgModels { class default {}; class Vehicle: default {}; class Car: Vehicle {}; class LRmgun: Car {}; }; class CfgWeapons { class default {}; class MGun: Default {}; class MachineGun7_6: MGun {};    class MachineGun12_7: MachineGun7_6 {}; class LRmgun: MachineGun12_7 { displayName="MG50"; sound[]={"\LRmgun\mgun.wav",db-40,1}; // db's must be a -# magazine="LRmgun"; displayNameMagazine="MG50"; shortNameMagazine="MG50"; count=500; soundContinous=0; magazineReloadTime=10; initSpeed=900; dispersion=0.00075; maxLeadSpeed=900; aiRateOfFire=2.0; aiRateOfFireDistance=20000; autoFire=1; optics=1; }; }; class CfgVehicles {   class All {};   class AllVehicles: All {};   class Land: AllVehicles {};   class LandVehicle: Land {};   class Car: LandVehicle {};   class Jeep: Car {};   class jeepMG: jeep {};   class LRmgun: jeepMG   { displayName= "LR"; model=\LRmgun\LRmgun.p3d; camouflage=5; armor = 40; side = 1; type=VArmor cost=100000; weapons[]={"LRmgun50"};  // change to "LRmgun" as you haven't listed "LRmgun50" in "cfgweapon" magazines[]={"LRmgun50"}; // change to "LRmgun" dammageHalf[]={}; //as posted before armorGlass=0.6; armorWheels=0.2; soundEngine[]={Vehicles\uazloop,db-30,1.25}; maxSpeed=120; // Max speed        transportSoldier=7;   // Right now just driver, no cargo        unitInfoType="UnitInfoCar";                                    class TurretBase { gunAxis = "OsaHlavne"; turretAxis = "OsaVeze"; soundServo[]={"",1.0}; gunBeg = "usti hlavne"; gunEnd = "konec hlavne"; minElev=-10; maxElev=+20; minTurn=-360; maxTurn=+360; body = "OtocVez"; gun = "OtocHlaven"; }; driverAction="ManActJeepDriver"; gunnerAction="ManActJeepGunner"; hasCommander=0;    }; }; }; <span id='postcolor'> I've noted in the code where things look incoorect, check this and I yhink it'll work. DragoFire Share this post Link to post Share on other sites
ExtracTioN 0 Posted December 5, 2002 thx DragoFire it works now Share this post Link to post Share on other sites