How to delete all car's
#1

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?
Reply
#2

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;
}
Reply
#3

for(new v = 0; v < MAX_VEHICLES; v++)
{
DestroyVehicle(v);
SendClientMessage(playerid, -1, "All vehicles have been destroyed");
}






MAX_VEHICLES not MAX_PLAYERS
Reply
#4

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.
Reply
#5

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?
Reply
#6

In your gamemode
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)