PDA

View Full Version : Getting my handgun in game



GAMEER_77
Oct 16 2002, 08:27
Yoo-hoo! http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/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 http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/tounge.gif )

Thanks y'all!

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE

der bastler
Oct 16 2002, 10:12
Ok, try another source:
decrypted configs of OFP:Resistance. Get 'em at a-lone-wolf's page (http://web.quick.cz/fholesinsky/OF/index.html). 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 (http://www.ofpec.com/editors/browse.php?browsewhat=0&category=0_6). snYpir's written a good tut.

GAMEER_77
Oct 16 2002, 10:23
Thanks der bastler, checking that out right now! http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/smile.gif

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/tounge.gif PEACE

Major Fubar
Oct 16 2002, 10:37
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="&#92;M9pistol&#92;Beretta92F.p3d";
modelOptics="&#92;M9pistol&#92;optika_Beretta92.p3d";
picture="&#92;M9pistol&#92;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[]={"&#92;M9pistol&#92;fire.wav",1.000000,1};
drySound[]={"&#92;M9pistol&#92;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="&#92;M9pistol&#92;bereta.paa";
scopeWeapon=2;
scopeMagazine=0;
};

class M9Mag: M9Base
{
scopeWeapon=0;
scopeMagazine=2;
picture="&#92;M9pistol&#92;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"};
};[/QUOTE]<span id='postcolor'>

GAMEER_77
Oct 16 2002, 13:56
Thanks Major, i couldn&#39;t get onto a-lone-wolf&#39;s page. Somethings up with my ISP. http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/mad.gif

Never mind, Major Fubar&#39;s one&#39;ll do&#33;

I&#39;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? http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/confused.gif

Thanks

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE

GAMEER_77
Oct 16 2002, 14:28
Thanks Major, it works&#33;

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&#91;&#93;={&#34;M16&#34;,&#34;M9pistol&#34;,&#34;Binocular&#34;,&#34;Throw&#34;,&#34;Put&qu
ot;,};[/QUOTE]<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&#91;&#93;={&#34;M16&#34;,&#34;M9pistol&#34;,&#34;Binocular&#34;,&#34;Throw&#34;,&#34;Put&#34;};
[/QUOTE]<span id='postcolor'>

Right?

Thanks

http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/wow.gif PEACE

Major Fubar
Oct 16 2002, 15:02
Yep, that&#39;s what it&#39;s meant to be...not sure how it got corrupted. http://www.flashpoint1985.com/ikonboard301/iB_html/non-cgi/emoticons/tounge.gif