[APPLICATION REQUEST] RemoveBuildingForPlayer code optimization
#1

Since 0.3d is out for full with the ability to remove default GTA: SA objects, I'm requesting an application that optimizes RemoveBuildingForPlayer code (for example code generated from JernejL's map editor).

What I mean by this is: You enter the code you would like to optimize and the program does some mathematical calculation that can replace 50 RemoveBuildingForPlayer lines with 1 line (centered X, Y, Z position based on all the objects with a set range that deletes all the 50 objects - but not anything outside it (or similar, doesn't have to be so strict on the part after the -).

For example:

pawn Код:
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 1.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 2.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 3.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 4.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 5.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 6.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 7.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 8.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 9.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 10.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 11, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 12.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 13.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 14.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 15.0, 0.25);
//
RemoveBuildingForPlayer(playerid, 1337, 0.0, 1.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 2.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 3.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 4.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 5.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 6.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 7.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 8.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 9.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 10.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 11.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 12.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 13.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 14.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 0.0, 15.0, 0.0, 0.25);
//
RemoveBuildingForPlayer(playerid, 1337, 1.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 2.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 3.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 4.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 5.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 6.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 7.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 8.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 9.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 10.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 11.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 12.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 13.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 14.0, 0.0, 0.0, 0.25);
RemoveBuildingForPlayer(playerid, 1337, 15.0, 0.0, 0.0, 0.25);
would turn into

pawn Код:
RemoveBuildingForPlayer(playerid, 1337, 0.0, 0.0, 0.0, 15.0); // This would have the same effect as the code above seeing as all the lines above are in a 15.0 radius from co-ordinates 0.0, 0.0, 0.0
Thank you,
MrObviousPotato.
Reply


Messages In This Thread
[APPLICATION REQUEST] RemoveBuildingForPlayer code optimization - by MrObviousPotato - 03.12.2011, 21:27
Re: [APPLICATION REQUEST] RemoveBuildingForPlayer code optimization - by RyDeR` - 03.12.2011, 21:35
Re: [APPLICATION REQUEST] RemoveBuildingForPlayer code optimization - by MrObviousPotato - 03.12.2011, 23:25

Forum Jump:


Users browsing this thread: 1 Guest(s)