Jump to content
Sign in to follow this  
kovvalsky

[DM] Lobo Solitario (WIP) >> fixing problems on MP

Recommended Posts

Hello everyone!

I'm doing a mission and need to fix a lot of things I did not understand. In this community I have found very helpful info and I am very grateful.

First of all thanks for the time you dedicate.

I have to comment that the programming is done in Spanish (text, comments, variables, etc ...) I'm sorry for that, I will use stringtables later, when everything works well.

Without further ado, here goes:

MISSION FEATURES:

-
COMBAT AREA
which is delimited by a area marker(on editor). if you go out.. you die

-
MONEY / SHOP SYSTEM
: You can buy everything, even improvements (as fatigue or additional backpack) and logistics (mercenaries, combat dogs, airstrike)

-
ATM SYSTEM
: you can deposit at the ATM money you have.

-
INDIVIDUAL RESPAWN SYSTEM
: you can choose which you appear via a sleeping bag. (player action)

-
SPY SATELLITE
: simply, every x seconds the position of all players shown on the map.

-
MONEY DROPs
: A helicopter flies over the combat zone and is destroyed. On landing the money appear within a radius 5 meters.

-
SUPPLY DROPs
:A helicopter flies over the combat zone and drops a supply box with things.

MISSION WORKFLOW:

- The player starts in a container, no clothes, no weapons. only a mapItem.

- Have an initial $ ??? cash (specified on the lobby)

- When you bought your gear, you'll jump to the combat zone through a map is inside the container.

- When you touch the ground, planting the respawn action appears. if you do not plant, when you die, a random position is calculated to respawn.

- When you die, you loose the money you have, but preserves all the equipment.

- Every x seconds (specified on the lobby), money or supply drop appears over combat zone.

- Every x seconds (specified on the lobby), spy satellite is activated.

FILES (ver 1.0)

.rar Mission (google drive)

.rar Mission (Dropbox)

.pbo Mission (Dropbox)

.pbo Mission (google drive)

PROBLEMS

[PROB1] When you die on a vehicle (like parachute or quad) primaryWeapon is not stored:

i use a "killed" eventHandler to store all gear on a local public variable (EQUIPO):

script called when "killed" EH:

_Soldado = [_this,0] call BIS_fnc_param;
_Asesino = [_this,1] call BIS_fnc_param;

if ((_Asesino != _Soldado) && !(isNull _Asesino)) then
{
_MuertesAsesino = _Asesino getVariable ["MUERTES",-1];
if (_MuertesAsesino != -1) then {
	_MuertesAsesino = _MuertesAsesino + 1;
	_Asesino setVariable ["MUERTES", _MuertesAsesino, true];
} else {
	hint Format ["NO EXISTE LA VARIABLE EN %1",_Asesino];
};		
};

_Ropa = uniform player;							//UNIFORME
_ContenidoRopa = uniformItems player;			//CONTENIDO DEL UNIFORME
_Chaleco = vest player;							//CHALECO
_ContenidoChaleco = vestItems player;			//CONTENIDO DEL CHALECO
_Mochila = backpack player;						//MOCHILA
_ContenidoMochila = backpackItems player;		//CONTENIDO DE LA MOCHILA
_ArmaPrincipal = primaryWeapon player;			//ARMA PRINCIPAL
_ArmaPriAcc = primaryWeaponItems player;		//ACCESORIOS DEL ARMA PRINCIPAL
_ArmaPriAmmo = [];								//MUNICION ARMA PRINCIPAL [NombreClase,Cantidad]

if (_ArmaPrincipal != "") then {
if ((player ammo _ArmaPrincipal) > 0) then
{
	_classMag = (primaryWeaponMagazine player) select 0;
	_countMag = player ammo _ArmaPrincipal;
	_ArmaPriAmmo = [_classMag,_countMag] ;	
};
};	
_ArmaSecundaria = secondaryWeapon player;		//ARMA SECUNDARIA
_ArmaSecAcc = secondaryWeaponItems player;		//ACCESORIOS DEL ARMA SECUNDARIA	
_ArmaSecAmmo = "";
if (_ArmaSecundaria != "") then {
if ((player ammo _ArmaSecundaria) > 0) then 
{
	_ArmaSecAmmo = (secondaryWeaponMagazine player) select 0;
};
};

