Nutzgo 15 Posted September 27, 2018 I've created a custom endgame-mission. On it I have custom selectable loadouts. I use Ace3. I have both selectable medic and engineer class. Problem is, when they respawn they aren't defined as medic or engineer by ace anymore. Is it possible to link a setvariable in to a specific item (e.g. If a player has the toolkit, he get ace engineer asset) or uniform/vest (e.g. If the medic class has a unique vest, the vest 'trigger' activation of the ace medic asset). How do I fix this? Share this post Link to post Share on other sites
Mr H. 402 Posted September 27, 2018 player addEventhandler ["Respawn",{ if( vest player == "classNameOfYourVest") then {player setVariable ["ace_medical_medicclass", 2, true];}; if( "ToolKit" in items player) then {player setVariable ["ACE_IsEngineer",2,true];}; }]; put this in your initplayerlocal.sqf. Replace "classNameOfYourVest" by the desired classname 2 1 Share this post Link to post Share on other sites
Mr H. 402 Posted September 27, 2018 btw: in player setVariable ["ace_medical_medicclass", 2, true]; The 2 means doctor, replace by 1 if you want them to only be simple medic, same goes for engineers, 1 means mechanic (or whatever they are called I don't remember) 2 means advanced engineer. Set to 0 To reset for both. 1 Share this post Link to post Share on other sites
Nutzgo 15 Posted September 27, 2018 Thanks! I'll try it out :) Share this post Link to post Share on other sites
Nutzgo 15 Posted September 27, 2018 So I tried this. Quote player addEventhandler ["Respawn",{ if( vest player == "n_m07_w_corpsman") then {player setVariable ["ace_medical_medicclass", 1, true];}; if( "ToolKit" in items player) then {player setVariable ["ACE_IsEngineer",1,true];}; }]; Now, it worked, and it didn't work. Medic is not medic. But! Engineer is now medic, but not engineer. Share this post Link to post Share on other sites
Nutzgo 15 Posted September 27, 2018 OK, so, I've changed it a bit now. I put this in "onPlayerRespawn.sqf" Quote _items = items player; if ("ToolKit" in _items) then {player setVariable ["ACE_IsEngineer",1,true]; }; if (vest player == "n_m07_w_corpsman") then {player setVariable ["ace_medical_medicclass", 1, true]; }; Now it works; if you have the ToolKit you are Engineer, if you have the specified vest, you are medic. New problem is: When I change class (e.g. you choose medic, then die - and want to have another class, e.g. machine gunner) you still are medic. Share this post Link to post Share on other sites
Nutzgo 15 Posted September 27, 2018 You know what, I fixed it after all. I defined the other vests in the team to setVariable ace medical class 0: Quote _items = items player; if ("ToolKit" in _items) then {player setVariable ["ACE_IsEngineer",1,true]; }; if (vest player == "n_m07_w_corpsman") then {player setVariable ["ace_medical_medicclass", 1, true]; }; if (vest player == "n_m07_w_mg") then {player setVariable ["ace_medical_medicclass", 0, true]; }; if (vest player == "n_m07_w_rifleman") then {player setVariable ["ace_medical_medicclass", 0, true]; }; if (vest player == "n_m07_w_squadleader") then {player setVariable ["ace_medical_medicclass", 0, true]; }; Thanks anyways :) Share this post Link to post Share on other sites
Mr H. 402 Posted September 27, 2018 You could just have added an else scope. There was no need to list all the other vests. Also this is is strange because that first line of code I posted should have worked. Putting it in on player respawn file does the same as the event handler. 1 1 Share this post Link to post Share on other sites