fathersarge 46 Posted June 6, 2017 The problem: You and your buddies are under fire from the advancing enemy. You don't have time to repair your truck which is missing 2 wheels and isn't drivable. You blow it up to prevent the enemy from fixing it and using it against you. Well crap, now the game has labeled you as some kind of traitor and now no one can get in another vehicle that you are inside. This feature or bug (honestly not sure which it is) has always confused me in this game. In ACE3 there is an option to pardon someone of such offenses. My question is... is there a way to either automatically pardon people via a script that runs every time something like this happens or is there a way to disable it from happening altogether? Really could use some help on this one. 1 Share this post Link to post Share on other sites
pierremgi 4890 Posted June 6, 2017 Known problem as a bad choice for empty vehicle. Simplest way: player addRating 1000000; 1 Share this post Link to post Share on other sites
Crazy538 14 Posted June 6, 2017 // Rating handling: Stops the player being shot by friendly AI. player addEventHandler [ "HandleRating", { params["_player"]; if (rating _player < 0) then { player addRating abs rating _player; }; } ]; That's a quick and easy event handler that will always bounce the players rating back to 0 if they're below 0. 1 Share this post Link to post Share on other sites
pierremgi 4890 Posted June 6, 2017 Or just make no rating change for empty vehicle only: in init.sqf, you need to add a server condition if (isServer) then { code }; or simpler in initServer.sqf: addMissionEventHandler ["entityKilled",{ params ["_killed", "_killer", "_instigator","_rating"]; if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; if (isNull _instigator) then {_instigator = _killer}; if (isPlayer _instigator && count (crew _killed) ==0) then { _rating = rating _instigator; [_instigator,_rating] spawn { params ["_instigator","_rating"]; waitUntil {rating _instigator != _rating}; _instigator addRating (_rating - rating _instigator) } } }]; 3 Share this post Link to post Share on other sites
fathersarge 46 Posted June 6, 2017 So where would this go? initPlayerLocal? 8 hours ago, crazy538 said: // Rating handling: Stops the player being shot by friendly AI. player addEventHandler [ "HandleRating", { params["_player"]; if (rating _player < 0) then { player addRating abs rating _player; }; } ]; That's a quick and easy event handler that will always bounce the players rating back to 0 if they're below 0. Where would that go? 55 minutes ago, pierremgi said: Or just make no rating change for empty vehicle only: addMissionEventHandler ["entityKilled",{ params ["_killed", "_killer", "_instigator","_rating"]; if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; if (isNull _instigator) then {_instigator = _killer}; if (isPlayer _instigator && count (crew _killed) ==0) then { _rating = rating _instigator; [_instigator,_rating] spawn { params ["_instigator","_rating"]; waitUntil {rating _instigator != _rating}; _instigator addRating (_rating - rating _instigator) } } }]; Share this post Link to post Share on other sites
Crazy538 14 Posted June 6, 2017 (edited) 2 minutes ago, fathersarge said: So where would this go? initPlayerLocal? The first in initPlayerLocal, the other one in initServer I think... Realised mine might not catch all conditions so I've made it a bit more intelligent. It's still really light weight being an EH. // Rating handling: Stops the player being shot by friendly AI. _player addEventHandler [ "HandleRating", { params["_player", "_rating"]; _return = _rating; if(rating _player < 0) then { _return = abs rating _player; } else { if(_rating + rating _player < 0) then { _return = 0; }; }; _return } ]; This one adds the difference between 0 and rating if the rating is below 0 already. If it's not, it checks to see if the current rating plus the new rating to add will be below zero. If it is then it won't change the rating. If neither of those two occurs the rating is added as normal. Sent from my LG-H870 using Tapatalk Edited June 6, 2017 by crazy538 Added new code 1 Share this post Link to post Share on other sites
fathersarge 46 Posted June 6, 2017 Awesome. I'll def be testing these this week! @crazy538 Actually after looking at that, should it be _player addEventHandler or player addEventHandler? I also found this player addEventHandler ["HandleRating", {0}]; Would that work any different? Share this post Link to post Share on other sites
Crazy538 14 Posted June 7, 2017 Sorry yes, player not _player. I copied it from a framework of mine and for some reason I chose to use _player (it's passed as an argument to the initPlayerLocal.sqf). Share this post Link to post Share on other sites