_ArmaPistola = handgunWeapon player;			//PISTOLA
_ArmaPisAcc = handgunItems player; 				//ACCESORIOS DE LA PISTOLA
_ArmaPisAmmo = [];
if (_ArmaPistola != "") then {
if ((player ammo _ArmaPistola) > 0) then
{
	_classMag = (handgunMagazine player) select 0;
	_countMag = player ammo _ArmaPistola;
	_ArmaPisAmmo = [_classMag,_countMag] ;	
};
};

_Gadjets = assignedItems player;				//GADJETS
_Casco = headgear player; 						//ACCESORIOS DE LA CABEZA
_Gafas = goggles player; 						//GAFAS

EQUIPO = [_Ropa,
	_ContenidoRopa,
	_Chaleco,
	_ContenidoChaleco,
	_Mochila,
	_ContenidoMochila,
	_ArmaPrincipal,
	_ArmaPriAmmo,
	_ArmaPriAcc,
	_ArmaSecundaria,
	_ArmaSecAmmo,
	_ArmaSecAcc,
	_ArmaPistola,
	_ArmaPisAmmo,
	_ArmaPisAcc,
	_Gadjets,
	_Casco,
	_Gafas
	];

if (DINERO > 0) then {			
//Suelto la pasta...
_PosDinero = _Soldado modelToWorld [((random -0.2)+(random 0.2)),1,((random -0.2)+(random 0.2))];
[[_PosDinero,DINERO],"CAOE_fnc_createDineroMuerte",false,true] call BIS_fnc_MP;
};	
//Reseteo la pasta...
DINERO = 100;

and script called when "respawn" EH:

_Soldado = [_this,0] call BIS_fnc_param;
_Cuerpo = [_this,1] call BIS_fnc_param;

12452 cutText ["","BLACK OUT",0.01]; 

_Soldado playActionNow "PlayerProne";

//Vuelvo a ejecutar la restriccion de zona
_Null = ["mkZonaCombate",_Soldado,15] spawn CAOE_fnc_RestriccionZonaCombate;
//pasa a ser Renegado (para el Friendly fire)
_Soldado addRating -10000;

_Ropa = 			EQUIPO select 0;	//UNIFORME
_ContenidoRopa =	EQUIPO select 1;	//CONTENIDO DEL UNIFORME
_Chaleco =  		EQUIPO select 2;	//CHALECO
_ContenidoChaleco = EQUIPO select 3;	//CONTENIDO DEL CHALECO
_Mochila = 			EQUIPO select 4;	//MOCHILA
_ContenidoMochila = EQUIPO select 5;	//CONTENIDO DE LA MOCHILA
_ArmaPrincipal =	EQUIPO select 6;	//ARMA PRINCIPAL
_ArmaPriAmmo =  	EQUIPO select 7;	//ARMA PRINCIPAL AMMO
_ArmaPriAcc = 		EQUIPO select 8;	//ACCESORIOS DEL ARMA PRINCIPAL
_ArmaSecundaria = 	EQUIPO select 9;	//ARMA SECUNDARIA
_ArmaSecAmmo = 		EQUIPO select 10;	//
_ArmaSecAcc = 		EQUIPO select 11;	//ACCESORIOS DEL ARMA SECUNDARIA
_ArmaPistola = 		EQUIPO select 12;	//PISTOLA
_ArmaPisAmmo = 		EQUIPO select 13;
_ArmaPisAcc = 		EQUIPO select 14; 	//ACCESORIOS DE LA PISTOLA
_Gadjets = 			EQUIPO select 15;	//GADJETS
_Casco = 			EQUIPO select 16; 	//ACCESORIOS DE LA CABEZA
_Gafas = 			EQUIPO select 17; 	//GAFAS


_Soldado enableFatigue (!("me_FFv4" in MEJORAS));

if (_ArmaSecundaria != "") then 
{
if (_ArmaSecAmmo != "") then
{
	_Soldado addBackpack "B_HuntingBackpack";
	_Soldado addMagazine _ArmaSecAmmo;
	_Soldado addWeapon _ArmaSecundaria;										
	removeBackpack _Soldado;
} else {
	_Soldado addWeapon _ArmaSecundaria;
};
{if (_x != "") then {_Soldado addSecondaryWeaponItem _x;};}forEach _ArmaSecAcc;
};

if (_Ropa != "") then 
{
if(!(_Soldado isUniformAllowed _Ropa)) then {
	_Soldado forceAddUniform _Ropa;
} else {
	_Soldado addUniform _Ropa;
};			
{_Soldado addItemToUniform _x;}forEach _ContenidoRopa;
} else {
removeUniform _Soldado;
};

if (_Chaleco != "") then 
{
_Soldado addVest _Chaleco;
{_Soldado addItemToVest _x;}forEach _ContenidoChaleco;
} else {
removeVest _Soldado;
};

if (_Mochila != "") then 
{	
_Soldado addBackpack _Mochila;
{_Soldado addItemToBackpack _x;}forEach _ContenidoMochila;
} else {
removeBackpack _Soldado;
};

if (_ArmaPrincipal != "") then 
{	
_Soldado addWeapon _ArmaPrincipal;

{if (_x != "") then {_Soldado addPrimaryWeaponItem _x;};}forEach _ArmaPriAcc;
if ((count _ArmaPriAmmo) > 0) then
{
	_Soldado addMagazine (_ArmaPriAmmo select 0);
	_Soldado setAmmo [_ArmaPrincipal,_ArmaPriAmmo select 1];
};
};
if (_ArmaPistola != "") then 
{
_Soldado addWeapon _ArmaPistola;
{if (_x != "") then {_Soldado addHandgunItem _x;};}forEach _ArmaPisAcc;
if ((count _ArmaPisAmmo) > 0) then
{
	_Soldado addMagazine (_ArmaPisAmmo select 0);
	_Soldado setAmmo [_ArmaPistola,_ArmaPisAmmo select 1];
};
};

if ((count _Gadjets) > 0) then {
{
	_Soldado linkItem _x;		
}forEach _Gadjets;
};

if (_Casco != "") then {
_Soldado addHeadgear _Casco;
} else {
removeHeadgear _Soldado;
};
if (_Gafas != "") then {
_Soldado addGoggles _Gafas;
} else {
removeGoggles _Soldado;
};

sleep 1;
12452 cutText ["","BLACK IN",3];
if ((count RESPAWNPOS) > 1) then
{
_Soldado setDir (RESPAWNDIR + 180);	
_Soldado setPosATL RESPAWNPOS;
}else{
_posAleatorio = [["mkZonaDrop"]] call BIS_fnc_randomPos;
_posicionLibre = _posAleatorio findEmptyPosition [1,30,"B_soldier_PG_F"];
_Soldado setPosATL _posicionLibre;
_Soldado addAction ["PLANTAR TIENDA RESPAWN","Scripts\TRespawn_Plantar.sqf","",1];
};

_____________________________________________________________________________________________________________________

[PROB2] Sometimes the gun dealer do not appear:

init.sqf (at the end of SERVER SETUP section)

sleep 0.1;
startLoadingScreen ["ZzZzZzZZzzzz..."];

//*********************************************************
//****************		PARAMETROS    *********************
//*********************************************************

DMLS_ParamDuracion = paramsArray select 1;
DMLS_ParamNumSuministros = paramsArray select 2;
DMLS_ParamNumDinero = paramsArray select 3;
DMLS_ParamSatelite = paramsArray select 4;
DMLS_ParamAtaqueIA =  paramsArray select 5;
DMLS_ParamDineroInicial = paramsArray select 6;
DMLS_ParamPrecio = paramsArray select 7;
DMLS_ParamBancoPersistente = paramsArray select 8;

DMLS_ParamHora = paramsArray select 10;
DMLS_ParamClima = paramsArray select 11;
DMLS_ParamDistancia = paramsArray select 12;
DMLS_ParamDistanciaObj = paramsArray select 13;
DMLS_ParamCalidad = paramsArray select 14;
DMLS_Param3PVista = paramsArray select 15;

//*********************************************************
//*************    VARIABLES PUBLICAS    ******************
//*********************************************************

//ESPECIFICAS PARA CADA JUGADOR
if (!isDedicated) then {

waitUntil {!(isNull player)};

DINERO = DMLS_ParamDineroInicial;
DINERO_BANCO = [] call CAOE_fnc_DineroEnBanco;	
EQUIPO = [];
LOGISTICA = [];
MEJORAS = [];

RESPAWNPOS = [];
RESPAWNDIR = 0;

player setVariable ["VEHICULOS",[],true];
player setVariable ["MUERTES", 0, true];

//CONTROL DEL FINAL
"DMLS_GANADORES" addPublicVariableEventHandler {

	_ArrayGanadores = [_this,1] call BIS_fnc_param;
	cutText ["","BLACK OUT",2]; 

	player EnableSimulation false; 
	player AllowDamage false;

	PlayMusic "Track05_Underwater2";
	0 = [_ArrayGanadores] Spawn
	{
		SetTerrainGrid 6.25;

		_Ganadores = [_this,0] call BIS_fnc_param;			
		_textGanadores = "GANADOR";
		_soyGanador = false;
		if ((count _Ganadores)>1 ) then { _textGanadores = _textGanadores + "ES";};
		{
			if (_x == player) then {_soyGanador = true;};
			_Null =["<t>" + _textGanadores + "</t><br/><t size='0.6'>CON </t><t color='#FF0000' size='0.6'>"+ Format ["%1",(_x getVariable "MUERTES")] + "</t><t size='0.6'> MUERTES</t><br/><br/><t color='#DDFF00'>" + Format ["%1",Name _x] + "</t>",0,-0.3,12,2] spawn BIS_fnc_dynamicText;
			sleep 2;
			cutText ["","BLACK IN",1];				
			_Cam = "Camera" CamCreate (_x modelToWorld [0,5,1]);  
			_Cam CameraEffect ["External", "Back"]; 
			_Cam camSetTarget _x; 
			_Cam camSetRelPos [0,1,1.5]; 
			_Cam camsetFOV 0.5; 
			_Cam camCommit 8; 

			Sleep 10;			
		}forEach _Ganadores;

		["end1",(_soyGanador)] call BIS_fnc_endMission;			
	};
};
};

//LIMITES DE TIEMPO
TIEMPO_Limite = DMLS_ParamDuracion;
TIEMPO_Transcurrido  = 0;
TIEMPO_ConFormato = "";

//*********************************************************
//*********		FUNCIONES PARA EL MP	*******************
//*********************************************************

fnc_DevolverDineroBanco = {DINERO_BANCO;};

//*********************************************************
//***************	PARTIDA SETUP    **********************
//*********************************************************

enableSaving [false, false];
//RADIO OFF
enableSentences false; 
0 fadeRadio 0;
//HORA
setDate [2014,5,7,DMLS_ParamHora,0];
//DISTANCIAS DE VISION
setViewDistance DMLS_ParamDistancia;
setObjectViewDistance DMLS_ParamDistanciaObj;
//CLIMA
skipTime -24;
86400 setOvercast (DMLS_ParamClima / 100);
skipTime 24;
if(DMLS_ParamClima >= 60) then 
{ 
60 setRain (DMLS_ParamClima / 100);
60 setWindForce (DMLS_ParamClima /200);  //Establezco la fuerza del viento
60 setWindStr (DMLS_ParamClima /200);
};
0 = [] spawn { sleep 0.1; simulWeatherSync;};

//CALIDAD DEL TERRENO
setTerrainGrid DMLS_ParamCalidad;

//*********************************************************
//***************	 SERVER SETUP    **********************
//*********************************************************

if (isDedicated) then {
pVarRelampago = false;

//WEST setFriend [WEST, 0];

//		----------------------------------------------
//		---------	Cronometro del server	----------
//		----------------------------------------------
[] spawn {                
	TIEMPO_Inicial = diag_tickTime;
	while {TIEMPO_Transcurrido < TIEMPO_Limite} do {
            TIEMPO_Transcurrido = diag_tickTime - TIEMPO_Inicial;     	     
		sleep 1;
		publicVariable "TIEMPO_Transcurrido";
     	};
	// Uso un publicVariableEH para controlar el final, al acabarse el tiempo busco el jugador/es
	// con mas muertes y se lo paso a la variable que activa el EH en todas las maquinas.
	_MuertesMax = 0;
	_ArrayGanadores = [];
	_Jugadores = [] call BIS_fnc_listPlayers;
	{
		_Muertes = _x getVariable "MUERTES";
		switch (true) Do
		{
			case (_Muertes == _MuertesMax):
			{
				_ArrayGanadores = _ArrayGanadores + [_x];
			};
			case (_Muertes > _MuertesMax):
			{
				_MuertesMax = _Muertes;
				_ArrayGanadores = [_x];
			};
		};
	}forEach _Jugadores;		

	missionNamespace setVariable ["DMLS_GANADORES", _ArrayGanadores]; 
	publicVariable "DMLS_GANADORES";		
};
[] spawn {
	private ["_tiempo","_tiempoFinal_Minutos","_tiempoFinal_Segundos"];
       while{TIEMPO_Transcurrido < TIEMPO_Limite} do {
           _tiempo = TIEMPO_Limite - TIEMPO_Transcurrido;
           _tiempoFinal_Minutos = floor(_tiempo / 60);
           _tiempoFinal_Segundos = floor(_tiempo) - (60 * _tiempoFinal_Minutos);
           if(_tiempoFinal_Segundos < 10) then { _tiempoFinal_Segundos = format ["0%1", _tiempoFinal_Segundos];};
           if(_tiempoFinal_Minutos < 10) then { _tiempoFinal_Minutos = format ["0%1", _tiempoFinal_Minutos];};
           TIEMPO_ConFormato = format ["%1:%2", _tiempoFinal_Minutos, _tiempoFinal_Segundos];
		publicVariable "TIEMPO_ConFormato";
           sleep 1;
       };
   };
//		-----------------------------------------------
//		------------	Satelite espia	   ------------	
//		-----------------------------------------------	
if (DMLS_ParamSatelite != 1000) then {
	[] spawn {
		private ["_tiempo","_tiempoFinal_Minutos","_tiempoFinal_Segundos"];
		_tiempoEspia = DMLS_ParamSatelite;
		while{TIEMPO_Transcurrido < TIEMPO_Limite} do {            
			if (TIEMPO_Transcurrido >= _tiempoEspia) then {
				_Null = [] call CAOE_fnc_SateliteEspia;
				_tiempoEspia = _tiempoEspia + DMLS_ParamSatelite;
			};
		};
	};
};
//		------------------------------------------------
//		---------	Lanzador de suministros	   ---------	
//		------------------------------------------------
[] spawn {
	private ["_tiempoProvIntervalo","_tiempoProvisiones","_bLanzamiento","_bLanzamientoAlt"];
	_tiempoProvIntervalo = TIEMPO_Limite / (DMLS_ParamNumSuministros + 1);
	for "_i" from 1 to DMLS_ParamNumSuministros do {
		_tiempoProvisiones = _tiempoProvIntervalo * _i;
		waitUntil {(TIEMPO_Transcurrido >= _tiempoProvisiones)};
		_bLanzamiento = ["mkZonaDrop"] call CAOE_fnc_LanzarSuministros;
		if (!_bLanzamiento) then {
			_bLanzamientoAlt = ["mkZonaDrop"] call CAOE_fnc_LanzarSuministros;
		};
	};
};
//		----------------------------------------------
//		---------	 Lanzador de Dinero	    ----------	
//		----------------------------------------------
[] spawn {
	private ["_tiempoProvIntervalo","_tiempoProvisiones","_bLanzamiento","_bLanzamientoAlt"];
	_tiempoProvIntervalo = TIEMPO_Limite / (DMLS_ParamNumDinero + 1);
	for "_i" from 1 to DMLS_ParamNumDinero do {
		_tiempoProvisiones = _tiempoProvIntervalo * _i;
		waitUntil {(TIEMPO_Transcurrido >= _tiempoProvisiones)};
		_bLanzamiento = ["mkZonaDrop"] call CAOE_fnc_LanzarDinero;
		if (!_bLanzamiento) then {
			_bLanzamientoAlt = ["mkZonaDrop"] call CAOE_fnc_LanzarDinero;
		};
	};
};

//CARGO OBJETOS PARA EL INICIO DEL SERVER
_Null = execVM "Scripts\iniciarServidor.sqf";
};
endLoadingScreen;

