OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: haroon1992 on 23 Jul 2009, 15:05:16

Title: Help with mp editing
Post by: haroon1992 on 23 Jul 2009, 15:05:16
I have a small question if its not to much trouble,

I am making a death match mission with ambient life in it, cows chickens etc, all works fine at the moment, but i would like the players to be punished with -1 point if they kill an animal, have you any idea how I would do it?

I have seen the addrating command, but am unsure how to us it. I am a noob when it comes to this.

Thanks
Title: Re: Help with mp editing
Post by: Gruntage on 26 Jul 2009, 10:33:58
Place a trigger anywhere on the map. Leave it as 'None' and 'Present'. Put in the condition field:

Code: [Select]
not (alive chicken)
Where chicken can be the name of any of your animals.

In the On activation field put this:

Code: [Select]
aP addrating -1
Where aP is the name of your player

You can also use a getdammage command where if your soldier shoots an animal, HQ will tell you to stop it...

In the condition field put this:

Code: [Select]
getdammage chicken > 0
and in the On activation field put:

Code: [Select]
[West,"hq"] sidechat "Stop shooting the animals"
Hope this helps  :)

Gruntage
Title: Re: Help with mp editing
Post by: haroon1992 on 26 Jul 2009, 10:59:46
No i mean how do i define who shot the animals so that i can reduce marks from the one who shot the animals(as there are players in the MP)
Title: Re: Help with mp editing
Post by: Gruntage on 26 Jul 2009, 11:50:38
In that case, use the hint format command:

Code: [Select]
_u = _this select 0

_rat = (rating _u) +1
         
hint format ["%1 stop killing the animals!", name _u]

_u addrating -_rat

this would be the script used in the following eventhandler:

Code: [Select]
_animal = _this select 0

_animal addeventhandler ["Killed", {_this exec "animalkilled.sqs"}]

I think thats right  :scratch:

You can also use sidechat format instead of hint:

Code: [Select]
_u = _this select 0

[West,"hq"] sidechat format ["%1 stop killing the animals!" name _u]

Hope this helps

Gruntage

Title: Re: Help with mp editing
Post by: Ironman on 28 Jul 2009, 01:52:47
I believe this should go into the ArmA 2 section.