SA-MP Forums Archive
A way to delete carz PERMANENTLY? - 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: A way to delete carz PERMANENTLY? (/showthread.php?tid=460068)



A way to delete carz PERMANENTLY? - Charlos - 26.08.2013

Is there a way I can delete all the carz from my server PERMANENTLY?


AW: A way to delete carz PERMANENTLY? - Mellnik - 26.08.2013

Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
        if(IsValidVehicle(i))
                  DestroyVehicle(i);
}



Re: A way to delete carz PERMANENTLY? - PT - 26.08.2013

https://sampwiki.blast.hk/wiki/DestroyVehicle


Re: A way to delete carz PERMANENTLY? - Charlos - 26.08.2013

Please I am newbie I am not sure how to do it?
Which part in Gamemode?


Re: A way to delete carz PERMANENTLY? - Charlos - 26.08.2013

Please help me!


Re: A way to delete carz PERMANENTLY? - Konstantinos - 26.08.2013

You asked for a way, and it was given..

Anyways, you can understand what part you should get:
pawn Код:
#include < a_samp >

native IsValidVehicle( vehicleid );

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( !strcmp( "/delallveh", cmdtext, true ) )
    {
        for( new i = 0; i < MAX_VEHICLES; i++ )
        {
            if( IsValidVehicle( i ) ) DestroyVehicle( i );
        }
        return 1;
    }
    return 0;
}



Re: A way to delete carz PERMANENTLY? - ProjectMan - 26.08.2013

Remove the AddStaticVehicle/AddStaticVehicleEx/CreateVehicle lines from your game mode?

If you don't want it then do this in your game mode:

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    DestroyVehicle(vehicleid);
    return 1;
}



Re: A way to delete carz PERMANENTLY? - Charlos - 26.08.2013

Please I am not sure but can you help me?
http://pastebin.com/nXuk2Aff
Here is my gamemode Please help!


Re: A way to delete carz PERMANENTLY? - DanishHaq - 26.08.2013

Dude it's not rocket science. There are a few ways for people to make cars. They can either use AddStaticVehicle, AddStaticVehicleEx and CreateVehicle. Press CTRL + F to load up the search box, and find all of these and delete the lines. The lines would look something like this:

CreateVehicle(401,342.848,159.493,583.148,45.3,,0, 0,1200);
AddStaticVehicleEx(401,348.573,582.485,284.472,54. 1,0,0,1200);
AddStaticVehicle(401,3481.583,2959.471,582.5821,31 .4,0,0);

The numbers will all be different, but the first words and then open bracket will be the same. Search for them and then simply delete them.


Re: A way to delete carz PERMANENTLY? - Don_Cage - 26.08.2013

Remove line 2228 all the way to 2487