Jump to content

ryansoper

Member
  • Content Count

    65
  • Joined

  • Last visited

  • Medals

Everything posted by ryansoper

  1. Hi guys, I'm currently trying to write part of a larger script and this bit should spawn a gunman and then arm him with 1 of three weapons depending on the roll, and then it will give him three mags for that gun. In testing the gun will be added to the inventory, and the hint inside the ifs for the magazines is displayed, it just won't actually add the magazines. _weaponArray = ["hgun_Pistol_heavy_01_F", "hgun_PDW2000_F", "srifle_DMR_05_tan_f"]; _weapon = selectRandom _weaponArray; _skill = random 1; hint format ["skill = %1", _gunmanPos]; _gunman = "criminal_1" createUnit [ getMarkerPos _gunmanPos, CriminalGroup, "gunman = this;"]; removeAllWeapons gunman; gunman setSkill _skill; gunman addEventHandler ["MPKilled", {call FNC_CalloutConcluded;}]; if (_weapon == "hgun_Pistol_heavy_01_F") then { hint "hgun_Pistol_heavy_01_F"; gunman addMagazine "11Rnd_45ACP_Mag"; gunman addMagazine "11Rnd_45ACP_Mag"; gunman addMagazine "11Rnd_45ACP_Mag"; }; if (_weapon == "hgun_PDW2000_F") then { hint "hgun_PDW2000_F"; gunman addMagazine "30Rnd_9x21_Mag"; gunman addMagazine "30Rnd_9x21_Mag"; gunman addMagazine "30Rnd_9x21_Mag"; }; if (_weapon == "srifle_DMR_05_tan_f") then { hint "srifle_DMR_05_tan_f"; gunman addMagazine "10Rnd_93x64_DMR_05_Mag"; gunman addMagazine "10Rnd_93x64_DMR_05_Mag"; gunman addMagazine "10Rnd_93x64_DMR_05_Mag"; }; gunman addWeapon _weapon; Any ideas what might be going wrong? Let me know if you need more of the code, this is just a snippet that *should* deal with the weapon addition. Ryan
  2. I had no idea this function even existed! Makes life much easier! Now lets see if it works!
  3. I'm sure this has been asked and answered, but i'm struggling to find anything related. I want to know what the best way to save variables in missions would be so that you can achieve persistence in your missions. For instance, in some of the 'Life' mission types peoples cars and moneys are obvioulsy saved somewhere extrenal so that this information remains true when the mission restarts. I assume it'll write to some kind of database. But how is this achieved? Can anyone point me in the direction any guides on the topic? Also, I have come across https://community.bistudio.com/wiki/profileNamespacewhich appears to allow you to save variables to the profileNamespace, but this seems insecure as a aplayer could just edit the variable amount in their own profile namespace. Any help will be greatly appreciated. Ryan
  4. This is certainly a very swift solution! I am also interested in how people do link their missions with databases (see dayz and the like where on any server you have the same stats) from a purely educational standpoint to see how it's done.
  5. I realise, I probably come across as a right knob, but I cannot for the life of me work out what I'm doing wrong. I have an array, which contains the name of a load of markers: _CSites =["CSite1", "CSite2", "CSite3", "CSite4", "CSite5", "CSite6", "CSite7", "CSite8", "CSite9", "CSite10"]; In order to test the selecting I have a the following: _var = _CSites select 0; hint format ["Pos:", _var]; So i'm expecting the hint in game to display "Pos: CSite1". However, all i see is "Pos: ". What have I done?! EDIT: Sigh, I am a knob, I hadn't formatted the hint correctly...
  6. I have three files: init.sqf waitUntil {time > 5}; jobactive = false; publicVariable "jobactive"; while {true} do { hint "This Far"; jobSelect = floor(random 2); publicVariable "jobSelect"; jobactive = true; publicVariable "jobactive"; switch (jobSelect) do { case 0: {execVM "jobs\susactivity.sqf";}; case 1: {execVM "jobs\drugsden.sqf";}; }; hint format ["%1", jobactive]; waitUntil (!jobactive); hint format ["After: %1", jobactive]; sleep 20; }; susActivity.sqf jobactive = true; publicVariable "jobactive"; thisjob = true; publicVariable "thisjob"; sleep 3; _SMhint = "<t align='center'><t size='2.2'>CALL INCOMING...</t><br/><t size='1.5' color='#00B2EE'>Abandoned Vehicle</t><br/>____________________<br/>Caller has reported an abandoned vehicle. Please head to the area to investigate.</t>"; hint parsetext _SMhint; _CompleteHint = "<t align='center'><t size='2.2'>JOB COMPLETED</t>>"; _polStationPos = getMarkerPos "polstationmarker"; _position = [_polstationpos, 150, 200, 3, 0, 20, 0] call BIS_fnc_findSafePos; //hint format ["Position: %1",_position]; sideObj = "C_Van_01_box_F" createVehicle _position; sideobj lock true; sideObj setDir random 360; sideObj addAction ["Recover Vehicle", {hint "Recovering vehicle"; sleep 3; deleteVehicle (_this select 0); thisjob = false; publicVariable "thisjob";}]; jobMarker = createMarker ["jobMarker", position player]; "jobMarker" setmarkerpos (position sideobj); "jobMarker" setmarkertext "Abandoned Vehicle"; "jobMarker" setmarkercolor "ColorRed"; "jobMarker" setMarkerAlpha 1; "jobMarker" setmarkerType "hd_dot"; _job = player createSimpleTask ["Suspicious Activity"]; _job setSimpleTaskDescription ["Respond to area an investigate for suspcious activity.","Active Job",""]; _job setTaskState "Assigned"; player setCurrentTask _job; waitUntil {!thisjob}; deleteMarker jobmarker; _job setTaskState "Succeeded"; hint parsetext _completehint; jobactive = false; publicVariable "jobactive"; and drugsden.sqf jobactive = true; publicVariable "jobactive"; _CSites =["CSite1", "CSite2", "CSite3", "CSite4", "CSite5", "CSite6", "CSite7", "CSite8", "CSite9", "CSite10"]; sleep 3; _CompleteHint = "<t align='center'><t size='2.2'>DRUGS DEN CLEARED</t>>"; _SMhint = "<t align='center'><t size='2.2'>CALL INCOMING...</t><br/><t size='1.5' color='#00B2EE'>Possible Drugs Den</t><br/>____________________<br/>Intel suggests the presence of a Drugs den in this area. Please respond to the area and investigate. HIGH CHANCE OF ARMED SUPSECTS. Lethal force is sanctioned.</t>"; hint parsetext _SMhint; _Pos = _CSites select random 10; DenPos = [getMarkerPos _pos, 1, 25, 3, 0, 20, 0] call BIS_fnc_findSafePos; criminalCar = "max_robbers_suv" createVehicle denPos; criminalCar lock true; criminalGroup = [DenPos, EAST, ["max_robber_light", "max_robber_light", "max_robber_light", "Max_robber"], [],[],[],[],[],180] call BIS_fnc_spawnGroup; criminalBoss = "Max_robber_boss" createUnit [ DenPos, criminalGroup, "crimboss = this"]; jobMarker = createMarker ["jobMarker", position player]; "jobMarker" setmarkerpos (position CriminalCar); "jobMarker" setmarkertext "Drugs Den"; "jobMarker" setmarkercolor "ColorRed"; "jobMarker" setMarkerAlpha 1; "jobMarker" setmarkerType "hd_dot"; waitUntil {!alive crimBoss}; criminalCar addAction ["Recover Vehicle", {hint "Recovering vehicle"; sleep 3; deleteVehicle (_this select 0); jobactive = false; publicVariable "jobactive";}]; hint "Boss Dead, Recover the car"; waitUntil {!jobactive}; deleteMarker jobmarker; _job setTaskState "Succeeded"; hint parsetext _completehint; publicVariable "jobactive"; My intention is that the game launches, and it generates one of the jobs. When you clear it. It will then continue the loop and generate another random job. This did work briefly, however for some reason now, I cannot get the loop to resume after the first iteration. I'm not sure if I've just totally messed something up, but I'd appreciate it if someone would take a look. Thanks, Ryan
  7. ryansoper

    Loop won't resume? WaitUntil

    Ah! Thank you! your help is greatly appreciated, the documentation, particularly around threading and multiplayer scripting is patchy at best! I see, so if I were to run this job mutiplayer with say 10 players, I'd end up with 10 abandoned vehicles?
  8. ryansoper

    Loop won't resume? WaitUntil

    My current files: [code][color="#FF8040"][color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]time[/color] [color="#8B3E2F"][b]>[/b][/color] [color="#FF0000"]5[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]if[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]isNil[/b][/color] [color="#7A7A7A"]"currentjob"[/color][color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color]currentjob [color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]-1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// if variable doesnt exist, set default value. Var might exists even for JIPs due to it being pubvar'd.[/i][/color] [color="#191970"][b]if[/b][/color] [color="#191970"][b]isServer[/b][/color] [color="#191970"][b]then[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#006400"][i]// run only on the server[/i][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#006400"][i]// create a new thread for the loop so it doesnt stop the init.sqf from continuing[/i][/color] [color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color]currentjob [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// no job assigned[/i][/color] currentjob [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]floor[/b][/color][color="#8B3E2F"][b]([/b][/color][color="#191970"][b]random[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// random is important to do only on one machine, because you dont want everyone doing their own random, and then everyone sending their conflicting random result to everyone else[/i][/color] [color="#191970"][b]publicVariable[/b][/color] [color="#7A7A7A"]"currentjob"[/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]spawn[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]while[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b]}[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color]currentjob [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// job assigned[/i][/color] [color="#191970"][b]hint[/b][/color] [color="#7A7A7A"]"Mission Selector"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]switch[/b][/color] [color="#8B3E2F"][b]([/b][/color]currentjob[color="#8B3E2F"][b])[/b][/color] [color="#191970"][b]do[/b][/color] [color="#8B3E2F"][b]{[/b][/color] [color="#191970"][b]case[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]:[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#191970"][b]execVM[/b][/color] [color="#7A7A7A"]"jobs\susactivity.sqf"[/color][color="#8B3E2F"][b];[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]case[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]:[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#191970"][b]execVM[/b][/color] [color="#7A7A7A"]"jobs\drugsden.sqf"[/color][color="#8B3E2F"][b];[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color]currentjob [color="#8B3E2F"][b]<[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// no job assigned[/i][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color] Made with KK's SQF to BBCode Converter[/code] and susactivity.sqf [code][color="#FF8040"]jobdone0 [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]false[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_SMhint[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"<t align='center'><t size='2.2'>CALL INCOMING...</t><br/><t size='1.5' color='#00B2EE'>Abandoned Vehicle</t><br/>____________________<br/>Caller has reported an abandoned vehicle. Please head to the area to investigate.</t>"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]hint[/b][/color] [color="#191970"][b]parseText[/b][/color] [color="#1874CD"]_SMhint[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_CompleteHint[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"<t align='center'><t size='2.2'>JOB COMPLETED</t>>"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_polStationPos[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]getMarkerPos[/b][/color] [color="#7A7A7A"]"polstationmarker"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_position[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#1874CD"]_polstationpos[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]150[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]200[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]3[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]20[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_findSafePos[color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]//hint format ["Position: %1",_position];[/i][/color] sideObj [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"C_Van_01_box_F"[/color] [color="#191970"][b]createVehicle[/b][/color] [color="#1874CD"]_position[/color][color="#8B3E2F"][b];[/b][/color] sideobj [color="#191970"][b]lock[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b];[/b][/color] sideObj [color="#191970"][b]setDir[/b][/color] [color="#191970"][b]random[/b][/color] [color="#FF0000"]360[/color][color="#8B3E2F"][b];[/b][/color] sideObj [color="#191970"][b]addAction[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Recover Vehicle"[/color][color="#8B3E2F"][b],[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#191970"][b]hint[/b][/color] [color="#7A7A7A"]"Recovering vehicle"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]sleep[/b][/color] [color="#FF0000"]3[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]deleteVehicle[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#000000"]_this[/color] [color="#191970"][b]select[/b][/color] [color="#FF0000"]0[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color] jobdone0 [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]true[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]publicVariable[/b][/color] [color="#7A7A7A"]"jobdone0"[/color][color="#8B3E2F"][b];[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] jobMarker [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]createMarker[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"jobMarker"[/color][color="#8B3E2F"][b],[/b][/color] [color="#191970"][b]position[/b][/color] [color="#000000"]player[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#7A7A7A"]"jobMarker"[/color] [color="#191970"][b]setMarkerPos[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]position[/b][/color] sideobj[color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#7A7A7A"]"jobMarker"[/color] [color="#191970"][b]setMarkerText[/b][/color] [color="#7A7A7A"]"Abandoned Vehicle"[/color][color="#8B3E2F"][b];[/b][/color] [color="#7A7A7A"]"jobMarker"[/color] [color="#191970"][b]setMarkerColor[/b][/color] [color="#7A7A7A"]"ColorRed"[/color][color="#8B3E2F"][b];[/b][/color] [color="#7A7A7A"]"jobMarker"[/color] [color="#191970"][b]setMarkerAlpha[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b];[/b][/color] [color="#7A7A7A"]"jobMarker"[/color] [color="#191970"][b]setMarkerType[/b][/color] [color="#7A7A7A"]"hd_dot"[/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_job[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#000000"]player[/color] [color="#191970"][b]createSimpleTask[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Suspicious Activity"[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_job[/color] [color="#191970"][b]setSimpleTaskDescription[/b][/color] [color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"Respond to area an investigate for suspcious activity."[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"Active Job"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]""[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_job[/color] [color="#191970"][b]setTaskState[/b][/color] [color="#7A7A7A"]"Assigned"[/color][color="#8B3E2F"][b];[/b][/color] [color="#000000"]player[/color] [color="#191970"][b]setCurrentTask[/b][/color] [color="#1874CD"]_job[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]waitUntil[/b][/color] [color="#8B3E2F"][b]{[/b][/color]jobdone0[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]deleteMarker[/b][/color] jobmarker[color="#8B3E2F"][b];[/b][/color] [color="#1874CD"]_job[/color] [color="#191970"][b]setTaskState[/b][/color] [color="#7A7A7A"]"Succeeded"[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]hint[/b][/color] [color="#191970"][b]parseText[/b][/color] [color="#1874CD"]_completehint[/color][color="#8B3E2F"][b];[/b][/color] [color="#006400"][i]// unassign current job[/i][/color] currentjob [color="#8B3E2F"][b]=[/b][/color] [color="#FF0000"]-1[/color][color="#8B3E2F"][b];[/b][/color] [color="#191970"][b]publicVariable[/b][/color] [color="#7A7A7A"]"currentjob"[/color][color="#8B3E2F"][b];[/b][/color] [/color] Made with KK's SQF to BBCode Converter[/code] It's happy to spawn one initial mission, and it will complete and display the hint, but it will not then spawn another mission. I think it might be something to do with the thread not having visibility of the updated variable? Is there a command you need to use in threading to pull the latest version of a variable? I saw something in some documentation about the threads not having access to variables in the same scope as it, but they can view global variables.
  9. I'm wondering if there is anyway I can create a mission in the editor in the usual drag and drop fashion. Then use the scripting engine to generate the mission units within another mission? So for instance, I have a 'mini-missions' script, and I want to create a mission whereby you have to infiltrate a compound and rescue a hostage. Could I make said mission in the editor, then somehow copy the units over so I can spawn the mission from within a larger script? I realize I can script the mission to do this manually, I'm just wondering if this is possible, because it would make the process of making mini missions far quicker/simpler.
  10. Perfect! Starred on Git.
  11. ryansoper

    Loop won't resume? WaitUntil

    Given your version ago, It appears to generate a mission, but will not go back to the selector again to select a new mission. Any ideas as to why?
  12. ryansoper

    Loop won't resume? WaitUntil

    Ah! This will be very useful then!
  13. ryansoper

    Loop won't resume? WaitUntil

    I'm very new to the world of multiplayer scripting, so I appreciate the advice, however I'm not sure how I would acheive what you mean? Could you provide a quick example? I've found it very hard to find any info about Multiplayer scripting! I suppose I could detect if the player is the host or if it's a dedicated server and then do the select before handing it off? ---------- Post added at 10:43 AM ---------- Previous post was at 10:42 AM ---------- Do i append this as a launch option?
  14. I have three files: init.sqf waitUntil {time > 5}; jobactive = false; publicVariable "jobactive"; while {true} do { hint "This Far"; jobSelect = floor(random 2); publicVariable "jobSelect"; jobactive = true; publicVariable "jobactive"; switch (jobSelect) do { case 0: {execVM "jobs\susactivity.sqf";}; case 1: {execVM "jobs\drugsden.sqf";}; }; hint format ["%1", jobactive]; waitUntil (!jobactive); hint format ["After: %1", jobactive]; sleep 20; }; susActivity.sqf jobactive = true; publicVariable "jobactive"; thisjob = true; publicVariable "thisjob"; sleep 3; _SMhint = "<t align='center'><t size='2.2'>CALL INCOMING...</t><br/><t size='1.5' color='#00B2EE'>Abandoned Vehicle</t><br/>____________________<br/>Caller has reported an abandoned vehicle. Please head to the area to investigate.</t>"; hint parsetext _SMhint; _CompleteHint = "<t align='center'><t size='2.2'>JOB COMPLETED</t>>"; _polStationPos = getMarkerPos "polstationmarker"; _position = [_polstationpos, 150, 200, 3, 0, 20, 0] call BIS_fnc_findSafePos; //hint format ["Position: %1",_position]; sideObj = "C_Van_01_box_F" createVehicle _position; sideobj lock true; sideObj setDir random 360; sideObj addAction ["Recover Vehicle", {hint "Recovering vehicle"; sleep 3; deleteVehicle (_this select 0); thisjob = false; publicVariable "thisjob";}]; jobMarker = createMarker ["jobMarker", position player]; "jobMarker" setmarkerpos (position sideobj); "jobMarker" setmarkertext "Abandoned Vehicle"; "jobMarker" setmarkercolor "ColorRed"; "jobMarker" setMarkerAlpha 1; "jobMarker" setmarkerType "hd_dot"; _job = player createSimpleTask ["Suspicious Activity"]; _job setSimpleTaskDescription ["Respond to area an investigate for suspcious activity.","Active Job",""]; _job setTaskState "Assigned"; player setCurrentTask _job; waitUntil {!thisjob}; deleteMarker jobmarker; _job setTaskState "Succeeded"; hint parsetext _completehint; jobactive = false; publicVariable "jobactive"; and drugsden.sqf jobactive = true; publicVariable "jobactive"; _CSites =["CSite1", "CSite2", "CSite3", "CSite4", "CSite5", "CSite6", "CSite7", "CSite8", "CSite9", "CSite10"]; sleep 3; _CompleteHint = "<t align='center'><t size='2.2'>DRUGS DEN CLEARED</t>>"; _SMhint = "<t align='center'><t size='2.2'>CALL INCOMING...</t><br/><t size='1.5' color='#00B2EE'>Possible Drugs Den</t><br/>____________________<br/>Intel suggests the presence of a Drugs den in this area. Please respond to the area and investigate. HIGH CHANCE OF ARMED SUPSECTS. Lethal force is sanctioned.</t>"; hint parsetext _SMhint; _Pos = _CSites select random 10; DenPos = [getMarkerPos _pos, 1, 25, 3, 0, 20, 0] call BIS_fnc_findSafePos; criminalCar = "max_robbers_suv" createVehicle denPos; criminalCar lock true; criminalGroup = [DenPos, EAST, ["max_robber_light", "max_robber_light", "max_robber_light", "Max_robber"], [],[],[],[],[],180] call BIS_fnc_spawnGroup; criminalBoss = "Max_robber_boss" createUnit [ DenPos, criminalGroup, "crimboss = this"]; jobMarker = createMarker ["jobMarker", position player]; "jobMarker" setmarkerpos (position CriminalCar); "jobMarker" setmarkertext "Drugs Den"; "jobMarker" setmarkercolor "ColorRed"; "jobMarker" setMarkerAlpha 1; "jobMarker" setmarkerType "hd_dot"; waitUntil {!alive crimBoss}; criminalCar addAction ["Recover Vehicle", {hint "Recovering vehicle"; sleep 3; deleteVehicle (_this select 0); jobactive = false; publicVariable "jobactive";}]; hint "Boss Dead, Recover the car"; waitUntil {!jobactive}; deleteMarker jobmarker; _job setTaskState "Succeeded"; hint parsetext _completehint; publicVariable "jobactive"; My intention is that the game launches, and it generates one of the jobs. When you clear it. It will then continue the loop and generate another random job. This did work briefly, however for some reason now, I cannot get the loop to resume after the first iteration. I'm not sure if I've just totally messed something up, but I'd appreciate it if someone would take a look. Thanks, Ryan
  15. Top bloke! I knew it'd be something simple, but I couldn't for the life of me work it out!
  16. Hi guys, This has probably been asked before, but I have searched and cannot find anything which clears it up for me. I understand that 'player' is null on multiplayer games at init stage, but I do not understand what I need to use instead, for instance, if I want to addAction on a player that has tripped one of my triggers, how would I select the player who has walked into the trigger? Thanks, Ryan
  17. That is very helpful thank you. How could I achieve similar results on a dedicated server then? What would you use instead of player?
  18. Hi guys, I've looked around for some tutorials, but it seems there isn't a huge amount. Basically, How can I create a GUI menu?! You know similar to some of the domination scripts have them to recruit AI members to your team? Thanks, Ryan
  19. Hi guys, I run into a bit of an issue when hosting a script on a dedicated server. All the addActions that are added to various things on init don't display. I realise I have to broadcast/sync the addActions to the player, is there a preferred way of doing this? Or is it just a case of PublicVariable all the way?
  20. Hi guys, I understand that init.sqf will be run by every player who joins the server, but I don't want this to be the case, There's only a limited part of the init script that I want to be run by players that JIP, as init also handles the spawning of some vehicles and I don't want them respawning everytime somebody joins. So, Is there a way to find if a player is Join in Progress so I can give them the limited part of the script to run? Thanks, Ryan
  21. So he has, Apologies, I was a bit amiss!
  22. How can I detect when a player has spawned into the game, I.E they are able to run around?
  23. Is there a script that is automatically run on JIP players? Like init.sqf is automatically run at Initialisation of mission?
  24. The Body He will spawn into, It's because I set my variables to the Unit Names, and I need to be able to ensure that the Variables are reset when a new player takes up a slot.
  25. Ah I see, Could you also suggest a way I might be able to find a Player's Unit on connect?
×