How to delete all car's - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Server (
https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (
https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: How to delete all car's (
/showthread.php?tid=404821)
How to delete all car's -
Projects - 04.01.2013
How can i delete all the cars in game? i looked for an in game cmd and theres isnt one, so where can i delete all spawned cars?
Re: How to delete all car's - Riddy - 04.01.2013
Here you go:
pawn Код:
if(strcmp(cmdtext, "/destroyallvehicles", true) == 0)
{
for(new v = 0; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
SendClientMessage(playerid, -1, "All vehicles have been destroyed");
}
return 1;
}
If ZCMD is the Command Proccesor
pawn Код:
CMD:destroyallvehicles(playerid, params[])
{
for(new v = 0; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
SendClientMessage(playerid, -1, "All vehicles have been destroyed");
}
return 1;
}
Re: How to delete all car's -
telmo_ferreira - 04.01.2013
for(new v = 0; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
SendClientMessage(playerid, -1, "All vehicles have been destroyed");
}
MAX_VEHICLES not MAX_PLAYERS
Re: How to delete all car's - Riddy - 04.01.2013
Quote:
Originally Posted by telmo_ferreira
for(new v = 0; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
SendClientMessage(playerid, -1, "All vehicles have been destroyed");
}
MAX_VEHICLES not MAX_PLAYERS
|
Thanks for that, I tend to not notice what i've put down.
Re: How to delete all car's -
Projects - 04.01.2013
Quote:
Originally Posted by Riddy
Here you go:
pawn Код:
if(strcmp(cmdtext, "/destroyallvehicles", true) == 0) { for(new v = 0; v < MAX_VEHICLES; v++) { DestroyVehicle(v); SendClientMessage(playerid, -1, "All vehicles have been destroyed"); } return 1; }
If ZCMD is the Command Proccesor
pawn Код:
CMD:destroyallvehicles(playerid, params[]) { for(new v = 0; v < MAX_VEHICLES; v++) { DestroyVehicle(v); SendClientMessage(playerid, -1, "All vehicles have been destroyed"); } return 1; }
|
Noob question, but where do i place this? like what files name?
Re: How to delete all car's - XProtocol - 04.01.2013
In your gamemode
Re: How to delete all car's -
kaisersouse - 04.01.2013
Quote:
Originally Posted by Riddy
Here you go:
pawn Код:
if(strcmp(cmdtext, "/destroyallvehicles", true) == 0) { for(new v = 0; v < MAX_VEHICLES; v++) { DestroyVehicle(v); } SendClientMessage(playerid, -1, "All vehicles have been destroyed"); return 1; }
If ZCMD is the Command Proccesor
pawn Код:
CMD:destroyallvehicles(playerid, params[]) { for(new v = 0; v < MAX_VEHICLES; v++) { DestroyVehicle(v); } SendClientMessage(playerid, -1, "All vehicles have been destroyed"); return 1; }
|
Fixed that a little for ya

Otherwise it will tell you all cars are destroyed, every time it destroys an individual vehicle.