-radkeff- 0 Posted May 26, 2003 I want a script to be executed when picking up/using a weapon..heres the code, check the last rows:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class Bizon { units[]={"SoldierESaboteurBizon"}; weapons[]={"Bizon"}; requiredVersion=1.260000; }; }; class CfgAmmo { class default {}; class BulletSingle: default {}; class BulletSilencedSingle: BulletSingle {}; class Bizon: BulletSilencedSingle { hit=7 indirectHit=1 indirectHitRange=0.100000; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class Riffle: MGun {}; class BizonBase: Riffle { scopeWeapon=1 scopeMagazine=1 model="\Bizon\Bizon"; modelOptics="\Bizon\optika_Bizon"; picture="\bizon\w_bizon.paa"; count=64 optics=1 opticsZoomMin=0.350000; opticsZoomMax=0.350000; distanceZoomMin=300 distanceZoomMax=300 displayName="$STR_DN_ADD_BIZON"; displayNameMagazine="$STR_DN_ADD_BIZON_MAG"; shortNameMagazine="$STR_DN_ADD_BIZON"; drySound[]={"weapons\M16dry",0.003162,1}; modes[]={"Single","Fullauto"}; class Single { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON"; dispersion=0.010000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.100000; ffCount=1 recoil="riffleSilenced"; autoFire=0 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; class FullAuto { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON_AUTO"; dispersion=0.015000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.070000; ffCount=1 recoil="riffleSilenced"; autoFire=1 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; }; class BizonMag: BizonBase { scopeMagazine=2 picture="\Bizon\m_bizon.paa"; }; class Bizon: BizonBase { scopeWeapon=2 magazines[]={"BizonMag"}; }; }; class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class Man: Land {}; class Soldier: Man {}; class SoldierEB: Soldier {}; class SoldierESaboteur: SoldierEB {}; class SoldierESaboteurPipe: SoldierESaboteur {}; class SoldierESaboteurBizon: SoldierESaboteurPipe { displayName="$STR_DN_ADD_BIZON_SOLDIER"; weapons[]={"Bizon","NVGoggles","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag","PipeBomb","PipeBomb","PipeBomb"}; }; }; class CfgNonAIVehicles { class ProxyWeapon {}; class ProxyBizon: ProxyWeapon {}; }; class EventHandlers { init = [this] exec "\bizon\cp.sqs"; }; }; Now im sure this is something very basic..whats wrong ?? Share this post Link to post Share on other sites
bn880 5 Posted May 26, 2003 Should be class EventHandlers { init = "[this] exec ""\bizon\cp.sqs"";"; }; Share this post Link to post Share on other sites
-radkeff- 0 Posted May 26, 2003 hmm...it didnt work...the strange thing is that i dont get a single error msg !...any more ideas ? Share this post Link to post Share on other sites
bn880 5 Posted May 26, 2003 Well, have you tried doing a hint out in the cp.sqs? I'll bet it simply does not get triggered when you think. You may wish to use a fired EH or some other? You can even do a hint directly from the EH line, not even the script. Share this post Link to post Share on other sites
Guest BratZ Posted May 26, 2003 I want a script to be executed when picking up/using a weapon..heres the code, check the last rows:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches{ class Bizon { units[]={"SoldierESaboteurBizon"}; weapons[]={"Bizon"}; requiredVersion=1.260000; }; }; class CfgAmmo { class default {}; class BulletSingle: default {}; class BulletSilencedSingle: BulletSingle {}; class Bizon: BulletSilencedSingle { hit=7 indirectHit=1 indirectHitRange=0.100000; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class Riffle: MGun {}; class BizonBase: Riffle { scopeWeapon=1 scopeMagazine=1 model="\Bizon\Bizon"; modelOptics="\Bizon\optika_Bizon"; picture="\bizon\w_bizon.paa"; count=64 optics=1 opticsZoomMin=0.350000; opticsZoomMax=0.350000; distanceZoomMin=300 distanceZoomMax=300 displayName="$STR_DN_ADD_BIZON"; displayNameMagazine="$STR_DN_ADD_BIZON_MAG"; shortNameMagazine="$STR_DN_ADD_BIZON"; drySound[]={"weapons\M16dry",0.003162,1}; modes[]={"Single","Fullauto"}; class Single { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON"; dispersion=0.010000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.100000; ffCount=1 recoil="riffleSilenced"; autoFire=0 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; class FullAuto { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON_AUTO"; dispersion=0.015000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.070000; ffCount=1 recoil="riffleSilenced"; autoFire=1 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; }; class BizonMag: BizonBase { scopeMagazine=2 picture="\Bizon\m_bizon.paa"; }; class Bizon: BizonBase { scopeWeapon=2 magazines[]={"BizonMag"}; }; }; class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class Man: Land {}; class Soldier: Man {}; class SoldierEB: Soldier {}; class SoldierESaboteur: SoldierEB {}; class SoldierESaboteurPipe: SoldierESaboteur {}; class SoldierESaboteurBizon: SoldierESaboteurPipe { displayName="$STR_DN_ADD_BIZON_SOLDIER"; weapons[]={"Bizon","NVGoggles","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag","PipeBomb","PipeBomb","PipeBomb"}; }; class EventHandlers { init = [this] exec "\bizon\cp.sqs"; }; }; class CfgNonAIVehicles { class ProxyWeapon {}; class ProxyBizon: ProxyWeapon {}; }; }; Now im sure this is something very basic..whats wrong ?? eventhandlers is a derivative of cfgvehicles put it in your cfgvehicle class ie: can have seperate eventhandlers for each vehicle class you configure Share this post Link to post Share on other sites
-radkeff- 0 Posted May 26, 2003 Quote[/b] ]Well, have you tried doing a hint out in the cp.sqs? unfortunately i thought of that too...cp.sqs is:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#loop hint "hora" ~1 goto "loop" i guess i could try with another eh.... Share this post Link to post Share on other sites
-radkeff- 0 Posted May 26, 2003 I want a script to be executed when picking up/using a weapon..heres the code, check the last rows:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches{ class Bizon { units[]={"SoldierESaboteurBizon"}; weapons[]={"Bizon"}; requiredVersion=1.260000; }; }; class CfgAmmo { class default {}; class BulletSingle: default {}; class BulletSilencedSingle: BulletSingle {}; class Bizon: BulletSilencedSingle { hit=7 indirectHit=1 indirectHitRange=0.100000; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class Riffle: MGun {}; class BizonBase: Riffle { scopeWeapon=1 scopeMagazine=1 model="\Bizon\Bizon"; modelOptics="\Bizon\optika_Bizon"; picture="\bizon\w_bizon.paa"; count=64 optics=1 opticsZoomMin=0.350000; opticsZoomMax=0.350000; distanceZoomMin=300 distanceZoomMax=300 displayName="$STR_DN_ADD_BIZON"; displayNameMagazine="$STR_DN_ADD_BIZON_MAG"; shortNameMagazine="$STR_DN_ADD_BIZON"; drySound[]={"weapons\M16dry",0.003162,1}; modes[]={"Single","Fullauto"}; class Single { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON"; dispersion=0.010000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.100000; ffCount=1 recoil="riffleSilenced"; autoFire=0 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; class FullAuto { ammo="Bizon"; multiplier=1 burst=1 displayName="$STR_DN_ADD_BIZON_AUTO"; dispersion=0.015000; sound[]={"\Bizon\bizon",0.000316,1}; soundContinuous=0 reloadTime=0.070000; ffCount=1 recoil="riffleSilenced"; autoFire=1 aiRateOfFire=0.500000; aiRateOfFireDistance=500 useAction=0 useActionTitle=""; }; }; class BizonMag: BizonBase { scopeMagazine=2 picture="\Bizon\m_bizon.paa"; }; class Bizon: BizonBase { scopeWeapon=2 magazines[]={"BizonMag"}; }; }; class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class Man: Land {}; class Soldier: Man {}; class SoldierEB: Soldier {}; class SoldierESaboteur: SoldierEB {}; class SoldierESaboteurPipe: SoldierESaboteur {}; class SoldierESaboteurBizon: SoldierESaboteurPipe { displayName="$STR_DN_ADD_BIZON_SOLDIER"; weapons[]={"Bizon","NVGoggles","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag","PipeBomb","PipeBomb","PipeBomb"}; }; class EventHandlers { init = [this] exec "\bizon\cp.sqs"; }; }; class CfgNonAIVehicles { class ProxyWeapon {}; class ProxyBizon: ProxyWeapon {}; }; }; Now im sure this is something very basic..whats wrong ?? eventhandlers is a derivative of cfgvehicles put it in your cfgvehicle class ie: can have seperate eventhandlers for each vehicle class you configure when i try this code ofp kicks me into desktop without a error msg...c'mon guys..*sniff*..im getting depressed here Share this post Link to post Share on other sites
Guest BratZ Posted May 26, 2003 Try it with this { removed.Like I said it needs to be within your cfgvehicles class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class Man: Land {}; class Soldier: Man {}; class SoldierEB: Soldier {}; class SoldierESaboteur: SoldierEB {}; class SoldierESaboteurPipe: SoldierESaboteur {}; class SoldierESaboteurBizon: SoldierESaboteurPipe { displayName="$STR_DN_ADD_BIZON_SOLDIER"; weapons[]={"Bizon","NVGoggles","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag"," ;PipeBomb","PipeBomb","PipeBomb"}; }; <----------------------------- remove this class EventHandlers { init = [this] exec "\bizon\cp.sqs"; }; If your still getting errors ,its a matter of too many }; here and there I think. I would go thru and check your brackets Share this post Link to post Share on other sites
-radkeff- 0 Posted May 27, 2003 Oh joy and glory...i finally got it to work, thanks for the help bratz  now if anyone is interested it was by removing these brackets:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles { class All {}; class AllVehicles: All {}; class Land: AllVehicles {}; class Man: Land {}; class Soldier: Man {}; class SoldierEB: Soldier {}; class SoldierESaboteur: SoldierEB {}; class SoldierESaboteurPipe: SoldierESaboteur {}; class SoldierESaboteurBizon: SoldierESaboteurPipe { displayName="$STR_DN_ADD_BIZON_SOLDIER"; weapons[]={"Bizon","NVGoggles","Throw","Put"}; magazines[]={"BizonMag","BizonMag","BizonMag","BizonMag","PipeBomb","PipeBomb","PipeBomb"}; };  <----------------------------this class EventHandlers { init = [this] exec "\bizon\cp.sqs"; };<----------------------------this }; class CfgNonAIVehicles { class ProxyWeapon {}; class ProxyBizon: ProxyWeapon {}; }; }; Share this post Link to post Share on other sites
Guest BratZ Posted May 29, 2003 NP glad to be of help, anything to help OFP addons. Share this post Link to post Share on other sites
bn880 5 Posted May 29, 2003 Ah, hehhe no kidding, if you want to add an event handler to a class, add it to the class. Share this post Link to post Share on other sites