Jump to content
Sign in to follow this  

Recommended Posts

So heres the deal, I am currently having issues with someone killing another, and it is friendly fire, now, is there a way to to bypass this by adding 2 points when you get a kill by addScore in a repeating trigger or script?

Ive tried playing around with with some addEventHandlers such as

player addEventHandler ["killed", {_this exec "addons\karpcode\scoringSystem\killed.sqf"}];

with killed.sqf being:

?!(count _this == 2):exit
_victim = _this select 0
_shooter = _this select 1

?(_victim == _shooter): exit
?(side _victim == side _shooter): _shooter addScore 2
exit

I think I am over thinking this and it should be easier than I am making it. Cant I just place a trigger, that runs an eventhandler that everytime you shoot someone, it gives you 2"said" amount of points?

Any help would be appreciated.

---------- Post added at 06:08 ---------- Previous post was at 05:40 ----------

well couldnt it get it working, but thought of another idea.

RESISTANCE setFriend [RESISTANCE, 0];

Share this post


Link to post
Share on other sites

Can some one fix this code then please. I like this to see it work. Greets Mike

Share this post


Link to post
Share on other sites

try this...

playerdeath = {
                    _victim = _this select 0;
                    _killer = _this select 1;
                    if(_victim == _killer ) exitwith {hint "killed yourself"};
                    if(side _victim == side _killer) then { _killer addScore 2;};
                    };

player addEventHandler ["Killed",{[_this select 0, _this select 1] spawn playerdeath;}];

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  

×