Ok im using camoweapon.sqs script for my bipod on gun
but allways i recive the eror
error invalid number in exspression
ok my sqs
_unit = _this select 1;
_id = _this select 2;
? _id == M72B1legs : goto "M72B1l";
? _id == M72B1 : goto "M72";
hint "Error, no id!";
exit;
#M72B1l
_unit removeAction M72B1legs;
_unit playmove "CombatReloadMagazine";
~1
_unit removeWeapon "M72B1";
_unit removeWeapon "revolvermag";
_unit AddWeapon "M72B1legs";
_unit AddWeapon "revolvermag";
M72B1 = _unit addAction ["Zlozi","\m72b1\Scripts\Nogice.sqs"];
exit;
#M72
_unit removeAction M72B1;
_unit playmove "CombatReloadMagazine";
~1
_unit removeWeapon "M72B1legs";
_unit removeWeapon "revolvermag";
_unit AddWeapon "M72B1";
_unit AddWeapon "revolvermag";
M72B1legs = _unit addAction ["Odpri","\m72b1\Scripts\Nogice.sqs"];
exit;
and cpp
// M72B1 -------P3D----- McHide [SV]
// poizkusni cpp
// some basic defines
#define TEast 1
#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 M72B1
{
units[] = {};
weapons[] = {M72B1,M72B1legs};
requiredVersion = 1.75;
requiredAddons[]={"BIS_Resistance","BIS_WeaponPack"};
};
};
class CfgModels
{
class Default{};
class Weapon: Default{};
class M72B1: Weapon{};
class M72B1legs: Weapon{};
};
class CfgWeapons
{
class Default {};
class MGun: Default {};
class Riffle: MGun {};
class M72B1: Riffle
{
displayName = M72B1;
displayNameMagazine="M72 Magazine";
shortNameMagazine="M72 Magazine";
scopeWeapon = public;
scopeMagazine = public;
model="\M72B1\M72B1.p3d";
modelOptics="";
picture="\dtaext\equip\w\w_ak47.paa"
optics = true;
opticsZoomMin=0;
opticsZoomMax=0;
modes[]={"Single","FullAuto"};
class Single
{
ammo="MCH_m70";
multiplier=1;
burst=1;
displayName="M72B1 Semi";
dispersion=0.00350;
sound[]={"Weapons\AK74Single",1.000000,1};
soundContinuous=0;
reloadTime=0.150000;
ffCount=1;
recoil="M72B1single";
autoFire=0;
aiRateOfFire=05;
aiRateOfFireDistance=800;
useAction=0;
useActionTitle="";
};
class FullAuto
{
ammo="MCH_m70";
multiplier=1;
burst=1;
displayName="M72B1 Auto";
tracerColor[]={0.800000,0.800000,0.600000,0.50000};
tracerColorR[]={0.800000,0.800000,0.600000,0.50000};
dispersion=0.00950;
sound[]={"Weapons\AK74Full",1.000000,1};
soundContinuous=1;
reloadTime=0.100000;
ffCount=30;
recoil="M72B1auto";
autoFire=30;
aiRateOfFire=0.25;
aiRateOfFireDistance=500;
useAction=0;
useActionTitle="";
};
class M72B1legs: Riffle
{
displayName = M72B1legs;
displayNameMagazine="M72 Magazine";
shortNameMagazine="M72 Magazine";
scopeWeapon = public;
scopeMagazine = public;
model="\M72B1\M72B1.p3d";
modelOptics="";
picture="\dtaext\equip\w\w_ak47.paa"
optics = true;
opticsZoomMin=0;
opticsZoomMax=0;
modes[]={"Single","FullAuto"};
class Single
{
ammo="MCH_m70";
multiplier=1;
burst=1;
displayName="M72B1n Semi";
dispersion=0.00350;
sound[]={"Weapons\AK74Single",1.000000,1};
soundContinuous=0;
reloadTime=0.150000;
ffCount=1;
recoil="M72B1single";
autoFire=0;
aiRateOfFire=05;
aiRateOfFireDistance=800;
useAction=0;
useActionTitle="";
};
class FullAuto
{
ammo="MCH_m70";
multiplier=1;
burst=1;
displayName="M72B1n Auto";
tracerColor[]={0.800000,0.800000,0.600000,0.50000};
tracerColorR[]={0.800000,0.800000,0.600000,0.50000};
dispersion=0.00950;
sound[]={"Weapons\AK74Full",1.000000,1};
soundContinuous=1;
reloadTime=0.100000;
ffCount=30;
recoil="M72B1auto";
autoFire=30;
aiRateOfFire=0.25;
aiRateOfFireDistance=500;
useAction=0;
useActionTitle="";
};
};
};
};
class CfgVehicles
{
class All{};
class AllVehicles:All{};
class Land:AllVehicles{};
class Man:Land{};
class Soldier:Man{};
class SoldierGB:Soldier{};
class M72B1Soldier:SoldierGB
{
picture="ismg";
vehicleClass="Men";
scope=2;
cost=60000;
accuracy=5.000000;
displayName="MCH_M72B1 gunner";
weaponSlots="1 + 16 + 10* 256 + 2* 4096 + 2 + 4* 32";
weapons[]={M72B1,Binocular,Throw,Put,revolver};
magazines[]={"M72B1","M72B1","M72B1","M72B1","M72B1","revolvermag","revolvermag","revolvermag","revolvermag"};
threat[]={1,1,1,1};
class EventHandlers
{
init = "M72B1legs = (_this select 0) addAction [""Odpri"",""\m72b1\Scripts\Nogice.sqs""]";
};
};
};
class CfgRecoils
{
M72B1single[]=
{
0.020,-0.065,0.030,
0.060,-0.030,0.010,
0.000,0.000,0.000
};
M72B1auto[]=
{
0.020,-0.065,0.030,
0.060,-0.030,0.010,
0.000,0.000,0.000
};
};
class CfgNonAIVehicles
{
class ProxyWeapon {};
class ProxyM72B1: ProxyWeapon {};
class ProxyM72B1legs: ProxyWeapon {};
};
please help me , in inquisitors M24 is working this ....