Lunchbox 87 Report post Posted May 8, 2016 (edited) Created a small script that runs once an hour to cleanup bikes that are abandoned if you are using the spawn bike script. Run the script server side, don't run it via mission. while {true} do { uiSleep 3600; { if ({alive _x} count crew _x == 0 && (typeOf _x) in ["Exile_Bike_MountainBike"]) then { deleteVehicle _x; }; } forEach vehicles; }; Edited May 8, 2016 by Lunchbox 2 Share this post Link to post Share on other sites
Janski 358 Report post Posted May 9, 2016 Some tips to improve it You should check if there are any nearby players, wouldn't want my bike removed when on a loot run. Even more advanced add event handlers that register when players mount or dismount from the bike so you can check if it has been inactive for more than a specific amount of time. 2 Share this post Link to post Share on other sites
DIamond 81 Report post Posted June 3, 2016 (edited) Not to be dumb but could i have a example of how to set this up server side ? Im amusing just make a pbo for it correct? Im asking for an example because i have been struggling a little bit on this one. Edited June 3, 2016 by DIamond Share this post Link to post Share on other sites
second_coming 836 Report post Posted June 4, 2016 (edited) 1 hour ago, DIamond said: Not to be dumb but could i have a example of how to set this up server side ? Im amusing just make a pbo for it correct? Im asking for an example because i have been struggling a little bit on this one. try this (drop it in the @ExileServer/addons folder). It runs every 5 minutes and deletes any bike that doesn't have a player within 100m of it (it's untested though so try it and see ) https://www.dropbox.com/s/afd0r7csjm8awt9/a3_exile_bikeDeleter.pbo?dl=0 Edited June 4, 2016 by second_coming 2 Share this post Link to post Share on other sites
DIamond 81 Report post Posted June 4, 2016 (edited) 11 minutes ago, second_coming said: try this (drop it in the @ExileServer/addons folder). It runs every 5 minutes and deletes any bike that doesn't have a player within 100m of it (it's untested though so try it and see ) https://www.dropbox.com/s/afd0r7csjm8awt9/a3_exile_bikeDeleter.pbo?dl=0 Thanks SC you are a life saver/fps saver... I dont mind being a test dummy for more fps at all. Edited June 4, 2016 by DIamond Share this post Link to post Share on other sites
DIamond 81 Report post Posted June 4, 2016 (edited) @second_coming My rpt threw this 21:17:14 Warning Message: Script \x\addons\a3_exile_bikeDeleter\initServer.sqf not found File path is correct and the initserver.sqf is in the pbo. Just not Reading it. Any ideas? Edited June 4, 2016 by DIamond Share this post Link to post Share on other sites
happydayz 490 Report post Posted June 4, 2016 (edited) On 5/8/2016 at 10:03 AM, Lunchbox said: Created a small script that runs once an hour to cleanup bikes that are abandoned if you are using the spawn bike script. Run the script server side, don't run it via mission. while {true} do { uiSleep 3600; { if ({alive _x} count crew _x == 0 && (typeOf _x) in ["Exile_Bike_MountainBike"]) then { deleteVehicle _x; }; } forEach vehicles; }; WHY WHY WHY??? Exile has a beautiful thread system for a reason! Run this in InitServer.sqf in your mission file. Private ["_time"]; _time = 3600; //How often you want this to run (time in sec) _function = { { _position = position _x; if ((typeOf _x) in ["Exile_Bike_MountainBike","Exile_Bike_OldBike"]) then { if([_position, 100] call ExileClient_util_world_isAlivePlayerInRange) exitwith {}; deleteVehicle _x; }; } forEach vehicles; }; [_time, _function, [], true] call ExileServer_system_thread_addTask; Thats just a quick example of your code run by exile in an efficient manner Edited June 4, 2016 by happydayz 3 Share this post Link to post Share on other sites
happydayz 490 Report post Posted June 4, 2016 ANd just pulled open the pbo linked and it does it the right way top marks 1 Share this post Link to post Share on other sites
Spackler 33 Report post Posted June 4, 2016 18 hours ago, happydayz said: ANd just pulled open the pbo linked and it does it the right way top marks So which should we use and is this something we should use if we are using the default bike spawn script? Share this post Link to post Share on other sites
happydayz 490 Report post Posted June 4, 2016 u should be able to use either. theres no real need for it to be in a server pbo tho as its a tiny amount of code. Share this post Link to post Share on other sites