Jump to content
Sign in to follow this  
silent_64

Cpp. help

Recommended Posts

Hi whats wrong with my .cpp? When i try to enter OFP it just throws me back out to the desktop.

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

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

{

units[] = {SoldierWBBfivesevenmarksman};

weapons[] = {fiveseven};

requiredVersion = 1.75;

};

};

class CfgModels

{

class Default {};

class Weapon: Default {};

class 57: Weapon {};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: Mgun {};

class HandGunBase: Riffle {};

class fivesevenBase: HandgunBase

{

model="\57\57.p3d";

modelOptics="\O\guns\optika_beretta92";

picture="\57\B92SD_gear.paa";

optics=1;

opticsZoommin=0.350000;

opticsZoomMax=0.350000;

distanceZoomMin=300;

distanceZoomMax=300;

displayName="FN Fiveseven";

displayNameMagazine="Fiveseven Mag";

shortNameMagazine="fivesevenmag";

count=15;

initspeed=800;

weaponType=2;

magazineType=32;

reloadTime=0.1;

reloadMagazineSound[]={"\57\reload.wav", db0, 1.0};

magazineReloadTime=1;

drySound[]={"\weapons\M16dry", db0, 1.0};

magazines[]={"fivesevenmag"};

modes[]={"Single"};

class Single

{

ammo="glocks";

multiplier=1;

burst=1;

displayName="FN Fiveseven";

dispersion=0.002000;

sound[]={"\57\sd.wav", db0, 1.0};

soundContinuous=0;

reloadTime=0.1;

ffCount=1;

recoil="riffleSilenced";

autoFire=0;

aiRateOfFire=0.500000;

aiRateOfFireDistance=50;

useAction=0;

useActionTitle="";

};

canDrop = true;

};

class fivesevenmag: fivesevenBase

{

scopeMagazine=2;

picture="\O\Guns\zasobnik.paa";

canDrop = true;

};

class Fiveseven: fivesevenBase

{

scopeWeapon=2;

magazines[]={"fivesevenmag"};

canDrop = true;

};

};

class CfgVehicles

{

class All{};

class AllVehicles: All{};

class Land: AllVehicles{};

class Man: Land{};

class Soldier: Man{};

class SoldierWB: Soldier{};

class SoldierWSniper: SoldierWB{};

class OfficerW: SoldierWSniper{};

class SoldierWBBfivesevenmarksman

{

displayName="Soldier (Fiveseven)";

vehicleClass="DAF - Weapons";

weapons[]={"M16","Fiveseven","Throw","Put"};

magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","fivesevenmag","fivesevenmag","fivesevenmag","fivesevenmag"};

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyHandGun: ProxyWeapon {};

class Proxyfiveseven: ProxyWeapon {};

};

<span id='postcolor'>

Share this post


Link to post
Share on other sites
Guest BratZ

A few things that I would change.Some of the names are very long.And your proxy 57.p3d (too short,lol) but doesnt match the proxy config on the bottom in your cfgnonaivehicles

I would need to know the names of what models you are using

Share this post


Link to post
Share on other sites

First off, when do you get your message, after starting up, or beginning of a mission?

Secondly does it show an error message and if so, what does it say?

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Jimboh @ 10 May 2003,07:44)</td></tr><tr><td id="QUOTE">First off, when do you get your message, after starting up, or beginning of a mission?

Secondly does it show an error message and if so, what does it say?<span id='postcolor'>

No error message, just throws me back to the desktop, it's just after i start up OFPR!

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">I would need to know the names of what models you are using <span id='postcolor'>

?? Huh, i've only got one model the 57.p3d!

Share this post


Link to post
Share on other sites

Okay new config.

Try to help this time!

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">// USP for privte use only NOT for public release

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

{

units[] = {SoldierWBUSP};

weapons[] = {DAF_USP};

requiredVersion = 1.75;

};

};

class CfgModels

