Jump to content

kovvalsky

Member
  • Content Count

    67
  • Joined

  • Last visited

  • Medals

Everything posted by kovvalsky

  1. i'm playing with FSM, trying to make a homemade Revive script. i know how to do that with EH, but I'm curious and i want to explore other options, if any. :j: maybe with vehicleVarName.. i dont know :j:
  2. on cfgVehicles >> "C_Hatchback_01_F" there is a parameter named brakeIdleSpeed.. WIKI brakeIdleSpeed is speed in m/s under which the brakes are automatically applied to the vehicle. This speed should be reasonably low, higher value would mean strange breaking of slow cars, too low value would cause inability to stop the car. (maybe we can override this parameter)
  3. kovvalsky

    A Whole Lot of Multiplayer Questions

    you can take a look into my mission.. maybe can help you
  4. try to assign default value if westscore not exist: _wscore = server_1 getVariable "westscore"; _wscore = server_1 getVariable ["westscore","westscore not ready"];
  5. this also works.. MISSION_ROOT = call { private "_arr"; _arr = toArray str missionConfigFile; _arr resize (count _arr - 15); toString _arr }; playSound3D [MISSION_ROOT + "yourSoundsFolder\yourSound.ogg", _SoundSource, _isInside, _SoundPos, _SoundVolume, _SoundPitch, _SoundDistance];
  6. I've done something similar recently: this is the script used on AddAction (Detector: ON): oDetector is an object attached to the player (player can take or drop the detector) oHerramienta is the object to find. Both placed on editor _accObjeto = [_this, 0, objNull] call BIS_fnc_param; _accJugador = [_this, 1, objNull] call BIS_fnc_param; _accID = [_this, 2, -1] call BIS_fnc_param; _accArgument = [_this, 3, []] call BIS_fnc_param; oDetector setVariable ['Detector_ON',1,true]; _tiempoGuardado = time; while {((oDetector getVariable ['Detector_ON',0]) == 1)} Do { //if player drop the detector... if ((oDetector getVariable ['Detector_TAKE',1]) == 0) exitWith {oDetector setVariable ['Detector_ON',0,true];}; if (time > _tiempoGuardado) then { playSound3D [MISSION_ROOT + "Sounds\Detector_BEEP.ogg", oDetector, false, (getPosASL oDetector), 4, 1, 40]; //BEARING _pos1 = getpos oHerramienta; _pos2 = getpos _accJugador; _dir1 = ((_pos1 select 0) - (_pos2 select 0)) atan2 ((_pos1 select 1) - (_pos2 select 1)); _dir2 = getdir _accJugador; if (_dir1 < 0) then {_dir1 = 360 + _dir1}; _diff = (_dir2 max _dir1) - (_dir2 min _dir1); if (_diff > 180) then {_diff = abs(_diff - 360)}; _restoDir = ((0.5 * _diff) / 180); //DISTANCE _restoDis = ((oDetector distance oHerramienta)/100); _tiempoGuardado = (time + 0.05) + (_restoDis + _restoDir); }; }; this line can be modified (the script is wip) _restoDis = ((oDetector distance oHerramienta)/100); /100 is the max distance the script emit a BEEP every 0.05 secs plus the distance between the object and player, plus bearing may be you can take any idea..
  7. kovvalsky

    Attached Lights bouncing around

    Very expensive, plus I think they must be local, for use in multiplayer you should use BIS_fnc_MP to create them on each computer
  8. kovvalsky

    Putting fish into a boat

    (BIS Wiki) List of objects (Buildings, Animals, Weapons, Vehicles, etc...) fish name: setVehicleVarName
  9. ok, to use addaction on all clients i usually use a function (on init) like this: myAddActionFunction = { private ["_ActObj","_ActTitle","_ActScript","_ActArgumn","_ActDistan"]; _ActObj = [_this,0] call BIS_fnc_param; _ActTitle = [_this,1] call BIS_fnc_param; _ActScript = [_this,2] call BIS_fnc_param; _ActArgumn = [_this,3,[],["",[],0,objNull]] call BIS_fnc_param; _ActDistan = [_this,4,2,[0]] call BIS_fnc_param; if(isNull _ActObj) exitWith {}; _ActObj addAction [_ActTitle, _ActScript, _ActArgumn, 1, True, True, "", "(_target distance _this) < " + str(_ActDistan)]; } and then i use BIS_fnc_MP like this: _Arguments = [_paramOne, _paramTwo, _paramThree]; _ActionTitle = "AddAction test"; [[_ObjectToAttachAction,_ActionTitle,_ScriptToCall,_Arguments,_ViewActionDistance],"myAddActionFunction",nil,true] call BIS_fnc_MP; i use nil to broadcast over all clients and true to make persistent _Arguments and _ViewActionDistance are Optional
  10. can you explain why u need to pass this using BIS_fn_MP? you need an Action visible on all clients? or what u need?
  11. yes, but BIS_fnc are a functions too.. you can go inside the function to see how it works via "Functions" on editor: BIS_fnc_param BIS_fnc_inTrigger BIS_fnc_countdown
  12. /* ------------------------------------------------------------------------------ FUNCION: fnc_RestriccionZonaCombate ------------------------------------------------------------------------------ DESCRIPCION: Restriccion del jugador a la zona de combate. Se debe ejecutar cada vez que se hace respawn en cada cliente ------------------------------------------------------------------------------ PARAMETROS: 0: [sTRING] marker name 1: [iNTEGER] Countdown 2: [OBJECT] Player ------------------------------------------------------------------------------ EJEMPLO: - Crear un marcador con un area de 50m llamado "mkZonaCombate" 0 = ["mkZonaCombate",15,player] spawn fnc_RestriccionZonaCombate; ------------------------------------------------------------------------------ */ private ["_marcadorArea", "_soldado", "_segundos"]; _marcadorArea = [_this,0] call BIS_fnc_param; _soldado = [_this,1,player,[objNull]] call BIS_fnc_param; _segundos = [_this,2,15,[0]] call BIS_fnc_param; _CuentaAtras = 0; _bEnZonaCombate = false; _aviso = ""; if ((_marcadorArea != "") && ((markerShape _marcadorArea) != "ICON" )) then { waitUntil {alive _soldado}; while {(alive _soldado)} Do { _bEnZonaCombate = [_marcadorArea, (getPosATL _soldado)] call BIS_fnc_inTrigger; if (!_bEnZonaCombate) then { _CuentaAtras = [_segundos,false] call BIS_fnc_countdown; while {(!_bEnZonaCombate) && _CuentaAtras > 0} Do { _CuentaAtras = [0,false] call BIS_fnc_countdown; _aviso = parseText Format ["<t size='2' color='#FF0000' align='center' underline='true'>ATENCION</t><br/><t size='1' color='#FFFFFF'>FUERA DEL LIMITE</t><br/><t size='2.5' align='center'>%1</t><br/><t size='1'>PARA MORIR</t>", round (_CuentaAtras)]; hintSilent _aviso; sleep 0.2; _bEnZonaCombate = [_marcadorArea, (getPosATL _soldado)] call BIS_fnc_inTrigger; }; if (!_bEnZonaCombate) then { while {(alive _soldado)} Do { // [[_soldado,1,true],"BIS_fnc_moduleLightning",nil,false,true] call BIS_fnc_MP; // sleep 1; // code to kill a soldier // (i used a moduleLightning putit on editor with false on triger act, and change to true to kill) // [[_soldado],"CAOE_fnc_Relampago",false,false] call BIS_fnc_MP; }; } else { _aviso = parseText "<t size='2' color='#008000' align='center' >SIN PELIGRO</t>"; hintSilent _aviso; }; }; }; };
  13. Hi all!, I'm doing a DM mission in which players respawn into the air with a parachute. To avoid Friendly fire, i set the rating of every unit to -3000 to make renegades but then they can't use "Open Parachute" action. Any Suggestion to fix that? Maybe with a Custom player action? but I will have the same problem if i try to use UAVs on my mission. Maybe there is another way to avoid friendly fire? :j: Thank you! and sorry for my poor english Cheers!
  14. maybe you need to use BIS_fnc_MP with persistent = true on AddAction.. on init.sqf make a function to all: fnc_MyAddActionFunction = { private ["_ActObj","_ActName","_ActScript","_ActArgumn","_ActCondition"]; _ActObj = [_this,0] call BIS_fnc_param; _ActName= [_this,1] call BIS_fnc_param; _ActScript = [_this,2] call BIS_fnc_param; _ActArgumn = [_this,3,[],["",[],0,objNull]] call BIS_fnc_param; _ActCondition = [_this,4, "(_target distance _this) < 3",[""]] call BIS_fnc_param; if(isNull _ActObj) exitWith {}; _ActObj addAction [_ActName, _ActScript, _ActArgumn, 1, True, True, "",_ActCondition]; }; and then replace: _MHQ addAction["Deploy MHQ","Deploy.sqf",[_MHQ], 0, false, true, "", "_this in (crew _target) && {speed _target < 1}"]; with this [[_MHQ,"<t color='#FFFF00'>Deploy MHQ</t>","Deploy.sqf",[],"_this in (crew _target) && {speed _target < 1}"],"fnc_MyAddActionFunction",nil,true] call BIS_fnc_MP;
  15. 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
  16. 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: and script called when "respawn" EH: _____________________________________________________________________________________________________________________ [PROB2] Sometimes the gun dealer do not appear: init.sqf (at the end of SERVER SETUP section) iniciarServidor.sqf _____________________________________________________________________________________________________________________ [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: Fixed?
  17. yes, the only solution is _Soldier disableAI "AUTOTARGET"; and you specify the target with the radio ---------- Post added at 07:16 ---------- Previous post was at 07:11 ---------- but in your case you can use Civilians: Civilian setFriend [WEST,0]; WEST setFriend [Civilian ,0]; Civilian setFriend [EAST,0]; EAST setFriend [Civilian ,0]; ... use addWeapon to the Civs, or addUniform, etc...
  18. yes, i need to know too.. my mission is a DM, with recruit option.. in my init.sqf i put this line to avoid Friendly fire: WEST setFriend [WEST,0]; and on player Init and player Respawn to make renegades (ENEMY): player addRating -10000; in my tests can't do it.. _Soldier = (group player) createUnit ["B_Soldier_F", player modelToWorld [0,4,0],[],0,"FORM"]; _Soldier addRating (rating player); _Soldier joinAsSilent [(group player),2] _Soldier disableAI "AUTOTARGET"; i think the path to do that is with FSM..
  19. this execVM "clearInventory.sqf"; u need a handle null = this execVM "clearInventory.sqf"; --------------------- and need parentesis if (!local _unit || _unit getVariable ["loadoutDone", FALSE]) exitWith {}; if (!(local _unidad) || (_unidad getVariable ["loadoutDone", FALSE])) exitWith {}; and maybe replace _unit with player (in my tests, when player disconnect and reconnect, soldier still have loadoutDone = true because (i think) when you assign _unit = _this; takes the name of the unit not the player..) sorry by my bad english
  20. kovvalsky

    Creating Civilian Behaviour

    to do that you need to play with FSM: FSM wiki FSM tools my zombie test FSM
  21. hi beaksby. first, markers dont have altitude, are 2D. createMarker you can explain what you need to do? i've writed a supply drop script.. maybe can help you /* ------------------------------------------------------------------------------ FUNCION: fnc_LanzarSuministros ------------------------------------------------------------------------------ DESC: Make a heli and drop a supplyBox with parachute on a random position inside an area. call on server only ------------------------------------------------------------------------------ PARAMETROS: 0: [sTRING] Area Marker name (marker need to have circular) 1: [NUMERO] (Opcional) How far heli has created in meters 2: [NUMERO] (Opcional) Altitude ------------------------------------------------------------------------------ EJEMPLO: - Place a marker with 50m area and name it "mkZonaCombate" ["mkZonaCombate", 2000, 100] call fnc_LanzarSuministros; ------------------------------------------------------------------------------ */ private ["_mkZonaLanzamiento","_Distancia","_Altura","_posIniAleatoria","_posicionInicial","_posicionDrop","_posicionSimetrica","_grp","_HeliDrop","_wpSupply","_wpExit","_Suministros","_paraca","_nombreMarcador","_Marcador","_Completado"]; _mkZonaLanzamiento = [_this,0,"",[""]] call BIS_fnc_param; _Distancia = [_this,1,1200,[0]] call BIS_fnc_param; _Altura = [_this,2,120,[0]] call BIS_fnc_param; _Completado = false; _posIniAleatoria = [(getMarkerPos _mkZonaLanzamiento), _Distancia, (floor (random 360))] call BIS_fnc_relPos; _posicionInicial = [(_posIniAleatoria select 0),(_posIniAleatoria select 1),(_Altura + 30)]; _posicionDrop = [[_mkZonaLanzamiento]] call BIS_fnc_randomPos; _posicionSimetrica = [((_posicionDrop select 0) * 2) - (_posicionInicial select 0),((_posicionDrop select 1) * 2) - (_posicionInicial select 1), (_Altura + 30)]; _grp = createGroup WEST; _HeliDrop = [_posicionInicial, ([_posicionInicial, _posicionDrop] call BIS_fnc_dirTo), "I_Heli_Transport_02_F", _grp] call BIS_fnc_spawnVehicle; _wpSupply = _grp AddWaypoint [_posicionDrop,0]; _wpExit = _grp AddWaypoint [_posicionSimetrica,0]; _wpSupply setWaypointType "MOVE"; _wpExit setWaypointType "MOVE"; (_HeliDrop select 0) flyInHeight _Altura; waitUntil {((currentWaypoint _grp) == 2) || (!canMove(_HeliDrop select 0))}; if (canMove(_HeliDrop select 0)) then { _HeliPos = getPosATL (_HeliDrop select 0); _paraca = createVehicle ["B_Parachute_02_F", [_HeliPos select 0,_HeliPos select 1,(_HeliPos select 2)-8], [], 0, "CAN_COLLIDE"]; _Suministros = createVehicle ["B_supplyCrate_F", [_HeliPos select 0,_HeliPos select 1,(_HeliPos select 2)-10], [], 0, "CAN_COLLIDE"]; _Suministros attachTo [_paraca,[0,0,0]]; _Suministros allowDamage false; clearMagazineCargoGlobal _Suministros; clearWeaponCargoGlobal _Suministros; clearItemCargoGlobal _Suministros; clearBackpackCargoGlobal _Suministros; _Suministros addMagazineCargoGlobal ["30Rnd_65x39_caseless_green",50]; _Suministros addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag",50]; _Suministros addMagazineCargoGlobal ["30Rnd_556x45_Stanag",20]; _Suministros addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag",10]; _Suministros addMagazineCargoGlobal ["150Rnd_762x51_Box",5]; _Suministros addMagazineCargoGlobal ["20Rnd_762x51_Mag",20]; _Suministros addMagazineCargoGlobal ["10Rnd_762x51_Mag",20]; _Suministros addMagazineCargoGlobal ["7Rnd_408_Mag",15]; _Suministros addMagazineCargoGlobal ["5Rnd_127x108_Mag",15]; _Suministros addMagazineCargoGlobal ["5Rnd_127x108_APDS_Mag",15]; _Suministros addMagazineCargoGlobal ["200Rnd_65x39_cased_Box",15]; _Suministros addMagazineCargoGlobal ["RPG32_F",5]; _Suministros addMagazineCargoGlobal ["RPG32_HE_F",5]; _Suministros addMagazineCargoGlobal ["NLAW_F",5]; _Suministros addMagazineCargoGlobal ["Titan_AA",5]; _Suministros addMagazineCargoGlobal ["Titan_AP",5]; _Suministros addMagazineCargoGlobal ["3Rnd_UGL_FlareWhite_F",5]; _Suministros addMagazineCargoGlobal ["UGL_FlareWhite_F",5]; _Suministros addMagazineCargoGlobal ["HandGrenade",15]; _Suministros addMagazineCargoGlobal ["MiniGrenade",15]; _Suministros addMagazineCargoGlobal ["SmokeShell",15]; _Suministros addMagazineCargoGlobal ["APERSMine_Range_Mag",10]; _Suministros addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag",10]; _Suministros addMagazineCargoGlobal ["APERSTripMine_Wire_Mag",10]; _Suministros addMagazineCargoGlobal ["SLAMDirectionalMine_Wire_Mag",5]; _Suministros addItemCargoGlobal ["optic_Arco",5]; _Suministros addItemCargoGlobal ["optic_Hamr",5]; _Suministros addItemCargoGlobal ["optic_MRCO",5]; _Suministros addItemCargoGlobal ["optic_DMS",5]; _Suministros addItemCargoGlobal ["optic_LRPS",5]; _Suministros addItemCargoGlobal ["FirstAidKit", 2]; _Suministros addItemCargoGlobal ["Rangefinder", 1]; _Suministros addItemCargoGlobal ["muzzle_snds_H", 1]; _Suministros addItemCargoGlobal ["muzzle_snds_H_MG", 1]; _Suministros addItemCargoGlobal ["muzzle_snds_M", 1]; _Suministros addItemCargoGlobal ["muzzle_snds_B", 1]; if !(isNull _paraca) then { waitUntil {isNull _paraca}; deleteVehicle _paraca; // _Suministros allowDamage true; }; _nombreMarcador = Format ["mk%1Supply%2", str(floor(random 500)),str(floor(random 500))]; _Marcador = createMarker [_nombreMarcador,(getPosATL (_Suministros))]; _Marcador setMarkerShape "ICON"; _Marcador setMarkerType "b_unknown"; _Marcador setMarkerText "Suministros"; _Marcador setMarkerAlpha 1; waitUntil {((currentWaypoint _grp) == 3) || (!canMove(_HeliDrop select 0))}; {deleteVehicle _x} forEach crew (_HeliDrop select 0); waitUntil {(count crew (_HeliDrop select 0)) == 0}; deleteVehicle (_HeliDrop select 0); _Completado = true; } else { _aviso = parseText "<t size='2' color='#FF0000' align='center' underline='true'>ATENCION</t><br/><br/><t size='1' color='#FFFFFF'>SUMINISTROS INTERCEPTADOS</t><br/><t color='C0C0C0'>SE INTENTARA MANDAR OTRO</t>"; [_aviso,"fnc_Hint",true,false] call BIS_fnc_MP; sleep 10; {deleteVehicle _x} forEach crew (_HeliDrop select 0); waitUntil {(count crew (_HeliDrop select 0)) == 0}; deleteVehicle (_HeliDrop select 0); }; _Completado;
  22. hi Iceman77, thankyou very much! i try to explain it. I have a UI Dialog (shop) with two lists. When you buy a item, i need to ask to the player something using a Yes/No dialog, but in some cases i need more options to ask (Yes/No/Add to...) so i try to make a custom msgBox dialog with no success.. Anyway i will send my mission as soon as possible
  23. Hi, im trying to do a messageBox Dialog control. I have one dialog called "FirstDialog" and i need to ask something to the player inside "FirstDialog".. so i make another dialog called "MsgBox_Dialog". (maybe this is the problem.. dont know) Both are defined in description.ext like class "FirstDialog" { class controls { blah, blah }; }; class MsgBox_Dialog { idd = 5000; duration = 7200; onLoad = ""; controls[]= { DMLS_MsgBox_Frame, DMLS_MsgBox_Fondo, DMLS_MsgBox_Pregunta, DMLS_MsgBox_Btn0, DMLS_MsgBox_Btn1, DMLS_MsgBox_Btn2 }; class DMLS_MsgBox_Frame: IGUIBack { idc = 5010; x = 0.293752 * safezoneW + safezoneX; y = 0.357047 * safezoneH + safezoneY; w = 0.412495 * safezoneW; h = 0.263914 * safezoneH; }; class DMLS_MsgBox_Fondo: RscFrame { idc = 5011; x = 0.293752 * safezoneW + safezoneX; y = 0.357047 * safezoneH + safezoneY; w = 0.412495 * safezoneW; h = 0.263914 * safezoneH; }; class DMLS_MsgBox_Pregunta: RscStructuredText { idc = 5001; x = 0.304065 * safezoneW + safezoneX; y = 0.37904 * safezoneH + safezoneY; w = 0.39187 * safezoneW; h = 0.175943 * safezoneH; }; class DMLS_MsgBox_Btn0: RscButton { idc = 5020; x = 0.613436 * safezoneW + safezoneX; y = 0.565978 * safezoneH + safezoneY; w = 0.082499 * safezoneW; h = 0.0439856 * safezoneH; }; class DMLS_MsgBox_Btn1: RscButton { idc = 5021; x = 0.510312 * safezoneW + safezoneX; y = 0.565978 * safezoneH + safezoneY; w = 0.082499 * safezoneW; h = 0.0439856 * safezoneH; }; class DMLS_MsgBox_Btn2: RscButton { idc = 5022; x = 0.304065 * safezoneW + safezoneX; y = 0.565978 * safezoneH + safezoneY; w = 0.185623 * safezoneW; h = 0.0439856 * safezoneH; }; }; i make a function to call it: class CfgFunctions { class CAOE { class logic { class MsgBox {}; }; }; }; CAOE_fnc_MsgBox.sqf /* ------------------------------------------------------------------------------ FUNCION: CAOE_fnc_MsgBox ------------------------------------------------------------------------------ DESCRIPCION: Crea un msgBox ------------------------------------------------------------------------------ PARAMETROS: 0: [sTRING] structured text - question 1: [sTRING] Button 1 2: [sTRING] (Optional) Button 2 3: [sTRING] (Optional) Button 3 ------------------------------------------------------------------------------ RETURN: [sTRING] Button selected ------------------------------------------------------------------------------- EXAMPLE: _Msg = "<t size='2' color='#FF0000' align='center' underline='true'>ATENTION</t><br/><t size='1.25' color='#FFFFFF'>You are a code master?</t>"; _Return = [_Msg,"Yes","No"] call CAOE_fnc_MsgBox; ------------------------------------------------------------------------------ */ private["_Contenido","_Btn0","_Btn1","_Btn2","_Retorna"]; _Contenido =[_this,0,"",[""]] call BIS_fnc_param; _Btn0 = [_this,1,"",[""]] call BIS_fnc_param; _Btn1 = [_this,2,"",[""]] call BIS_fnc_param; _Btn2 = [_this,3,"",[""]] call BIS_fnc_param; _msgBoxDialog = createDialog "MsgBox_Dialog"; waitUntil {_msgBoxDialog}; _TextCtrl = (findDisplay 5000 displayCtrl 5001); _Btn0Ctrl = (findDisplay 5000 displayCtrl 5020); _Btn1Ctrl = (findDisplay 5000 displayCtrl 5021); _Btn2Ctrl = (findDisplay 5000 displayCtrl 5022); _TextCtrl ctrlSetStructuredText parseText _Contenido; uiNamespace setVariable ["msgBox","-1"]; switch (true) Do { case (_Btn0 != "" && _Btn1 == "" && _Btn2 == ""): { _Btn0Ctrl ctrlSetText _Btn0; _Btn0Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn0]}]; //TODO: I need to close dialog when choose an option _Btn1Ctrl ctrlShow false; _Btn2Ctrl ctrlShow false; }; case (_Btn0 != "" && _Btn1 != "" && _Btn2 == ""): { _Btn0Ctrl ctrlSetText _Btn0; _Btn0Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn0]}]; //TODO: I need to close the dialog when choose an option _Btn1Ctrl ctrlSetText _Btn1; _Btn1Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn1]}]; //TODO: I need to close the dialog when choose an option _Btn2Ctrl ctrlShow false; }; case (_Btn0 != "" && _Btn1 != "" && _Btn2 != ""): { _Btn0Ctrl ctrlSetText _Btn0; _Btn0Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn0]}]; //TODO: I need to close the dialog when choose an option _Btn1Ctrl ctrlSetText _Btn1; _Btn1Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn1]}]; //TODO: I need to close the dialog when choose an option _Btn2Ctrl ctrlSetText _Btn2; _Btn2Ctrl ctrlAddEventHandler ["onMouseButtonClick",{uiNamespace setVariable ["msgBox",_Btn2]}]; //TODO: I need to close the dialog when choose an option }; }; waitUntil {!dialog}; //ERROR ON THIS LINE _Retorna = uiNamespace getVariable ("msgBox"); _Retorna; and finally i call the function: _Msg = "<t size='2' color='#FF0000' align='center' underline='true'>ATENTION</t><br/><t size='1.25' color='#FFFFFF'>You are a code master?</t>"; _return = [_Msg,"Yes","No"] call CAOE_fnc_MsgBox; if (_return == "Yes") then { hint str("I'm a codemaster"); } else { hint str("I need help"); }; The problem is the waitUntil command at the end of CAOE_fnc_MsgBox.sqf.. doesn't work and i don't know why. Is there any way to do this? or any template to use? or something? thanks!!
  24. Aargh .. I have not found the solution yet I will use "BIS_fnc_guiMessage" instead..
  25. thanks DreadedEntity. i take look to that.. but when i call "FirstDialog" i use this: pasedTo_AddActionScript.sqf createDialog "FirstDialog"; waitUntil {dialog}; 0 = [] spawn { private ["_comboCtrl","_listCtrl","_treeCtrl"]; disableSerialization; _comboCtrl = (findDisplay 4000 displayCtrl 4001); _listCtrl = (findDisplay 4000 displayCtrl 4002); _treeCtrl = (findDisplay 4000 displayCtrl 4021); ... ... }; inside _listCtrl i have a onLBDblClick = "[_this] call CAOE_fnc_ConfigureThings;" ctrlEventHandler. And inside fn_ConfigureThings.sqf i call the msgBox with another call structure: [font=Courier New] pasedTo_AddActionScript.sqf [color="#008000"]* First call using Spawn[/color] 0 = Spawn [ [color="#008000"] * 2ond call using CtrlEventHandler (function called is defined in description.ext)[/color] call CAOE_fnc_ConfigureThings [ [color="#008000"] * 3th call using a function defined in desc.ext too[/color] call CAOE_fnc_MsgBox [ [color="#FF0000"]waitUntil Error[/color] ] } ] [/font] is a scheduled env?
×