Home   Help Search Login Register  

Author Topic: AddScore Local to Global  (Read 1252 times)

0 Members and 1 Guest are viewing this topic.

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
AddScore Local to Global
« 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
« Last Edit: 20 Nov 2008, 10:06:05 by Carroll »

Offline ModestNovice

  • Members
  • *
Re: AddScore Local to Global
« Reply #1 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.";
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Carroll

  • Members
  • *
  • Mission Designer (MP-"well tryin to capiche"
Re: AddScore Local to Global
« Reply #2 on: 21 Nov 2008, 06:26:14 »
thanks alot  :good:

Offline ModestNovice

  • Members
  • *
Re: AddScore Local to Global
« Reply #3 on: 22 Nov 2008, 03:17:56 »
no problem. hope it helped.  ;)
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley