Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting Multiplayer

kill script for friendly/enemy... help!

<< < (2/2)

ÐurbanPoison™:
I implemented the script and it works well! Thank you!

I had a couple questions about tweaking it... I noticed that if the killer dies a few times (kills himself) the computer will start to treat him as a west player... and vise versa... if a cop tk's a few times it will begin to display east messages to that officer lol. I assume this is due to the player's score going negative and making them enemy to their team - so would resetting the offender's score to zero after they lose a point fix the problem? And if so is there a set score command? I messed around with Score player and and add or minus a point, but don't know how to reset a score to zero ie.   score player == 0 etc.

The other question regarding vehicles - which are also still going to jail with the offending party... is there an eject/remove from vehicle command that will remove vehicle from player/player from vehicle? And I imagine if the gunner of a heli or jeep tk's but the pilot/driver didn't - it would be unfair to punish the entire crew... so I guess removing the player from whatever vehicle they're in would be best?

Again, thanks in advance for any help - so far the mission is coming along pretty darn well :D

Rellikki:
Yes, it's true that the game engine will change the player's side if they get too many negative points. I wrote a script that fixes that issue:


--- Code: ---?! local player : exit

#loop
@ rating player < 0
player addrating -(rating player)
goto "loop"
--- End code ---

That'll negate any negative points that the player gets, reset them back to zero and change their side back to their default one. Execute it to all players.

You can fix the problem with the jailed guy's vehicle coming along with them by adding the following line into the killed.sqs script after the first two lines:

if (format ["%1", gunner _killer] == "<NULL-OBJECT>") then {_killer = driver (_this select 1)} else {_killer = gunner (_this select 1)}

Basicly it assumes that if the killer's vehicle didn't have a gunner, then it must be the driver (In case of manual fire.) Also works if no vehicle was present and they were on foot. I updated my previous post with this change.

ÐurbanPoison™:
Man that works perfectly! Thank you again very much, your coding will have saved me many hours of  ???:P

Cheers~

Navigation

[0] Message Index

[*] Previous page

Go to full version