//*********************************************************
//***************	 PLAYER SETUP    **********************
//*********************************************************

if (isMultiplayer && hasInterface) then {

12452 cutText [".: PARTIDA CARGADA :.\n\n· USA EL [ORDENADOR] PARA ESCOJER TU EQUIPACION.\n· USA EL [MAPA] PARA SALTAR A LA ZONA COMBATE.\n\n\n " + Format ["CAERAN %1 SUMINISTROS DURANTE PARTIDA",DMLS_ParamNumSuministros]+ "\n\n" + Format ["%1 TRANSPORTES DE DINERO PASARAN CERCA",DMLS_ParamNumDinero], "BLACK FADED", 50000];
player addRating -10000;
player allowDamage false;
sleep 9;
12452 cutText ["", "PLAIN"];

player addEventHandler ["Killed", {_this execVM "Scripts\EH_Killed.sqf"}];
player addEventHandler ["Respawn", {_this execVM "Scripts\EH_Respawn.sqf"}];

_null = []execVM "HUD\mostrarHUD_Jugador.sqf";	
};

iniciarServidor.sqf

private ["_Iniciado", "_idx", "_jugador", "_Contenedor", "_Mesa", "_Ordenador", "_Mapa", "_Luz","_Silla","_posicion","_Vendedor","_iniTienda","_MostradorA","_MostradorB"];


//Uso una variable publica para indicar cuando el proceso de carga ha terminado

//Oculto los marcadores..
"mkZonaDrop" setMarkerAlpha 0;
"inicioIA_1"  setMarkerAlpha 0;
"inicioIA_2"  setMarkerAlpha 0;
"inicioIA_3"  setMarkerAlpha 0;
"inicioIA_4"  setMarkerAlpha 0;
"inicioIA_5"  setMarkerAlpha 0;
"inicioIA_6"  setMarkerAlpha 0;
"inicioIA_7"  setMarkerAlpha 0;

// Creo los objetos necesarios para el inicio
For "_idx" from 1 to 10 do {

_Contenedor = objNull;
_Mesa = objNull;
_Ordenador = objNull;
_Mapa = objNull;
_Luz = objNull;
_Silla = objNull;

//Creo un contenedor en la posicion del marcador "mkInicial_x" y bloqueo las puertas
_Contenedor = createVehicle ["Land_Cargo20_light_green_F",(getMarkerPos (Format ["mkInicial_%1",_idx])),[],0,"CAN_COLLIDE"];
_Contenedor enableSimulationGlobal false;
_Contenedor setVariable ['bis_disabled_Door_1',1,true];
_Contenedor setVariable ['bis_disabled_Door_2',1,true];

_Mesa = createVehicle ["Land_CampingTable_F",(_Contenedor modelToWorld [0,0,0]),[],0,"CAN_COLLIDE"];
_Ordenador = createVehicle ["Land_Laptop_device_F",(_Contenedor modelToWorld [0,0,0]),[],0,"CAN_COLLIDE"];
_Luz = createVehicle ["Land_Camping_Light_F",(_Contenedor modelToWorld [0,0,0]),[],0,"CAN_COLLIDE"];	
_Silla = createVehicle ["Land_CampingChair_V2_F",(_Contenedor modelToWorld [0,0,0]),[],0,"CAN_COLLIDE"];

_Mapa = createVehicle ["Land_Map_altis_F",(_Contenedor modelToWorld [2.95,0,0.4]),[],0,"CAN_COLLIDE"];	
_Mapa setVectorDir [0,-1,0];
_Mapa setVectorUp [-1,0,0];
_Mapa enableSimulationGlobal false;

_Mesa enableSimulationGlobal false;
_Ordenador enableSimulationGlobal false;
_Luz enableSimulationGlobal false;	
_Silla enableSimulationGlobal false;

[_Contenedor,_Mesa,[-2.35,0,0.175],90] call BIS_fnc_relPosObject;
[_Contenedor,_Ordenador,[-2.35,-0.55,0.975],80] call BIS_fnc_relPosObject;
[_Contenedor,_Luz,[-2.4,0.6,0.975],0] call BIS_fnc_relPosObject;	
[_Contenedor,_Silla,[-1.5,0.55,0.2],90] call BIS_fnc_relPosObject;	


//Añado las acciones pertinentes en MP
[[_Ordenador,"<t color='#FFFF00'>COMPRAR EQUIPO</t>","Scripts\act_Tienda.sqf",0],"CAOE_fnc_AddAction",nil,true] call BIS_fnc_MP;
[[_Mapa,"<t color='#F0A804'>SALTAR A LA ZONA DE COMBATE</t>","Scripts\act_ParacaSaltar.sqf","mkZonaDrop"],"CAOE_fnc_AddAction",nil,true] call BIS_fnc_MP;
};

