SNIPER_SKULL 0 Posted December 10, 2003 i made a crate for my clan but i want to a G36 in it how do i the cpp i got class CfgPatches { class Crate { units[] = {Crate}; weapons[] = {}; requiredVersion = 1.0; }; }; class CfgVehicles { class All {}; class Static: All {}; class Building: Static {}; class NonStrategic: Building {}; class TargetTraining: NonStrategic {}; class TargetGrenade: TargetTraining {}; class Crate: TargetGrenade { model="\crate\crate"; armor=20000; scope=2; displayName="MiniMeNation"; } } Share this post Link to post Share on other sites
tracy_t 0 Posted December 11, 2003 Easy. Insert the following code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Crate: TargetGrenade { model="\crate\crate"; armor=20000; scope=2; displayName="MiniMeNation"; class EventHandlers { init = [_this] exec {\myaddon\populatecrate.sqs}; }; } Now you have added an initialisation event handler, which will populate your crate with weapons and ammo. Note the use of _this in the event handler declaration - NOT "this" as you would in the editor. in populatecrate.sqs, it's same script syntax that you'd use in ofp editor, e.g : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _crate = _this select 0 _crate addweaponcargo "G36a" _crate addmagazinecargo <whatever..> ... etc etc etc Share this post Link to post Share on other sites