SA-MP Forums Archive
Is there a way to remove the COMPLETE map? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Is there a way to remove the COMPLETE map? (/showthread.php?tid=305691)



Is there a way to remove the COMPLETE map? - justsomeguy - 23.12.2011

Hello, as the title says I am wondering if it is possible to remove the whole map in one code? Because I need this for a project.
I once tried a small piece of code that should've removed it all but it made SA-MP crash.
Does anyone know a way wich doesn't invlolve me sitting infront of my pc carefully selecting every object and deleting them?


Re: Is there a way to remove the COMPLETE map? - vassilis - 23.12.2011

O.O you want to delete whole san andreas? if i undestood well? :P


Re: Is there a way to remove the COMPLETE map? - Calgon - 23.12.2011

In "one code?" Probably not. I think your best bet is trying to individually remove buildings in your area with the RemovePlayerBuilding function, but you're going to have hundreds of lines of code.


Re: Is there a way to remove the COMPLETE map? - rinori - 23.12.2011

Quote:
Originally Posted by Calgon
Посмотреть сообщение
In "one code?" Probably not. I think your best bet is trying to individually remove buildings in your area with the RemovePlayerBuilding function, but you're going to have hundreds of lines of code.
Thousands of line of codes.


Re: Is there a way to remove the COMPLETE map? - justsomeguy - 23.12.2011

Ah poop, and there is no such code with all the removebuidlings yet?


Re: Is there a way to remove the COMPLETE map? - Calgon - 23.12.2011

JernejL's map editor is pretty advanced, if you can select masses of objects to delete, I'm sure it'll be a lot easier.

If you're looking in to remapping an area, why don't you consider taking some woodland and trying to remove the objects from the area? If you can.

Quote:
Originally Posted by rinori
Посмотреть сообщение
Thousands of line of codes.
True.


Re: Is there a way to remove the COMPLETE map? - Ash. - 23.12.2011

I don't think this is possible with a 'few lines' of code, though is definitely possible.

A way to check if a 'static' object (San Andreas object) is valid would go down a treat in this case.

pawn Код:
#define SA_OBJECTS 18630 //I'm basing this number on the fact that SA-MP objects start at 16831

for(new i; i < SA_OBJECTS; i++)
{
     if(!IsValidStaticObject(i)) continue;
     RemoveSpecificBuilding(i); //A function from my include. Though it is basically: RemoveBuildingForPlayer([everyone], i, 0.0, 0.0, 0.0, A_HIGH_NUMBER.0);
}



Re: Is there a way to remove the COMPLETE map? - justsomeguy - 23.12.2011

Quote:
Originally Posted by funky1234
Посмотреть сообщение
I don't think this is possible with a 'few lines' of code, though is definitely possible.

A way to check if a 'static' object (San Andreas object) is valid would go down a treat in this case.

pawn Код:
#define SA_OBJECTS 18630 //I'm basing this number on the fact that SA-MP objects start at 16831

for(new i; i < SA_OBJECTS; i++)
{
     if(!IsValidStaticObject(i)) continue;
     RemoveSpecificBuilding(i); //A function from my include. Though it is basically: RemoveBuildingForPlayer([everyone], i, 0.0, 0.0, 0.0, A_HIGH_NUMBER.0);
}
Are yuo sure that will work?


Re: Is there a way to remove the COMPLETE map? - Notis123 - 23.12.2011

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
Are yuo sure that will work?
Are you sure you're smart?TEST IT.


Re: Is there a way to remove the COMPLETE map? - Ash. - 23.12.2011

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
Are yuo sure that will work?
It won't work, as there is no "IsValidStaticObject()" function. I was just giving an example as to how it could work. You could create an IsValidStaticObject function, then my code would work!