PDA

View Full Version : Self-Damage when shooting Civilian...



Enigma
Dec 28 2006, 16:07
I am making a mission where RACS forces go into a village that has half armed civilians and unarmed civilians. I want to deter the RACS from shooting all civilians and making it easy on them, so I would like to put an ingame punishment; If they shoot and kill a friendly civilian then they will do damage to themselves and if they do it enoujgh they will die.

Does anyone know how to do this? I have looked around but found nothing.

ManDay
Dec 28 2006, 17:24
I would suggest


In the onActivation-Line of a trigger, which is activated by Civilians only and covers the certain area:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{ _nilPoint = _x addEventHandler&#91; &#34;killed&#34;,{ _this exec &#34;checkForHarm.sqf&#34; &#93;; }forEach thislist;[/QUOTE]

checkForharm.sqf
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if&#40; &#40; count weapons _this select 0 &#41;&#62; 0 &#41;then
{
_this select 1 setDammage =&#40; getDammage _this select 1 &#41;+ 0.1;
};[/QUOTE]

(Didn&#39;t try)

Enigma
Dec 29 2006, 00:30
I would suggest


In the onActivation-Line of a trigger, which is activated by Civilians only and covers the certain area:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{ _nilPoint = _x addEventHandler&#91; &#34;killed&#34;,{ _this exec &#34;checkForHarm.sqf&#34; &#93;; }forEach thislist;

checkForharm.sqf
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if&#40; &#40; count weapons _this select 0 &#41;&#62; 0 &#41;then
{
_this select 1 setDammage =&#40; getDammage _this select 1 &#41;+ 0.1;
};[/QUOTE]

(Didn&#39;t try)[/QUOTE]
Thanks

Hund
Jan 6 2007, 21:18
As per my SOP, I have a half-assed solution to this problem (though it seems to be taken care of already).

The way I did it was to monitor each player&#39;s rating. Once it dropped too low (say, -3000) a trigger would kick in and setpos the offending player to a remote island off the coast of Sahrani.

I thought about removing all their weapons as well and adding a single weapon crate with a single grenade, just to get the point across. http://forums.bistudio.com/oldsmileys/icon_rolleyes.gif

But truth be told the above seems much more pro. I just can&#39;t script so I use trigger solutions for everything. The wonders of Biki, eh?