[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
#2

This could help you.
Reply
#3

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
This could help you.
I was hoping anyone could make a program for it (since I am unable to do so myself, and I think a lot of people would benefit from it).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)