Home   Help Search Login Register  

Author Topic: addrating advanced system  (Read 2011 times)

0 Members and 1 Guest are viewing this topic.

Offline robertoHrvat

  • Members
  • *
    • Area 51 modification
addrating advanced system
« on: 01 Oct 2011, 18:40:59 »
Hello,
my question is: How to make player addrating -9999 when he kill "somebody"
- not (alive name) is here not what im think on, im editing FTA Life Simulation and I was added weapon shop in and my problem is to i still don't know how to make that addrating when player kill somebody, anybody! Only one man. Then police on same side will start to shoting player!

Or easier to explain what i want: When some man have been killed, his killer get -9999 rating then police will shoting him! Is that possible ?
« Last Edit: 01 Oct 2011, 18:45:42 by robertoHrvat »
RobertoHrvat

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: addrating advanced system
« Reply #1 on: 01 Oct 2011, 20:39:21 »
It certainly is possible. If I were to do this I would place a 'killed' eventhandler in the init of everyone but the player. What this does is execute a script whenever a loon with the eventhandler is killed.

Hope that helps

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline robertoHrvat

  • Members
  • *
    • Area 51 modification
Re: addrating advanced system
« Reply #2 on: 02 Oct 2011, 09:41:36 »
I believe it will works, but can you please make some example with that eventhandler ? I was never using eventhandlers in making a mission.
I tried this: I created man with init: [this] exec "whenkilled.sqs"

Code: [Select]
WHENKILLED.SQS
_man = _this select 0
_killer = _this select 1
 _man addEventHandler ["killed", {_man,_killer] exec "killerrating.sqs"}"]

Code: [Select]
KILLERRATING.SQS
_killer = _this select 1

_killer addrating -9999

And doesn't work! Any example ?
RobertoHrvat

Offline Inlesco

  • Members
  • *
Re: addrating advanced system
« Reply #3 on: 02 Oct 2011, 15:40:07 »
ROH, your second code about consequences of killing a unit does not work because the element you've chosen is marked as "1", it should be "_this select 0" and I'm sure it will work properly then.

Offline robertoHrvat

  • Members
  • *
    • Area 51 modification
Re: addrating advanced system
« Reply #4 on: 02 Oct 2011, 19:48:27 »
Yes I know, im not very good in that select 0,1,2 ... Anyway I am looking for some script to when civilian die his killed get rating -9999
RobertoHrvat

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: addrating advanced system
« Reply #5 on: 18 Oct 2011, 21:02:40 »
Robert,

Try the attached demo mission. Copy the trigger to the center of your mission map and put the script civkilled.sqs in you mission folder. The trigger is activated by civilian(s) present and adds the event handler "killed" to each civilian using this code on the "On Activation" line:
civ_units = thisList; {_x addEventHandler ["killed", {_this exec "civkilled.sqs"}]} forEach civ_units