ZNorQ 0 Posted September 5, 2007 I'm creating a MP game, and I want a special function for my player only that counts how many enemies that are left. Everything from counting the enemies that are left, and that only I get the action works perfectly. What annoys me though, is that once I step into a vehicle, that action disappears.. So the question is, how do I make the addAction work on foot and in vehicles? This is the addaction code I've used; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (name player == "znorq") then {player addAction ["Enemies left?", "res\bat\gen\enemiesLeft.sqf", "", -999, false, true, "teamSwitch"];}; This is the alternative code I've testet, with no success (Added 'vehicle'; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (name player == "znorq") then {vehicle player addAction ["Enemies left?", "res\bat\gen\enemiesLeft.sqf", "", -999, false, true, "teamSwitch"];}; ZNorQ Share this post Link to post Share on other sites
HulkingUnicorn 0 Posted September 6, 2007 Was the unit inside the vehicle when you tried that last line? You could use a trigger or script to add the action to the vehicle when your unit entered the vehicle, and remove it when exiting. You could also use getIn and GetOut eventHandlers. Share this post Link to post Share on other sites
ricki 0 Posted September 6, 2007 hi for some reason the addAction you add to a soldier wont remain if he enters a vehicle. you also can't add an action to a soldier that is already in a vehicle. only works outside. like HulkingUnicorn said, you could try to add the action to the vehicle/player by an eventhandler. but when added to vehicle the action you should do a check for your machine, otherwise otherplayers can see the action too. Share this post Link to post Share on other sites
ZNorQ 0 Posted September 6, 2007 Yeah, using a 'GetIn' / 'GetOut' eventhandler sounds like a good idea, if this is just the way it is.. Can't understand why it should disappear just because I'm entering a vehicle. Anyone know if this is by intention, or is it a possible bug? Thanks, guys. ZNorQ Share this post Link to post Share on other sites
UNN 0 Posted September 6, 2007 Quote[/b] ]Can't understand why it should disappear just because I'm entering a vehicle. Anyone know if this is by intention, or is it a possible bug? I think this is intended, it worked the same way in OFP. I doesn’t disappear, your moved to a cargo proxy object. Your character remains at the location you entered the vehicle, until you get out. In OFP it was possible find the initial user action, floating in mid air. Share this post Link to post Share on other sites