Jump to content
Sign in to follow this  
1para{god-father}

How to add Points system

Recommended Posts

OK results...

Add EH to allunits does indeed work fine even for UPSMON, also if I create the group then add the EH to the group then set it to UPSMON it also work so thanks Guys !

Resolved :)

Share this post


Link to post
Share on other sites

Good to hear its working. I'm not saying that you can't add an EH using allUnits, but that any unit already on the map with the Killed EH added will have a second one added and hence you will get twice the score you wanted when that unit is killed. Maybe all the other units are dead already? Anyway as long as its doing what you want.

Share this post


Link to post
Share on other sites

OK thought it was working but YEP you where correct it double them up !

So..... Tried this but it does not work any Suggestions where I am going wrong ?

_grp1 = [_positionToSpawnIn, EAST, (configFile >> "CfgGroups" >> "EAST" >> "BIS_TK_INS" >> "Infantry" >> "TK_INS_Patrol")] call BIS_fnc_spawnGroup;
sleep .2;
{
  addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5;  publicVariable "totalscore"; _text = parseText   format["%1",totalscore];[nil,nil,rHint,_text] call RE }}]
} forEach (units _grp1);


Ignore forgot the _X at the start

How do i add it to a group of Vehicles ?

Edited by psvialli

Share this post


Link to post
Share on other sites

It didn't double them up if you added the EH to the group only. It's to do with

totalscore = totalscore + 5; publicvariable "totalscore"

For a quick testing purpose, don't use publicvariable.

---------- Post added at 10:42 ---------- Previous post was at 10:40 ----------

Also, make sure to add the EH to all units and THEN create the group and add the EH to the group only.Then there's noway they'd be doubled up.

---------- Post added at 10:45 ---------- Previous post was at 10:42 -------

Obviously create the units and Eh on the server.

Share this post


Link to post
Share on other sites

ahhhhhh Thanks!

Well it is all working apart from Vehicles when they are destroyed the crew get points but how do I add the EH to vehicles ?

_armourgrp1 = [_pos, east,["LandRover_MG_TK_INS_EP1", "LandRover_MG_TK_INS_EP1"],[[-3,-3], [3,3]]]  call BIS_fnc_spawnGroup;
[_armourgrp1,_pos,250] execVM "scripts\BIN_taskPatrol.sqf";

/////////////I get 5 points for Crew //////////////
{
_x addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 5;  publicVariable "totalscore"; _text = parseText   format["%1",totalscore];[nil,nil,rHint,_text] call RE }}];

} forEach units _armourgrp1 ;

/////////////////////This does not Work ????????????????????????////////////////////////////////////////
{
_x addMPEventHandler ["MPKilled", { if (_this select 1 == player) then {totalscore = totalscore + 30;  publicVariable "totalscore"; _text = parseText   format["%1",totalscore];[nil,nil,rHint,_text] call RE }}];

} forEach vehicle _armourgrp1 ;



Share this post


Link to post
Share on other sites

Try vehicles instead of vehicle. Also you could try creating empty vehicles first. Then add eventhandler foreach [_vehname1,_vehname2,_vehname3]. And then create crew group..add Eh to them... Then move them into the vehicle(s).

---------- Post added at 11:31 ---------- Previous post was at 11:19 ----------

Updated

Edited by Iceman77

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  

×