//Creo las tiendas y los cajeros
For "_idx" from 1 to 2 do {

_posicion = getMarkerPos (Format ["mkTienda_%1",_idx]);
_Vendedor = createVehicle ["C_man_hunter_1_F",_posicion,[],0,"CAN_COLLIDE"];
_Vendedor setPosATL _posicion;
_Vendedor setDir (markerDir (Format ["mkTienda_%1",_idx]));
[[_Vendedor,"BRIEFING"], "BIS_fnc_ambientAnim", nil, true] call BIS_fnc_MP; 
[[_Vendedor,"<t color='#FFFF00'>COMPRAR</t>","Scripts\act_Tienda.sqf",1,3],"CAOE_fnc_AddAction",nil,true] call BIS_fnc_MP; 
_Vendedor allowDamage false;

//CAJEROS
_posicion = getMarkerPos (Format ["mkATM_%1",_idx]);
_Cajero = createVehicle ["Land_Atm_01_F",_posicion,[],0,"CAN_COLLIDE"];
_Cajero enableSimulationGlobal false;
_Cajero setDir (markerDir (Format ["mkATM_%1",_idx]));
[[_Cajero,"<t color='#FFFF00'>INTRODUCIR TARJETA..</t>","Scripts\act_Cajero.sqf"],"CAOE_fnc_AddAction",nil,true] call BIS_fnc_MP;
};

_____________________________________________________________________________________________________________________

[PROB3] When you kill inside a vehicle killCount is not stored:

i use a setVariable command with public parameter on true to set the kills count on "killed" EH

"killed" EH script involving the problem:

_Soldado = [_this,0] call BIS_fnc_param;
_Asesino = [_this,1] call BIS_fnc_param;

if ((_Asesino != _Soldado) && !(isNull _Asesino)) then
{
_MuertesAsesino = _Asesino getVariable ["MUERTES",-1];
};
if (_MuertesAsesino != -1) then {
	_MuertesAsesino = _MuertesAsesino + 1;
	_Asesino setVariable ["MUERTES", _MuertesAsesino, true];
} else {

	hint Format ["NO EXISTE LA VARIABLE EN %1",_Asesino];
};		
};

Fixed?

_Soldado = [_this,0] call BIS_fnc_param;
_Asesino = [_this,1] call BIS_fnc_param;

if ((_Asesino != _Soldado) && !(isNull _Asesino)) then
{

if (!((vehicle _Asesino) isKindOf "man")) then
{
	_Asesino =  (crew _Asesino) select 0;
};

_MuertesAsesino = _Asesino getVariable ["MUERTES",-1];

if (_MuertesAsesino != -1) then {
	_MuertesAsesino = _MuertesAsesino + 1;
	_Asesino setVariable ["MUERTES", _MuertesAsesino, true];
} else {

	hint Format ["NO EXISTE LA VARIABLE EN %1",_Asesino];
};		
};

Edited by KoVValsky

Share this post


Link to post
Share on other sites

This looks like a great mission just from reading about the features, I'll take a deeper look into the code a little later and see what I can do to help. Great work!

Share this post


Link to post
Share on other sites

thank you very much! I will be very grateful for anything you can contribute to the code. There may be many things wrong because I do not have much experience

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×