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

Police Guard

(1/1)

Yasirotta:
Ok, trying make classic bankrob etc. mission multiplayer. 2-8 players, as robbers.

Now theres 2 things i been thinking. First is, making Cops walking at city pointless (random waypoints). I was thinking to make their behaviour "safe", and give waypoint of "guard" big as city area is. Before that, "Cycle". Will this make them walking at city, and draw guns when alert is made ?

Alert would be set whit changing players side. First civilians, then change their side to East. Cops are west, friendly to civilians. Now, the trick is that alert (=change side) is made when a) player takes gun (pistol) out of his pocket or b) bank is robbed. Robbing the bank could made whit trigger whit "addaction" line.

Thats whats i would need help. If aint too hard, can this made more tricky ? Point is, that players can hide pistols, but if M16 at shoulder, that also makes alert ? I guess it would need script whit "knowsabout" and "Checkweapon" (?), but my skills arent high.

Once again made it short:
1. Cops patrolling at safe first
2. Cops shoot players if they see player whit gun
3. After alert, Cops go combat behaviour

faguss:

--- Quote ---making Cops walking at city pointless
--- End quote ---
Better to do it with a script rather than Mission Editor. Are you familiar with scripting?


--- Quote ---changing players side
--- End quote ---
It is not possible to do so. However, you can change their rating so they become an enemy to anyone.


--- Quote ---alert is made when a) player takes gun (pistol) out of his pocket
--- End quote ---
That could be achieved by:

* adding/removing weapon by user action; if player hasWeapon then alert
* detecting player current animation with Fwatch 1.1

Lenyoga:
Changing the player's side doesn't work, but it's possible to change the player's unit's side to EAST in the mission.sqm file, and add "this setCaptive true" to the player's init line - when the alert is triggered, you can add "player setCaptive false" to the activation line and the police will open fire.

There is a command called hasWeapon - everytime the player is within a police unit's field of vision, you could execute a script - something like



--- Code: ---?(player hasWeapon "M16") : goto "Alert"
?(player hasWeapon "Revolver") : goto "Alert"

exit

#Alert

player setCaptive false

exit
--- End code ---


I don't know if it's possible to check if a handgun is holstered, but I think it's unlikely to accomplish that.

I hope that was helpful.

robertoHrvat:
you can create one EAST soldier on some smaller island near that big island named: PoliceEnemy

?(player hasWeapon "M16") : goto "Trouble"

exit

#Trouble
Player Join Group PoliceEnemy
enabeRadio false
~0.1
(Now when he is joined russian group, he is now Resistance enemy, and now russian will be removed from game but you will stay like an res enemy)
deletevehicle PoliceEnemy
enableradio true

Navigation

[0] Message Index

Go to full version