Jump to content

HonzaVinCZ

Member
  • Content Count

    77
  • Joined

  • Last visited

  • Medals

Everything posted by HonzaVinCZ

  1. HonzaVinCZ

    How can I simplify this script?

    Thank you! I saw scripts like very often used in Exile but there's dynamic weather hard coded to be very often rainy. Also I wanted to try make dynamic weather script on my own, I wanted to learn something new.
  2. HonzaVinCZ

    How can I simplify this script?

    I had no idea that there can be dynamic weather generated by Arma engine itself.
  3. HonzaVinCZ

    How can I simplify this script?

    Oh that... I floored it there just for sure of performance. For example if the calculation results in number like 0,5444444444... . Not sure if it helps somehow. Is the floor useless here? You right, I'm just blind. Will move that under _timeTrue condition. Mistaken it with setTimeMultiplier, didn't read it when I was switching between browser and text editor. Thank you, will take look on it.
  4. HonzaVinCZ

    How can I simplify this script?

    As I said, I'm not very experienced and I'm very amateur in scripting. It suprised myself that this script actually works well but had no idea how could I optimise it. Will use that, thank you. Sorry, I have no idea how this works, never worked with that. Because I was not sure if the value was a bit different due to some lag or something, the "if" condition would then be false. I was working with that it outputs dayTime in HH:MM:SS but just now realised I can put there "HH" condition so I don't need floor condition anymore if I'm right - sometimes I just don't know what I'm doing and just only testing what will work. Didn't even notice that, thank you. There's _weather = true condition for turning the weather on/off. I don't want to disable whole script in init because there are more functions in one script I can enable or disable. It does. If it is true, it will enable using of scripted time. If _time = 10, then the script will skip time to make mission start time 10:00. If it is false, the condition will not be executed so there will be default time set in editor on mission start.
  5. Hey guys, I need you to help me with this script. Basically this script creates markers on selected vehicles and makes markers move with vehicles. Problem with this script is, that it cannot find target vehicle after vehicle was destroyed and respawned by other script I'm attaching under my actual script. It even won't work if vehicle name is set in editor. Any idea how could I make marker find vehicle again, change text to not destroyed and move with that vehicle again please? scripts\VehicleMarkers.sqf scripts\Vehicle.sqf ( Vehicle respawn script )
  6. HonzaVinCZ

    [Help] Custom Vehicle Markers

    That is just perfect! Thank you a lot! Oh yes, I'm still beginner in scripting so I know about it little. I can create something that works but I have no idea what it could do with performance. Also I'm basically learning C++ in Arma engine and that's also not ideal but I actually don't use C++ anywhere else.
  7. Hello, guys. I have done this script but it won't take away instigator's score and shows "any" instead of -100 points in system message. Any help please? Also if possible, could you give me a advice how to set message to show score ammount taken not in minus? Thank you! // Turn Punishments ON/OFF _run = true; // Turn Civillian Punishment ON/OFF //_civillianPunishment = true; // How many points take away to instigator for civillian killed - WORKS ONLY IF _civillianPunishment = true _civilianPunishmentPoints = -100; // Turn Team Kill Punishment ON/OFF //_teamKillPunishment = true; // How many points take away to instigator for teamkill - WORKS ONLY IF _teamKillPunishment = true _teamKillPunishmentPoints = -100; if (_run) then { addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; // UAV/UGV player operated road kill if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; // player driven vehicle road kill if (isNull _instigator) then { _instigator = _killer }; // Civillian Punishment if ((side group _killed == civilian) && (isPlayer _instigator)) then { if (isServer) then { _instigator addScore _civilianPunishmentPoints}; systemChat format ["%1 killed a civilian, he loses %2 score.", name _instigator, _teamKillPunishmentPoints]; }; // Team Kill Punishment if ((side group _killed == side _instigator) && (isPlayer _instigator)) then { if (isServer) then { _instigator addScore _teamKillPunishmentPoints}; systemChat format ["%1 did a team kill, he loses %2 score.", name _instigator, _teamKillPunishmentPoints]; }; }]; };
  8. I was so lucky and I had to laugh what I noticed. In this situation you need to type variable without that "_" and then it will work. I was trying everything and then I tried to remove those "_" in variables containing just number and it worked! So then I could finish this script. Not sure with using "if-then" in this situation to turn on/off civilian or team kill punishment... it was just not working if even "if" was true so I removed that and let script be like this: // Turn Punishments ON/OFF _run = true; // How many points take away to instigator for civillian killed civilianPunishmentPoints = -100; // How many points take away to instigator for teamkill teamKillPunishmentPoints = -100; // Score to kick for is <= kickPoints kickPoints = -500; if ((_run) && (isServer)) then { civilianPunishmentPointsABS = abs civilianPunishmentPoints; teamKillPunishmentPointsABS = abs teamKillPunishmentPoints; addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; // UAV/UGV player operated road kill if (isNull _instigator) then { _instigator = UAVControl vehicle _killer select 0 }; // player driven vehicle road kill if (isNull _instigator) then { _instigator = _killer }; // Civillian Punishment if ((side group _killed == civilian) && (isPlayer _instigator)) then { _instigator addScore civilianPunishmentPoints; systemChat format ["%1 killed a civilian, he loses %2 score.", name _instigator, civilianPunishmentPointsABS]; }; // Team Kill Punishment if ((side group _killed == side _instigator) && (isPlayer _instigator)) then { _instigator addScore teamKillPunishmentPoints; systemChat format ["%1 did a team kill, he loses %2 score.", name _instigator, teamKillPunishmentPointsABS]; }; // Kick For Too Bad Points if ((score _instigator <= kickPoints) && (isPlayer _instigator)) then { _uid = getPlayerUID _instigator; systemChat format ["%1 has been kicked for killing too many civillians and/or team kills", name _instigator]; serverCommand format ["#kick %1", _uid]; }; }]; }; Hopefully someone find it helpful!
  9. So... I still didn't found how to make it work. The problem are just number variables. When I set numbers in addScore manually, it works well but it won't work with variables I set. I must have it written wrong so I would like to ask you how I could write those number variables right because I have no idea how to write it.
  10. Hello, guys. I have very simple script but it shows error. I don't know how about you but I'm sure I have it written correctly because it was working in my old mission and in new one it won't work. Any help please? Vehicle init: _this = execVM "scripts\Auto_Rearm.sqf"; scripts\Auto_Rearm.sqf: // Define Variables _unit = _this select 0; // Start loop while {true} do { _unit setVehicleAmmo 1; sleep 300; };
  11. HonzaVinCZ

    Simple script shows error

    Well, it works also until the vehicle is destroyed. After vehicle respawn it shows vehicle marker on grid 000... . Maybe I'm so bad I can't use your scripts properly or I don't know. I'm really lost in this situation. Also I was using script vehicle respawn I attached above because the editor module respawn is broken and spawns vehicles in walls and not properly on the place.
  12. HonzaVinCZ

    Simple script shows error

    Oh, nevermind... I overlook script and mistaken just the name with your aircraft pylon script. Btw this is the vehicle respawn script I was using before ZaellixA script test. /* ================================================================================================================== Simple Vehicle Respawn Script v1.81 for Arma 3 by Tophe of Östgöta Ops [OOPS] and tweaked for I&A 3 by Rarek [AW] Put this in the vehicles init line: veh = [this] execVM "vehicle.sqf" Options: There are some optional settings. The format for these are: veh = [object, Delay, Deserted timer, Respawns, Effect, Dynamic] execVM "vehicle.sqf" Default respawn delay is 30 seconds, to set a custom respawn delay time, put that in the init as well. Like this: veh = [this, 15] execVM "vehicle.sqf" Default respawn time when vehicle is deserted, but not destroyed is 120 seconds. To set a custom timer for this first set respawn delay, then the deserted vehicle timer. (0 = disabled) Like this: veh = [this, 15, 10] execVM "vehicle.sqf" By default the number of respawns is infinite. To set a limit first set preceding values then the number of respawns you want (0 = infinite). Like this: veh = [this, 15, 10, 5] execVM "vehicle.sqf" Set this value to TRUE to add a special explosion effect to the wreck when respawning. Default value is FALSE, which will simply have the wreck disappear. Like this: veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf" By default the vehicle will respawn to the point where it first was when the mission started (static). This can be changed to dynamic. Then the vehicle will respawn to the position where it was destroyed. First set all preceding values then set TRUE for dynamic or FALSE for static. Like this: veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf" If you you want to set the INIT field of the respawned vehicle, first set all other values, then set init commands. Those must be inside quotations. Like this: veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf" Default values of all settings are: veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" Contact & Bugreport: cwadensten@gmail.com ================================================================================================================== */ if (!isServer) exitWith {}; // Define variables _unit = [_this,0,objNull,[objNull]] call BIS_fnc_param; _delay = [_this,1,30,[0]] call BIS_fnc_param; _deserted = [_this,2,120,[0]] call BIS_fnc_param; _respawns = [_this,3,0,[0]] call BIS_fnc_param; _explode = [_this,4,false,[true]] call BIS_fnc_param; _dynamic = [_this,5,false,[true]] call BIS_fnc_param; _unitinit = [_this,6]; _haveinit = if (count _this > 6) then { true } else { false }; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; if (["B_UAV", _type] call BIS_fnc_inString) then { createVehicleCrew _unit; }; if (_haveinit) then { _unit call compile format ["%1=_This; PublicVariable '%1'",_unitinit]; }; if (_hasname) then { _unit setVehicleVarName _unitname; _unit call compile format ["%1=_This; PublicVariable '%1'",_unitname]; }; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; }; }; Also did not try your script so give me time please. Thank you!
  13. HonzaVinCZ

    Simple script shows error

    I tried your script and it doesn't work. I got huge fps spike so it propably execvm-ing this script after vehicle respawn continously with using editor module respawn. I was using GOM's vehicle respawn script before and it showed error on his 123 line when I was using my script on same vehicle. I spent whole morning solving how to make it work but still not lucky. My actual not working script: /* Vehicle init veh = [this,2] execVM "scripts\VehicleMarkers.sqf"; - vehicle name - Text Text: 1 = Repair Truck 2 = Fuel Truck 3 = Ammo Truck 4 = MHQ */ _unit = _this select 0; _text = _this select 1; _randomnumber = random 1000000; _nameMarker = "Markername" + (str _randomnumber); createMarker [_nameMarker, getPosVisual _unit]; if (_text == 1 or _text == 2 or _text == 3) then { _nameMarker setMarkerType "b_unknown"; }; if (_text == 4) then { _nameMarker setMarkerType "b_hq"; }; _nameMarker setMarkerColor "ColorBLUFOR"; if (_text == 1) then { _nameMarker setMarkerText "Repair truck"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck"; }; if (_text == 4) then { _nameMarker setMarkerText "HQ"; }; while {alive _unit} do { _nameMarker setMarkerPos (getPosVisual _unit); sleep 5; }; if (_text == 1) then { _nameMarker setMarkerText "Repair truck is destroyed"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck is destroyed"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck is destroyed"; }; if (_text == 4) then { _nameMarker setMarkerText "MHQ is destroyed"; }; _unit addEventHandler["Respawn", { private _respawnUnit = _this select 0; _respawnUnit removeEventHandler _thisEventHandler; deleteMarker _nameMarker; [_unit, _text] execVM "scripts\VehicleMarkers.sqf"; }];
  14. HonzaVinCZ

    Simple script shows error

    Thank you a lot! I have one more problem and it is this script: VehicleMarkers.sqf _unit = _this select 0; _text = _this select 1; _randomnumber = random 100 + random 100; _nameMarker = "Markername" + (str _randomnumber); _debug = true; createMarker [_nameMarker, getPosVisual _unit]; _nameMarker setMarkerType "hd_dot"; _nameMarker setMarkerColor "ColorBlue"; if (_text == 1) then { _nameMarker setMarkerText "Repair truck"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck"; }; while {true} do { if (alive _unit) then { _nameMarker setMarkerPos getPosVisual _unit; if (_text == 1) then { _nameMarker setMarkerText "Repair truck"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck"; }; } else { if (_text == 1) then { _nameMarker setMarkerText "Repair truck is destroyed"; }; if (_text == 2) then { _nameMarker setMarkerText "Fuel truck is destroyed"; }; if (_text == 3) then { _nameMarker setMarkerText "Ammo truck is destroyed"; }; }; sleep 3; }; Vehicle var: Franta vehicle init: veh = [this, 30, 120, 0, FALSE, FALSE] execVM "scripts\vehicle.sqf"; _this = [Franta,2] execVM "scripts\VehicleMarkers.sqf"; as you see, I'm very beginner... so, my point is to make marker move with unit, in my case with vehicle and if it is destroyed, it just changes to "destroyed" text and after it respawns, marker should move to vehicle and text should be same as before it was destroyed but that doesn't work. I have set in respawn script vehicleVarName to save it and in editor there's vehicleVarName set. So when vehicle is destroyed and it respawns, marker won't move to respawned vehicle but varName still exists when I try Franta(vehicleVarName) setDamage 1; . Any idea please? Please try as easiest script as you can so I can understand it, thank you!
  15. Hello, I'm working with editor placed markers and I need to set marker alpha to 1 just for BLUFOR when OPFOR enters trigger area and then to 0 when OPFOR leaves the area. I have done it by trigger but marker alpha is set to all players and that's what I don't want. I have script that sets the marker alpha for BLUFOR and OPFOR on the mission init, here it is: if (!isDedicated) then { {_x setMarkerAlphaLocal 0} forEach ["OMHQ_1M","BMHQ_1M","iedfacm_1","weapfacm_1","weapfacm_2","bluM_1","bluM_2","bluM_3","bluM_4","bluM_5","bluM_6","bluM_7","opfM_1","opfM_2","opfM_3","opfM_4","opfM_5","opfM_6","opfM_7","bluMZ_1"]; waitUntil {!isNull player}; switch (side player) do { case WEST: { {_x setMarkerAlphaLocal 1} forEach ["BMHQ_1M","bluM_1","bluM_2","bluM_3","bluM_4","bluM_5","bluM_6","bluM_7","bluMZ_1"]; }; case EAST: { {_x setMarkerAlphaLocal 1} forEach ["OMHQ_1M","opfM_1","opfM_2","opfM_3","opfM_4","opfM_5","opfM_6","opfM_7","iedfacm_1","weapfacm_1","weapfacm_2"]; }; }; }; but it works only to markers that doesn't change their own alpha. Marker zone I want to make is called "bluMZ_1".
  16. HonzaVinCZ

    setMarkerAlpha for one side

    Well, thank you. But I still don't know how to set that alpha just for one side.
  17. HonzaVinCZ

    setMarkerAlpha for one side

    I'm not sure how to create that local marker or more markers just for OPFOR, could you tell me please? It's a mp mission so players are going to join and leave.
  18. HonzaVinCZ

    SVBIED

    Hello, I need you to help me with my small simple script that doesn't work. It always shows error in line 12 and I have no idea why. It should work but it doesn't. It's called in vehicle init by: vehbomb = [this] execVM "scripts\iedTruck.sqf"; This is iedTruck.sqf: if (!isServer) exitWith {}; _vehicle = _this select 0; while {alive _vehicle} do { sleep 1; if ({alive _x} count _vehicle < 1) then { if (west countSide (getPos _vehicle nearEntities 15) >0) then { "Bo_GBU12_LGB" createVehicle getPos _vehicle; }; }; }; *EDIT* I'd like to ask someone to move this thread to Arma 3 Editing and scripting. Created it here by mistake, thank you!
  19. HonzaVinCZ

    SVBIED

    I'm suprised how easy is that. I didn't realize I can use event handler. Thank you a lot! That's my script after edit: if (!isServer) exitWith {}; _vehicle = _this select 0; _vehicle addEventHandler ["GetIn", {hint "This is SVBIED vehicle"}]; while {alive _vehicle} do { if ((player in _vehicle) and (west countSide (getPos _vehicle nearEntities 15) >0)) then { "Bo_GBU12_LGB" createVehicle getPos _vehicle; }; waitUntil {!(player in _vehicle)}; };
  20. HonzaVinCZ

    SVBIED

    Hey! Thank you for answer. Basically whole game was broken and it showed error on that 12 line. There was in the error something like " };|#| " like something missing. I tried to edit it but even simple script that loops nothing didn't work. So I restarted game and then it finally worked as it should. I did small mistake in script anyway but my current script looks like this: if (!isServer) exitWith {}; _vehicle = _this select 0; while {alive _vehicle} do { if ((player in _vehicle) and (west countSide (getPos _vehicle nearEntities 15) >0)) then { "Bo_GBU12_LGB" createVehicle getPos _vehicle; }; sleep 1; }; I'd like to add hint on vehicle enter that shows only to that player who enters the vehicle. If possible only to east side, something like hint "This is SVBIED vehicle". But I don't know how to manage it to add it without repeating that message in that "while" condition.
  21. Hello there. I'd like to ask you for help with BIS Dynamic Groups. This is what I use: initPlayerLocal.sqf ["InitializePlayer", [player]] call BIS_fnc_dynamicGroups; initServer.sqf ["Initialize"] call BIS_fnc_dynamicGroups; The problem is that when I press "U" it shows the menu but when I press create group button it doesn't do anything. Mission is hosted on dedicated server and everyone who joins has the same problem. All other scripts I use works well. Any ideas please?
  22. HonzaVinCZ

    BIS Dynamic Groups doesn't work.

    Any help please? Created two days ago and still no help.
  23. Hello, I'd like to ask you for help with this thing. I use Light Vehicle Respawn Script and I don't know how to keep vehicle name and init after respawn. I tried its functions but unsuccessfully. It doesn't save the vehicle name and it shows error on vehicle respawn if I use following: functions.sqf: /* Register new vehicle init functions here - (see hunterInit below and fn_hunterInit.sqf) */ class LVR { class vehInitFncs { file = "LVR\functions"; class vehRespawn {}; //main respawn function - Do Not Delete class OHQ {}; // Example - Can Be Deleted }; }; fn_OHQ.sqf: /* Example Vehicle Init - Can Be deleted */ _this = [this, 1000, east, "LIGHT"] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf"; _this = [ this, 120, 60, LVR_fnc_OHQ ] spawn LVR_fnc_vehRespawn; And this is my teleport script: _dest = (_this select 3) select 0; if (alive _dest && west countSide (getPos _dest nearEntities 300) ==0) then { _dir = random 359; _spot = getPosATL _dest; cutText ["","BLACK OUT",4]; [parseText "<t font='PuristaBold' size='1.6'>Moving in progress...</t><br />Hold on soldier", true, nil, 4, 0.7, 0] spawn BIS_fnc_textTiles; sleep 5; player setDir _dir; player SetPosATL (_spot vectorAdd [10 - random 10, 10 - random 10,0]); cutText ["","BLACK IN",2]; } else { [parseText "<t font='PuristaBold' size='1.6'>HQ is unavaible</t>", true, nil, 3, 0.7, 0] spawn BIS_fnc_textTiles; }; OHQ1 vehicle init: _this = [this, 1000, east, "LIGHT"] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf"; _this = [ this, 120, 60, LVR_fnc_OHQ ] spawn LVR_fnc_vehRespawn; It shows some error on OHQ1 respawn. It respawns successfully but name and init of that vehicle is lost. Is there any other way how to make it save the name and init please? I'm not very friendly with editor respawn module because it respawns vehicles by very weird way and it keeps crashing vehicles to each others when they respawn.
  24. HonzaVinCZ

    daytime

    So there is my final script. It changes weather every hour depending on game time acceleration. This is my first script I did by myself. I'm so happy. But there could be some better way how to write this, am I right? Can be this stressful for server? _weather = true; // Set dynamic weather on/off. Value: true/false. Default: true _timeMultiplier = 24; // Set time acceleration. Value: 0.1-120. Default: 1 _delay1Hour = 3600 / _timeMultiplier; _delay1HourFloored = floor _delay1Hour; _delayHalfHour = _delay1HourFloored / 2; _delayHalfHourFloored = floor _delayHalfHour; setTimeMultiplier _timeMultiplier; while {_weather} do { _daytime = floor daytime; _value = selectRandom [0.1, 0.2, 0.3, 0.4, 0.5]; if (_daytime == 1) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 2) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 3) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0.5; }; if (_daytime == 4) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 5) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 6) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 7) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 8) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 9) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 10) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 11) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 12) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0.0; }; if (_daytime == 13) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 14) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 15) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 16) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0.0; }; if (_daytime == 17) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 18) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0.0; }; if (_daytime == 19) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 20) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 21) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0; }; if (_daytime == 22) then { _delayHalfHourFloored setOvercast 1; _delayHalfHourFloored setRain 1; _delayHalfHourFloored setFog 0.5; }; if (_daytime == 23) then { _delayHalfHourFloored setOvercast 1; _delayHalfHourFloored setRain 1; _delayHalfHourFloored setFog 0.5; }; if (_daytime == 24) then { _delayHalfHourFloored setOvercast _value; _delayHalfHourFloored setRain 0; _delayHalfHourFloored setFog 0.3; }; sleep _delayHalfHourFloored; };
  25. HonzaVinCZ

    daytime

    Hello, I'm trying to get the server gametime into the script but it won't work for me. This is Weather.sqf and game shows error in _time = daytime; . When I tried to make _hour = floor daytime; it again shows error. I'm really lost with this. Could anyone help me please? while {true} do _time = daytime; _hour = floor _time; _delayOvercast = 1800; _delayRain = 1800; _delayFog = 1800; _value = selectRandom [0.1, 0.2, 0,3]; if (_hour == 2) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0; } if (_hour == 4) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.5; }; if (_hour == 5) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.0; } if (_hour == 12) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.0; } if (_hour == 16) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.0; } if (_hour == 18) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.0; } if (_hour == 22) then { _delayOvercast setOvercast 1; _delayRain setRain 1; _delayFog setFog 0.5; } if (_hour == 24) then { _delayOvercast setOvercast _value; _delayRain setRain 0; _delayFog setFog 0.3; } sleep 1800; };
×