OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: Carroll on 20 Nov 2008, 09:51:33

Title: AddScore Local to Global
Post by: Carroll on 20 Nov 2008, 09:51:33
Hi, i am currently tied down on another project atm, when i got an unrelated idea & was wondering if anyone could answer my small question from their knowledge if it ok, this is before i get myself sidetracked & bogged testing it myself....

well, is it possible to use a 'killed' EH to localy display some text onscreen....But then globally conform to: "1" objStatus "DONE"; addScore #; (via conditionised trigger)

To be a little clearer, i want to use a killed EH to notify player locally, but then add to his score globally. I am guessing/hoping that addScore will be global, then if i run a script localy from EH, i will get desired results?

Any reply would be appreciated, wish i be of more help
Title: Re: AddScore Local to Global
Post by: ModestNovice on 20 Nov 2008, 23:53:32
init.sqf
Code: [Select]
player addEventHandler ["Killed", {_this execVM "playerKilled.sqf"}];
player_died = [];
"player_died" addPublicVariableEventHandler
{
      _dead = (_this select 1) select 0;
      _dead addScore 1;
};

playerKilled.sqf
Code: [Select]
_victim = _this select 0;
player_died = [_victim];
publicVariable "player_died";
//You can change this to whatever you want the message to be
player groupChat "You died.";
Title: Re: AddScore Local to Global
Post by: Carroll on 21 Nov 2008, 06:26:14
thanks alot  :good:
Title: Re: AddScore Local to Global
Post by: ModestNovice on 22 Nov 2008, 03:17:56
no problem. hope it helped.  ;)