Liamsmith 1 Posted April 8, 2018 I`m trying to create a mission file where you fight somewhere. You spawn in and choose your location to fight. You will be fighting with multiple players so i want it so there loads of markers and you spawn on one if their isn't a player with in 10m or something. However, i keep on getting this error message. I used this is in the character init - this addAction ["Teleport To OG Arms","OG_Arms.sqf"]; My Code - https://pastebin.com/KguSKuhf Error Message - https://gyazo.com/0ac25ca29f016f85cbd91812859db70d Share this post Link to post Share on other sites
stanhope 411 Posted April 8, 2018 Try: _OG_Arms = ceil(random 2); if (_OG_Arms == 1) then { OG_Location = getmarkerpos "OG_Arms_1"; OG_Check = OG_Location nearEntities [[man], 15]; if (OG_Check isEqualTo []) then { player setpos OG_Location; } else { _OG_Arms = 2; };}; if (_OG_Arms == 2) then { OG_Location = getmarkerpos "OG_Arms_2"; OG_Check = OG_Location nearEntities [["man"], 15]; if (OG_Check = []) then { player setpos OG_Location; } else { ["All spawns blocked!"] call tankode_fnc_notification_system; }; No guarantees tho, didn't test it. Share this post Link to post Share on other sites
Liamsmith 1 Posted April 8, 2018 It works however when i place an AI by OG_Arms_1 to simulate and player being their and forcing to teleport some where else, nothing happens when i scroll wheel and click. Share this post Link to post Share on other sites
JeyR 2 Posted April 8, 2018 Is "man" a global variable or something? where did you declare it? I think no. nearEntities needs a typename, so your command should look like this : OG_Check = OG_Location nearEntities [["man"], 15]; Share this post Link to post Share on other sites
Liamsmith 1 Posted April 8, 2018 5 minutes ago, JeyR said: Is "man" a global variable or something? where did you declare it? I think no. nearEntities needs a typename, so your command should look like this : OG_Check = OG_Location nearEntities [["man"], 15]; Done it but it doesnt work. Share this post Link to post Share on other sites
JeyR 2 Posted April 8, 2018 Then show us the next error. I was referencing to bis_wiki, you used the command correctly in the second if, but not the first. Share this post Link to post Share on other sites
Liamsmith 1 Posted April 8, 2018 no error message. When i click nothing happens. Share this post Link to post Share on other sites
stanhope 411 Posted April 8, 2018 (edited) Try using this code (again didn't test it, no guarantees): OG_Location = getmarkerpos "OG_Arms_1"; OG_Check = OG_Location nearEntities [["man"], 15]; if (OG_Check isEqualTo []) then { player setpos OG_Location; } else { OG_Location = getmarkerpos "OG_Arms_2"; OG_Check = OG_Location nearEntities [["man"], 15]; if (OG_Check isEqualTo []) then { player setpos OG_Location; } else { ["All spawns blocked!"] call tankode_fnc_notification_system; }; }; Edited April 8, 2018 by stanhope fixed something Share this post Link to post Share on other sites
JeyR 2 Posted April 8, 2018 This is your code here, and I just saw that you were missing { somewhere at the end, _OG_Arms = ceil(random 2); if (_OG_Arms == 1) then { OG_Location = getmarkerpos "OG_Arms_1"; OG_Check = getmarkerpos "OG_Arms_1" nearEntities ["man", 15]; if (OG_Check isEqualTo []) then { player setpos OG_Location; } else { _OG_Arms = 2; }; }; if (_OG_Arms == 2) then { OG_Location = getmarkerpos "OG_Arms_2"; OG_Check = getmarkerpos "OG_Arms_2" nearEntities [["man"], 15]; if (OG_Check = []) then { player setpos OG_Location; }; } else { ["All spawns blocked!"] call tankode_fnc_notification_system; }; Share this post Link to post Share on other sites
stanhope 411 Posted April 8, 2018 @JeyR: "OG_Check = []" doesn't work in an if (Only just noticed myself too :) ) 1 Share this post Link to post Share on other sites
Liamsmith 1 Posted April 8, 2018 Works now thank you. Share this post Link to post Share on other sites