Home   Help Search Login Register  

Author Topic: dont fire on emeny outside the zone  (Read 915 times)

0 Members and 1 Guest are viewing this topic.

Offline schuler

  • Contributing Member
  • **
dont fire on emeny outside the zone
« on: 23 Feb 2007, 08:59:02 »
iam looking for a script. There's the point. the sgt "player" is told not to fire a pone enemy's leaving the area ,,,there is a trigger to end the game with a time out of 60s. when the game is tiggered to end i'd like the script to run, only for the player if posible ,or for the unit if its easyer to make. and if he does he gets warned and looses points. i'd been happy with just a warning!,,,,, iam thinking this is a hard one.
     i hope i was clear enough on that , i can be hard to follow  :-[
Semper Fi

Offline Cheetah

  • Former Staff
  • ****
Re: dont fire on emeny outside the zone
« Reply #1 on: 23 Feb 2007, 09:45:44 »
You could use EventHandlers

With a fired eventhandler you can check if the player fires, activate this code when needed:
EHkilled = player addEventHandler ["killed", {_this exec "playerKilled.sqs"}]

playerKilled.sqs
Code: [Select]
_unit = _this select 0;
if(_unit == "player") then { hint "Damn you, you're violating the law!"; player addRating -5000; }

I think that something like this should work, untested in OFP though.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline schuler

  • Contributing Member
  • **
Re: dont fire on emeny outside the zone
« Reply #2 on: 24 Feb 2007, 06:26:25 »
Ok Cheetah i'll give that a go. and check eventhandler too. thanks, shuler
Semper Fi