Jump to content
Sign in to follow this  
boom

Is my cpp right?

Recommended Posts

is this ok?

// 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

#define DefaultManWeapons Throw,Put

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy

weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class plasmarifle

{

units[] = {SoldierWSaboteurPlasma};

weapons[] = {plasmarifle};

requiredVersion = 1.20;

};

};

class CfgAmmo

{

class default {};

class LAW : Default

{ };

class plasmaammo : LAW

{

hit=1520;indirectHit=1520;indirectHitRange=10;

};

};

class CfgVehicles

{

class Man:Land{};

class Soldier:Man{};

classSoldierWB:Soldier

class SoldierWSaboteur: SoldierWB

class SoldierWSaboteurPipe: SoldierWSaboteur

classSoldierWSaboteurplasma: SoldierWSaboteurPipe

STR_DN_ADD_PLASMA_SOLDIER_Soldier (plasma)

}:

class CfgWeapons

{

class default {};

class LAWLauncher : Default {};

class plasmarifle : LAWLauncher

{

ammo=plasma;

displayName = $STR_DN_ADD_plasma;

displayNameMagazine = $STR_DN_ADD_PLASMA_AMMO_plasma;

shortNameMagazine = $STR_DN_ADD_PLASMA_AMMO_SHORT_plasma;

count=2;

magazineReloadTime=1

reloadTime=0.5;

initSpeed=500

aiRateOfFire=5.0; // delay between shots at given

distance

aiRateOfFireDistance=1000; // at shorter distance delay

goes lineary to zero

};

class plasma

{

weaponType = WeaponSlotPrimary;

magazineType 6*WeaponSlotItem;

displayName = $STR_DN_plasma

model="\plasma\plasma.paa";

}

}:

class CfgNonAIVehicles

{

class ProxyWeapon{};

class Proxyplasma: ProxyWeapon {};

};

Share this post


Link to post
Share on other sites

Owww...found alot of mistakes there...well here's waht you need:

</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

//edited by SOul_Assassin

#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

#define DefaultManWeapons Throw,Put

// type scope

#define private 0

#define protected 1

#define public 2

#define WeaponNoSlot 0// dummy

weapons

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

#define WeaponSlotItem 256// items

#define WeaponSlotBinocular 4096// binocular

#define WeaponHardMounted 65536

class CfgPatches

{

class plasmarifle

{

units[] = {SoldierWSaboteurPlasma};

weapons[] = {plasmarifle};

requiredVersion = 1.20;

};

};

class CfgAmmo

{

class Default {};

class AT3 : Default {}; //This is important

class LAW : AT3 {}; //as you have to keep hierarchy structure

class plasmaammo : LAW

{

hit=1520;

indirectHit=1520;

indirectHitRange=10;

};

};

class CfgWeapons

{

class Default {};

class LAWLauncher : Default {};

class plasmarifle : LAWLauncher

{

ammo = "plasmaammo"; // has to be the same as defined in the CfgAmmo

displayName = "Plasma Rifle"; //dont bother with string tables yet

displayNameMagazine = "Plasma mag";

shortNameMagazine = "plasmamag";

count=2;

magazineReloadTime=1

reloadTime=0.5;

initSpeed=500

aiRateOfFire=5.0; // delay between shots at given

distance

aiRateOfFireDistance=1000; // at shorter distance delay

goes lineary to zero

weaponType = WeaponSlotPrimary;

magazineType=6*WeaponSlotItem;

model="\plasma\plasma.p3d"; // why did u have .paa here?? model means it has

}; // to be a p3d file

}:

class CfgVehicles

{

class All {}; // again keep the official hierarchy

class AllVehicles : All {};

class Land : AllVehicles {};

class Man : Land {};

class Soldier : Man {};

class SoldierWB : Soldier {}; //dont forget the {}; every time you define a sub-class

class SoldierWSaboteur : SoldierWB {};

class SoldierWSaboteurPipe : SoldierWSaboteur {};

class SoldierWSaboteurPlasma: SoldierWSaboteurPipe

{

displayName = "Saboteur (plasma)";

weapons[]={"plasmarifle","Throw","Binocular"};

magazines[]={"plasmarifle"};

};

};

class CfgNonAIVehicles

{

class ProxyWeapon{};

class Proxyplasma: ProxyWeapon {};

};

<span id='postcolor'>

Hope that helps

Share this post


Link to post
Share on other sites

thx SA

for the help and the webpage's biggrin.gif

Share this post


Link to post
Share on other sites

i've stuffed into a pbo and put in the addons folder in ofp but i cant find it ingame!! where would it be?

Share this post


Link to post
Share on other sites

it isn't there. i cpoied the cpp that you did and put it in the plasma folder but i still cant find it in game sad.gif

is there a mistake in the cpp??

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×