nedley 10 Posted March 7, 2013 Similar to a few threats here; we're struggling to find the correct way to edit loadouts. Specifically, i'd like to know how to add/remove the optics. Things suggested and tried (example used is the opfor marksman with ARCO optics on his weapon) this unassignitem "optic_Arco"; this removeweapon (or removeitem) "optic_Arco" Any suggestions? Share this post Link to post Share on other sites
riouken 15 Posted March 7, 2013 https://community.bistudio.com/wiki/addPrimaryWeaponItem https://community.bistudio.com/wiki/removeItemFromPrimaryWeapon https://community.bistudio.com/wiki/addSecondaryWeaponItem player addPrimaryWeaponItem _optic; Share this post Link to post Share on other sites
nedley 10 Posted March 7, 2013 Thanks! How would I find these things myself so I don't look like a lemon again in future. Share this post Link to post Share on other sites
jsmuk 13 Posted March 7, 2013 Thanks! How would I find these things myself so I don't look like a lemon again in future. Checking this list first might be a good idea. Some of the commands aren't explained very well but you should be able to get the gist of what they do from their name. Share this post Link to post Share on other sites
nedley 10 Posted March 7, 2013 Excellent. Thank you. So, it works (yey) however the weapon resets upon death, so a respawn does not allow it to work; I realise I will have to use scripts and event handlers to re-equip each player after death, but I have little idea how to do this. My efforts so far: INIT.SQF _index = player addMPEventHandler ["mpkilled", {Null = _this execVM "LOADOUT.sqf";}]; LOADOUT.SQF: _unit = _this select 0; if (!local _unit) exitWith {}; this removeItemFromPrimaryWeapon "optic_Arco"; this removeItemFromPrimaryWeapon "optic_Aco"; this removeItemFromPrimaryWeapon "optic_Hamr"; this removeItemFromPrimaryWeapon "optic_holosight"; this addprimaryweaponitem "optic_Aco_grn"; Clearly i'm doing something wrong, and this IS my first attempt. Any help would be appreciated. Share this post Link to post Share on other sites
riouken 15 Posted March 7, 2013 your do not have the correct scope to use the magic variable "this". Use player instead. _unit = _this select 0; if (!local _unit) exitWith {}; player removeItemFromPrimaryWeapon "optic_Arco"; player removeItemFromPrimaryWeapon "optic_Aco"; player removeItemFromPrimaryWeapon "optic_Hamr"; player removeItemFromPrimaryWeapon "optic_holosight"; player addprimaryweaponitem "optic_Aco_grn"; Share this post Link to post Share on other sites
nedley 10 Posted March 7, 2013 (edited) Of course! Still no joy though. Do I need something in the init line of each player? Or should the Init.sqf file do the business for me? Still stuck on this if anyone wants to offer a helping hand? Edited March 7, 2013 by nedley Share this post Link to post Share on other sites
nedley 10 Posted March 7, 2013 Still no joy with this. I don't have the technical expertise with scripting or php to tell if this is an issue with my script or something else. Share this post Link to post Share on other sites
Tuliq 2 Posted March 7, 2013 hey nedley! Have you tried changing the eventhandler to mpRespawn instead? this should trigger your script when the player respawns, as opposed to when he is killed. Share this post Link to post Share on other sites
nedley 10 Posted March 7, 2013 Your the man Tuliq! _index = player addMPEventHandler ["mprespawn", {Null = _this execVM "loadout.sqf";}]; Works a treat! Share this post Link to post Share on other sites