Hello All,
I'm have a bit of a problem get a piece of script to work in a mission which is using the ACE Mod. The goal of the script is to place a blufor troop in a stockade if they kill a Civilian. I have gotten this script to work before but is was without using the ACE Mod and please bear in mind I am no where near a scripting expert. I most grateful for any help can can be provided.
In my init.sqf file I have the following line:
_allCivs = [civ1,civ2,civ3,civ4,civ5,civ6,civ7,civ8,civ9,civ10,civ11,civ12,civ13,civ14,civ15, civ16,civ17,civ18,civ19,civ20,civ21,civ22,civ23,civ24,civ25,civ26,civ27,civ28,civ29, civ30,civ31,civ32,civ33,civ34,civ35,civ36,civ37,civ38,civ39,civ40,civ41,civ42, civ43,civ44,civ,45,civ46,civ47,civ48];
[_allCivs] exec "scripts\initPunish.sqs";
The initPunish.sqs has the following:
_civs = _this select 0;
; Add all the killed handlers to the civs. Could run this in their inits instead; it really makes no difference.
{ _x addEventHandler ["KILLED", { _this exec "scripts\gotoJail.sqs"; killedCiv = _this; publicVariable "killedCiv"; }]; } forEach _civs;
; Only clients need to know about deaths.
? isServer and (isNull player) : exit;
; Make sure we don't hear about the death should the player JIP into the game a long time after the death occurred.
; Note that this will mean you *could* kill with impunity for the first 10 seconds after JIP, but...*shrugs*
~10
; Be informed whenever some civilian is killed.
"killedCiv" addPublicVariableEventHandler { (_this select 1) exec "scripts\gotoJail.sqs" };
And my gotJail.sqs has the following:
_victim = _this select 0
_killer = _this select 1
; If the killer wasn't killed directly by another player, then that is fine and ignored.
? _killer == _victim : exit
; If the killer wasn't on the west side, then that is fine.
? side _killer != west : exit
; Everyone except the killer gets one message and doesn't go to jail.
~1
? _killer != player : hint format [ "ATTENTION!\n%1 has killed a civilian! He has been sent to Confinement to await court-martial!",(name _killer)]; exit
; Only if you are actually the killer, will you get the personal message and go to jail.
hint "ATTENTION!\nYou have killed a civilian! You will be sent to Confinement to await court-martial!"
~3
titlecut ["","BLACK OUT",3]
~4
_killer setpos (getpos jail)
disableUserInput true
Removeallweapons _killer
~5
disableUserInput false
_killer setDammage 0
~1
titlecut ["","BLACK IN",3]
I have a game logic called "jail" place where I wish the Culprit to be placed. Thank again for any help in resolving this issue.