Matijs Posted January 4, 2015 Report Share Posted January 4, 2015 This might be not the way to do this, but I dont reallly care, because it works. This script was made for a server to be able to have random spawns. (Spawn points given by the administrator.) Make a script called spawnpoints.sqf: if (isNil "inSpawnPoint") then { inSpawnPoint = false; }; while {true} do { waitUntil { inSpawnPoint }; titleText [format["Entering Spawn Point."],"PLAIN DOWN"]; titleFadeOut 4; waitUntil { player == vehicle player }; thePlayer = vehicle player; _spawnpointsarray = [ [1745,2107,0.1], [2737,1980,0.1], [3663,2130,0.1], [4109,2317,0.1], [4813,2086,0.1], [5825,2023,0.1], [6357,2082,0.1], [7198,2533,0.1], [7226,2187,0.1], [8045,2835,0.1], [8577,2320,0.1], [9286,1902,0.1], [9840,1786,0.1], [10466,1886,0.1], [10243,1576,0.1], [10857,2275,0.1], [11939,3402,0.1], [11105,3009,0.1], [13509,6166,0.1], [13081,7804,0.1], [12940,9326,0.1], [13170,10292,0.1] ]; systemChat "[DeadZ] Selecting spawn point..."; _selectspawnpoint = _spawnpointsarray select floor random count _spawnpointsarray; sleep 1; systemChat "[DeadZ] Spawn point selected. Spawning..."; sleep 1; thePlayer setPos _selectspawnpoint; waitUntil { !inSpawnPoint }; titleText [format["Exiting Spawn Point. Have fun."],"PLAIN DOWN"]; titleFadeOut 4; }; In the init.sqf add this: if (!isDedicated) then { [] execVM "spawnpoints.sqf"; }; In your mission sqm, create a sensor called SPAWNPOINT like this: class Sensors { items=1; class Item0 { position[]={6325.6772,0,7807.7412}; //Spawnpoint coords (same as respawn_west & east) activationBy="ANY"; repeating=1; interruptable=1; age="UNKNOWN"; name="SPAWNPOINT"; expCond="(player distance SPAWNPOINT) < 50;"; expActiv="inSpawnPoint = true;"; expDesactiv="inSpawnPoint = false;"; class Effects { }; }; }; And it should spawn you automaticaly after 2 seconds randomly. Also you need to remove your portals, or place them -x in the ground. Tell me if you like it. This is very nooby, but it works, so no hate. EDIT: I think you can remove the sleep 1;, im not sure about this, I just added it in for safety, so the player is definetaly going to a new location. Greetings, Matijs nedfox, Suppe, jbox88 and 6 others 9 Link to comment Share on other sites More sharing options...
second_coming Posted January 5, 2015 Report Share Posted January 5, 2015 Looks good Matijs. Going to have to pick some choice spawn points for Chernarus now :) Link to comment Share on other sites More sharing options...
MisterT Posted January 5, 2015 Report Share Posted January 5, 2015 Thanks for this. Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 how do ya remove the portals? Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 how do ya remove the portals? You know how to configure overpoch, but you dont know how to hide the portals? Unpack your server settings pbo, config.cpp file, scroll down to class Chernarus, edit the first positions of the portals, set the height, last one, to -50 instead of 0 Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 some things are easy (calling a server overpoch for haing 300+ weapons and extra vehicles) dont mean i know everything though ;) also guess it can go pretty much anywhere in the mission.sqm ya? tyvm been needing this for a while hated this spawn system :P Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 My server doesnt like it :( Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 can you just add this anywhere in mission.sqm class Sensors { items=1; class Item0 { position[]={6325.6772,0,7807.7412}; //Spawnpoint coords (same as respawn_west & east) activationBy="ANY"; repeating=1; interruptable=1; age="UNKNOWN"; name="SPAWNPOINT"; expCond="(player distance SPAWNPOINT) < 50;"; expActiv="inSpawnPoint = true;"; expDesactiv="inSpawnPoint = false;"; class Effects { }; }; }; Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 No its needs to be underneath the markers. Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 ah ok ty again mate lol is where i put them lucky me :p Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 class Markers { items = 3; class Item0 { position[] = {6968.658,324.48145,8345.914}; name = "center"; type = "Empty"; }; class Item1 { position[] = {1024.82,0,2023.51}; name = "respawn_east"; type = "Empty"; angle = 23.608498; }; class Item2 { position[] = {1024.8502,5.858802,2023.5204}; name = "respawn_west"; type = "Empty"; angle = 23.608498; }; }; }; class Sensors { items = 1; class Item0 { position[] = {6325.6772,0,7807.741}; activationBy = "ANY"; repeating = 1; interruptable = 1; age = "UNKNOWN"; name = "SPAWNPOINT"; expCond = "(player distance SPAWNPOINT) < 50;"; expActiv = "inSpawnPoint = true;"; expDesactiv = "inSpawnPoint = false;"; class Effects{}; }; }; is that correct cause this aint working for me :/ Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 class Markers { items = 3; class Item0 { position[] = {6968.658,324.48145,8345.914}; name = "center"; type = "Empty"; }; class Item1 { position[] = {1024.82,0,2023.51}; name = "respawn_east"; type = "Empty"; angle = 23.608498; }; class Item2 { position[] = {1024.8502,5.858802,2023.5204}; name = "respawn_west"; type = "Empty"; angle = 23.608498; }; }; }; class Sensors { items = 1; class Item0 { position[] = {6325.6772,0,7807.741}; activationBy = "ANY"; repeating = 1; interruptable = 1; age = "UNKNOWN"; name = "SPAWNPOINT"; expCond = "(player distance SPAWNPOINT) < 50;"; expActiv = "inSpawnPoint = true;"; expDesactiv = "inSpawnPoint = false;"; class Effects{}; }; }; is that correct cause this aint working for me :/ Behind the last "};" is there another "};" ? Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 no just seen that..i copied and pasted it in but it deleted my last ); or i did Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 class Markers { items = 3; class Item0 { position[] = {6968.658,324.48145,8345.914}; name = "center"; type = "Empty"; }; class Item1 { position[] = {1024.82,0,2023.51}; name = "respawn_east"; type = "Empty"; angle = 23.608498; }; class Item2 { position[] = {1024.8502,5.858802,2023.5204}; name = "respawn_west"; type = "Empty"; angle = 23.608498; }; }; }; class Sensors { items=1; class Item0 { position[]={6325.6772,0,7807.7412}; //Spawnpoint coords (same as respawn_west & east) activationBy="ANY"; repeating=1; interruptable=1; age="UNKNOWN"; name="SPAWNPOINT"; expCond="(player distance SPAWNPOINT) < 50;"; expActiv="inSpawnPoint = true;"; expDesactiv="inSpawnPoint = false;"; class Effects { }; }; }; class Intro so that should work? sorry about this :p Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 I think you have to remove one }; between markers & sensors, if that doesnt work, add your full mission.sqm Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 eliteness would not let me remove a ); between markers and sensors but ima try with the extra ); at the end Link to comment Share on other sites More sharing options...
Matijs Posted January 5, 2015 Author Report Share Posted January 5, 2015 You need to save the file as... Using eliteness, replace it with your previous one, then you can edit it using notepad++ or something. Link to comment Share on other sites More sharing options...
Humpabry Posted January 5, 2015 Report Share Posted January 5, 2015 ah so dont need to repify the file again? good to know ill try it tomorrow then tyvm mate Link to comment Share on other sites More sharing options...
cen Posted January 6, 2015 Report Share Posted January 6, 2015 Hump the coords are wrong in the file he posted so you'll never be near the sensor when you spawn. Change that to the respawn east or west coords in the markers so it matches, then you'll spawn, and will be within the 25m and the script will execute. Link to comment Share on other sites More sharing options...
Matijs Posted January 6, 2015 Author Report Share Posted January 6, 2015 If you read closely you can see that there is a commented line behind the sensor pozition saying exactaly what you just said. Link to comment Share on other sites More sharing options...
cen Posted January 6, 2015 Report Share Posted January 6, 2015 If you read closely you can see that there is a commented line behind the sensor pozition saying exactaly what you just said. I read it. The other guy, obviously, didn't :D ZENITHOVMAN 1 Link to comment Share on other sites More sharing options...
Matijs Posted January 6, 2015 Author Report Share Posted January 6, 2015 I read it. The other guy, obviously, didn't :D Oh yeah sorry, read that wrong. Link to comment Share on other sites More sharing options...
Humpabry Posted January 6, 2015 Report Share Posted January 6, 2015 lol ya i did not read that..my fault xD ima try get it dsone in 30 mins right after my food :p Link to comment Share on other sites More sharing options...
Humpabry Posted January 6, 2015 Report Share Posted January 6, 2015 so if i dont make my mission.sqm crypted again my server wont let anyone join...... class Markers { items = 3; class Item0 { position[] = {6968.658,324.48145,8345.914}; name = "center"; type = "Empty"; }; class Item1 { position[] = {1024.82,0,2023.51}; name = "respawn_east"; type = "Empty"; angle = 23.608498; }; class Item2 { position[] = {1024.8502,5.858802,2023.5204}; name = "respawn_west"; type = "Empty"; angle = 23.608498; }; }; class Sensors { items=1; class Item0 { position[]={1024.8502,5.858802,2023.5204}; //Spawnpoint coords (same as respawn_west & east) activationBy="ANY"; repeating=1; interruptable=1; age="UNKNOWN"; name="SPAWNPOINT"; expCond="(player distance SPAWNPOINT) < 50;"; expActiv="inSpawnPoint = true;"; expDesactiv="inSpawnPoint = false;"; class Effects { }; }; }; that is my coding but if i dont put another ); between the last ); from markers and sensors i cant re-crpt it Link to comment Share on other sites More sharing options...
Humpabry Posted January 6, 2015 Report Share Posted January 6, 2015 could you take a look at my mission.sqm and see if u can re-crypt it or if i made a mistake but should be all good http://en.file-upload.net/download-10102109/mission.sqm.html Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now