Jump to content
Sign in to follow this  
ArmAriffic

choose how many rating points a kill gets you

Recommended Posts

is there a way choose how many rating points a kill gets you, right now it's like 200 and i wan't to make it 1 so it does not have that much effect on my currency system (don't get money by killing, get it by doing missions)

Share this post


Link to post
Share on other sites

add a killed eventhandler and "give" points for death.

For example, when dead, add 199 points again, then death will give -1 points total.

this addEventHandler ["killed", "_this select 0 addRating 199"]

edit: if its not rating replace addRating with addScore, wich i think is what youre after, anyway try them both if in doubt.

Edited by Demonized

Share this post


Link to post
Share on other sites

what i mean is every time you kill an ai you get 200 rating points, i want to change 200 to 1 or 0 because i'm using the rating system for a currency system and it will screw thing up

Share this post


Link to post
Share on other sites

lol sorrry, was noy quite awake, well place that eventhandler on any ai and replace _this select 0 with _this select 1, wich is the killler, meaning you and add a negative rating -199.

this addEventHandler ["killed", "_this select 1 addRating -199"];

Share this post


Link to post
Share on other sites

it works but is there a way to make all units have it without puting it in every single init line?

Share this post


Link to post
Share on other sites

west is in this case the player side... change it to whatever oyu need, can ofc be something else than side.

get inside spawning scripts of AI and add it there, or this at start of mission in trigger or init.sqf

{if ((side _x) != west) then {_x addEventHandler ["killed", "_this select 1 addRating -199"]}} foreach allUnits;

this will only work for the units that is there at mission start.

this will run throughout the entire mission including all new spawned units that is not on player side, in this case west, but can impact fps, not sure, change sleep 5 to more or less.

while {true} do {
{
	if (alive _x AND (side _x) != west AND (_x getVariable ["change_kill_score", false])) then {
		_x setVariable ["change_kill_score", true, true];
		_x addEventHandler ["killed", "_this select 1 addRating -199"];
	};
} foreach allUnits;
sleep 5;
};

all untested but should work.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×