{

class Default {};

class Weapon: Default {};

class USP: Weapon {};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: Mgun {};

class HandGunBase: Riffle {};

class USPBase: HandgunBase

{

model="\57\USP.p3d";

modelOptics="\O\guns\optika_beretta92";

picture="\57\TRP_gear.paa";

optics=1;

opticsZoommin=0.350000;

opticsZoomMax=0.350000;

distanceZoomMin=300;

distanceZoomMax=300;

displayName="USP";

displayNameMagazine="USP Mag";

shortNameMagazine="uspmag";

count=15;

initspeed=800;

weaponType=2;

magazineType=32;

reloadTime=0.1;

reloadMagazineSound[]={"\57\reload.wav", db0, 1.0};

magazineReloadTime=1;

drySound[]={"\weapons\M16dry", db0, 1.0};

magazines[]={"uspmag"};

modes[]={"Single"};

class Single

{

ammo="glocks";

multiplier=1;

burst=1;

displayName="USP";

dispersion=0.002000;

sound[]={"\57\single.wav", db0, 1.0};

soundContinuous=0;

reloadTime=0.1;

ffCount=1;

recoil="riffleSilenced";

autoFire=0;

aiRateOfFire=0.500000;

aiRateOfFireDistance=50;

useAction=0;

useActionTitle="";

};

canDrop = true;

};

class uspmag: USPBase

{

scopeMagazine=2;

picture="\O\Guns\zasobnik.paa";

canDrop = true;

};

class USP: USPBase

{

scopeWeapon=2;

magazines[]={"uspmag"};

canDrop = true;

};

class CfgVehicles

{

class All{};

class AllVehicles: All{};

class Land: AllVehicles{};

class Man: Land{};

class Soldier: Man{};

class SoldierWB: Soldier{};

class SoldierWSniper: SoldierWB{};

class OfficerW: SoldierWSniper{};

class DAF_SoldierWBUSP: SoldierWB

{

displayName="Soldier (USP)";

vehicleClass="DAF - Test Forces";

weapons[]={"M16","DAFUSP","Throw","Put"};

magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","uspmag","uspmag","uspmag","uspmag"};

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyHandGun: ProxyWeapon {};

class ProxyDAFUSP: ProxyWeapon {};

};<span id='postcolor'>

It doesn't show up in the edtior!

Share this post


Link to post
Share on other sites

I think your problem is in the Class names.Check those and you should see it.If you look hard enough.Like for example DAF_USP.

Share this post


Link to post
Share on other sites

Okay don't know if it was this you meant but I've renamed the class names so they all are the same. Still no luck!

Could realy use some help! confused.gif

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">// USP for privte use only NOT for public release

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

{

units[] = {SoldierWBUSP};

weapons[] = {DAF_USP};

requiredVersion = 1.75;

};

};

class CfgModels

{

class Default {};

class Weapon: Default {};

class DAF_USP: Weapon {};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class Riffle: Mgun {};

class HandGunBase: Riffle {};

class DAF_USPBase: HandgunBase

{

model="\USP\USP.p3d";

modelOptics="\O\guns\optika_beretta92";

picture="\USP\TRP_gear.paa";

optics=1;

opticsZoommin=0.350000;

opticsZoomMax=0.350000;

distanceZoomMin=300;

distanceZoomMax=300;

displayName="USP";

displayNameMagazine="USP Mag";

shortNameMagazine="uspmag";

count=15;

initspeed=800;

weaponType=2;

magazineType=32;

reloadTime=0.1;

reloadMagazineSound[]={"\USP\reload.wav", db0, 1.0};

magazineReloadTime=1;

drySound[]={"\weapons\M16dry", db0, 1.0};

magazines[]={"uspmag"};

modes[]={"Single"};

class Single

{

ammo="glocks";

multiplier=1;

burst=1;

displayName="USP";

dispersion=0.002000;

sound[]={"\57\single.wav", db0, 1.0};

soundContinuous=0;

reloadTime=0.1;

ffCount=1;

recoil="riffleSilenced";

autoFire=0;

aiRateOfFire=0.500000;

aiRateOfFireDistance=50;

useAction=0;

useActionTitle="";

};

canDrop = true;

};

class uspmag: DAF_USPBase

{

scopeMagazine=2;

picture="\O\Guns\zasobnik.paa";

canDrop = true;

};

class USP: DAF_USPBase

{

scopeWeapon=2;

magazines[]={"uspmag"};

canDrop = true;

};

class CfgVehicles

{

class All{};

class AllVehicles: All{};

class Land: AllVehicles{};

class Man: Land{};

class Soldier: Man{};

class SoldierWB: Soldier{};

class SoldierWSniper: SoldierWB{};

class OfficerW: SoldierWSniper{};

class DAF_SoldierWBUSP: SoldierWB

{

displayName="Soldier (USP)";

vehicleClass="DAF - Test Forces";

weapons[]={"M16","DAF_USP","Throw","Put"};

magazines[]={"M16","M16","M16","M16","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","HandGrenade","uspmag","uspmag","uspmag","uspmag"};

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyHandGun: ProxyWeapon {};

class ProxyDAF_USP: ProxyWeapon {};

};<span id='postcolor'>

Share this post


Link to post
Share on other sites
Guest BratZ

Wheres the cfgammo ?

Also again the cfgnonaivehicles doesnt match your weapon proxy

I dont make weapons (handgun?) but something like this:

class Proxyusp :ProxyWeapon

{

autocenter=false; // normal vehicle are autocentered

scope=public;

reversed=false;

model = "\USP\USP.p3d";

simulation=ProxyWeapon;

};

Share this post


Link to post
Share on other sites

This is my first pistol config, so don't have clue about what I'm doing if somebody know, then please make the changes that needs to be made. sad.gif

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  

×