sábado, 23 de febrero de 2019

A simple menu for a VIP, or a hostage.

Agrega las siguientes opciones a una unidad en el menu de la rueda del raton
Add the following options to the mouse wheel of a unit:


"Follow me"
"Stay here"
"Look for a house to hide"
"Where safe now"
"Hurry up"
"Get in that vehicle"
"Get out the vehicle"

Descarga / Download

Or create a script named VipMenu.sqf

03/13/19, change in waypoint deletion

/* ****************************************************************
Script file for ArmA 3: VipMenu.sqf

Created by: Codegab

Date: 2019-02-19


A una unidad se le asigna un menu en la rueda del raton con los comandos / Add the following options to the mouse wheel of a unit:
"Follow me"
"Stay here"
"Look for a house to hide"
"Where safe now"
"Hurry up"
"Get in that vehicle"
"Get out the vehicle"

variables del vip / variables of the VIP:
estado= si esta siguiendo al player o esta quieto / if the vip is following the player or not
auto=auto asignado / assigned car

Se llama en el init del Vip / It is called on the init of the VIP:
[this] execVM "VipMenu.sqf";

Para tener mas de un vip en la mision:
Se debe copiar el archivo de script y cambiar la linea vipunitmission = _unit por vipunitmission2 = _unit y asi sucesivamante

To have more than one VIP on the mission:
You must copy the script file and change the line vipunitmission = _unit to vipunitmission2 = _unit and so on


 while {(count (waypoints _group)) > 0} do
 {
  deleteWaypoint ((waypoints _group) select 0);
 };
while {(count (waypoints group vipunitmission)) > 0} do
{
deleteWaypoint ((waypoints group vipunitmission) select 0);
};
 *****************************************************************/

params ["_unit"];

vipunitmission = _unit;

vipunitmission setVariable ["estado", false,true];
vipunitmission setVariable ["auto", "no",true];


vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "Follow me" + "</t></t>", {
_jugador = player;
[vipunitmission,"Behind you"] remoteExec ["globalChat", 0];
vipunitmission setVariable ["estado", true,true];
while {vipunitmission getVariable "estado"} do
{
if (vipunitmission distance _jugador > 5) then
{
//deleteWaypoint [group vipunitmission, 0];
while {(count (waypoints group vipunitmission)) > 0} do
{
deleteWaypoint ((waypoints group vipunitmission) select 0);
};
group vipunitmission addWaypoint [_jugador getRelPos [2, 180], 0];
}else
{
deleteWaypoint [group vipunitmission, 0]; 
};
sleep 2;
};
}];

vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "Stay here" + "</t></t>", {
vipunitmission setVariable ["estado", false, true];
while {(count (waypoints group vipunitmission)) > 0} do
{
deleteWaypoint ((waypoints group vipunitmission) select 0);
};
[vipunitmission,"Staying here"] remoteExec ["globalChat", 0];
}];


vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "Look for a place to hide" + "</t></t>", {
vipunitmission setVariable ["estado", false, true];
(group vipunitmission) setBehaviour "COMBAT";

_nBuilding = nearestObjects [player, ["House"], 50];

if (count _nBuilding > 0) then
{
_house = _nBuilding select 0;
[vipunitmission,"Running away"] remoteExec ["globalChat", 0];
//deleteWaypoint [group vipunitmission, 0];
while {(count (waypoints group vipunitmission)) > 0} do
{
deleteWaypoint ((waypoints group vipunitmission) select 0);
};
group vipunitmission addWaypoint [_house getRelPos [5, 0], 0];
}else
{
[vipunitmission,"I can't see a fu...... good place!!!"] remoteExec ["globalChat", 0];
};
}];


vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "We are safe now" + "</t></t>", {
(group vipunitmission) setBehaviour "SAFE";
(group vipunitmission) setSpeedMode "LIMITED";
[vipunitmission,"Ok, thanks"] remoteExec ["globalChat", 0];
}];

vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "Hurry up" + "</t></t>", {
(group vipunitmission) setBehaviour "COMBAT";
(group vipunitmission) setSpeedMode "NORMAL";
[vipunitmission,"Let's go"] remoteExec ["globalChat", 0];
}];

vipunitmission addAction ["<t size='1'><t color='#ffff00'>" + "Get in that vehicle" + "</t></t>", {
vipunitmission setVariable ["estado", false, true];
//deleteWaypoint [group vipunitmission, 0];
while {(count (waypoints group vipunitmission)) > 0} do
{
deleteWaypoint ((waypoints group vipunitmission) select 0);
};
_vehiculos = nearestObjects [player, ["Car","Helicopter", "Boat", "Tank", "Plane"], 50];
if (count _vehiculos > 0) then
{
[vipunitmission,"Geting in"] remoteExec ["globalChat", 0];
_car = _vehiculos select 0;
vipunitmission setvariable ["auto", _car, true];
vipunitmission assignAsCargo _car;
[vipunitmission] orderGetIn true;
_car addAction ["<t size='1'><t color='#ffff00'>" + "Get out the vehicle" + "</t></t>", {
[vipunitmission,"Geting out"] remoteExec ["globalChat", 0];
[vipunitmission] orderGetIn false;
dogetout vipunitmission;
unassignVehicle vipunitmission;
_car = vipunitmission getvariable "auto";
removeAllActions _car;
}];
}else
{
[vipunitmission,"I can't see the vehicle"] remoteExec ["globalChat", 0];
};
 
}];

No hay comentarios:

Publicar un comentario