AdirB 18 Posted July 3, 2017 Hello, I'm trying to make a system that adds 1 kill point to a player. I do that because the ACE3 medical system messes with arma 3's score system. So what I try to do is run a loop which detects when a player has killed an east side unit and when he did, he will get 1 infantry kill point. Is there a way to do that? Share this post Link to post Share on other sites
Grumpy Old Man 3547 Posted July 3, 2017 Something like this: addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (isPlayer _instigator AND side group _killed isEqualTo east) then { //your stuff here }; }]; Cheers Share this post Link to post Share on other sites
AdirB 18 Posted July 3, 2017 5 hours ago, Grumpy Old Man said: Something like this: addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (isPlayer _instigator AND side group _killed isEqualTo east) then { //your stuff here }; }]; Cheers Thanks for your response! That's what I did: addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (isPlayer _instigator AND side group _killed isEqualTo east) then { _instigator addPlayerScores [(getPlayerScores _instigator select 0)+1, getPlayerScores _instigator select 1, getPlayerScores _instigator select 2, getPlayerScores _instigator select 3, getPlayerScores _instigator select 4]; _instigator_kills = getPlayerScores _instigator; hint format["%1",_instigator_kills]; }; }]; But it didn't work at all, it didn't do anything. And then I found that instead of getting 1 point I'm getting a multiplied score. PE_PL addPlayerScores [(getPlayerScores PE_PL select 0)+1, getPlayerScores PE_PL select 1, getPlayerScores PE_PL select 2, getPlayerScores PE_PL select 3, getPlayerScores PE_PL select 4]; _pe_pl_kills = getPlayerScores PE_PL select 0; hint format["%1",_pe_pl_kills]; Share this post Link to post Share on other sites
AdirB 18 Posted July 4, 2017 Anyone who can help me please? Share this post Link to post Share on other sites
Grenadier-Ghost 1 Posted November 24, 2017 time has passed but ace3 continues to block the EntityKilled command. when they think of solving these problems? 1 Share this post Link to post Share on other sites
HazJ 1289 Posted November 27, 2017 How does it mess up the score? I don't use ACE3 so could you explain? I assume it gives a negative score or something? Maybe you could use HandleScore EH instead? It depends on what the issue is though... https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleScore Share this post Link to post Share on other sites
pierremgi 4906 Posted November 27, 2017 addPlayerScores Here is an example of poorly (badly) documented command. If you read the link this command is server side. So, what the hell the example and comment refer to player????? I guess you need to identify the said "player" instead of using the player variable. we should read: soldier1 addPlayerScores [0, 1, 0, 0, 1]; // which soldier1 is a player (or not, AIs can have score if i'm right) Anyway: The addMissionEventHandler "entityRespawned" should run on server, here, for this special purpose (most of the time you need it locally for loadout or else). So place it in initServer.sqf or... in init.sqf with: if (isServer) then { addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (isPlayer _instigator && side group _killed isEqualTo east) then { _instigator addPlayerScores [1, 0, 0, 0,0]; // to add one more point than the standard score against infantry _instigator_kills = getPlayerScores _instigator; format ["%1",_instigator_kills] remoteExec ["hint",_instigator]; }; }]; }; It doesn't work in SP. Share this post Link to post Share on other sites