Jump to content
Sign in to follow this  
GAMEER_77

Getting my handgun in game

Recommended Posts

Yoo-hoo! wow.gif

Well, i made a quick model yesterday of the WaltherPPK, and now i wanna try it out in game.

Only problem is, i don't know how to get it in. I've got brsseb's tute so please don't point me towards that. That covers getting a gun in, not a handgun.

So, here's the situation. I've not made a proper add-on before, so know little about .cpp files. But i've seen them and it looks pretty simple, like a description.ext kinda.

So if anyone whos made a handgun could tell me how they got it in i'd be the happiest guy alive (as long as its good news tounge.gif )

Thanks y'all!

wow.gif PEACE

Share this post


Link to post
Share on other sites

Ok, try another source:

decrypted configs of OFP:Resistance. Get 'em at a-lone-wolf's page. Copy the class-definition of one handgun -e.g. Glock- into your cpp and adjust it to your model/sounds/pics.

If you don't know how to write an add-on-config, refer to this tutorial page. snYpir's written a good tut.

Share this post


Link to post
Share on other sites

Here's the config for the M9 pistol I made:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">// M9 (Beretta M92S) by Major Fubar

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

#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 M9Pistol

{

units[] = {"OfficerM9"};

weapons[]={"M9base","M9pistol","M9mag"};

requiredVersion=1.750000;

};

};

class CfgModels

{

class default {};

class Weapon: default {};

class M9pistol: Weapon {};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: MGun {};

class HandGunBase: Riffle {};

class M9Base: HandGunBase

{

access=2;

scopeWeapon=0;

scopeMagazine=0;

aiRateOfFire=0.500000;

aiRateOfFireDistance=50

model="\M9pistol\Beretta92F.p3d";

modelOptics="\M9pistol\optika_Beretta92.p3d";

picture="\M9pistol\bereta.paa";

displayName="M9 (Beretta 92)";

displayNameMagazine="M9 Mag";

shortNameMagazine="M9";

count=15;

weaponType=2;

magazineType=32;

reloadTime=0.10000;

magazineReloadTime=2;

autoReload=0;

soundContinuous=0;

sound[]={"\M9pistol\fire.wav",1.000000,1};

drySound[]={"\M9pistol\dry.wav",0.003162,1};

magazines[]={"M9Mag"};

recoil="riffleSingle";

backgroundReload=0;

burst=1

multiplier=1

autoFire=0

initSpeed=420;

dispersion=0.002000;

ammo="Beretta";

};

class M9pistol: M9Base

{

picture="\M9pistol\bereta.paa";

scopeWeapon=2;

scopeMagazine=0;

};

class M9Mag: M9Base

{

scopeWeapon=0;

scopeMagazine=2;

picture="\M9pistol\zasobnik.paa";

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Land: AllVehicles {};

class Man: Land {};

class Soldier:Man{};

class SoldierWB:Soldier{};

class OfficerW:SoldierWB{};

class OfficerM9: OfficerW

{

displayName="Officer (M9 Pistol)";

weapons[]={"M16","M9pistol","Binocular","Throw","Put&qu

ot;,};

magazines[]={"M16","M16","M16","M16","M9mag","M

9mag","M9mag","M9mag","HandGrenade","HandGrenade&q

uot;,"HandGrenade","HandGrenade","SmokeShell","SmokeShe

ll"};

};<span id='postcolor'>

Share this post


Link to post
Share on other sites

Thanks Major, i couldn't get onto a-lone-wolf's page. Somethings up with my ISP. mad.gif

Never mind, Major Fubar's one'll do!

I'll keep in touch.

Oh, and whats this about needing to put the new models into your .p3d? Is it true? Will the "default.p3d" do? confused.gif

Thanks

wow.gif PEACE

Share this post


Link to post
Share on other sites

Thanks Major, it works!

small Q:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">weapons[]={"M16","M9pistol","Binocular","Throw","Put&qu

ot;,};<span id='postcolor'>

I presume that the forum code has put the ""," in?

It should be :

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">weapons[]={"M16","M9pistol","Binocular","Throw","Put"};

<span id='postcolor'>

Right?

Thanks

wow.gif PEACE

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  

×