#1

Ok , this work
pawn Код:
// In a command
new CaRs = MAX_VEHICLES - AmountOfVehicles();
for(new i = 1; i < CaRs; i++)
{
     DestroyVehicle(i + 10); // Let's say AmountOfVehicles = 10
  Dc++;
}
But what about this ? This didn't delete my vehicle(s). Why ?
pawn Код:
// In a command
new CaRs = MAX_VEHICLES - AmountOfVehicles();
for(new i = 1; i < CaRs; i++)
{
     DestroyVehicle(i + AmountOfVehicles());
  Dc++;
}
-----------------------------------------------------------------------------
pawn Код:
stock AmountOfVehicles()
{
      new vc;
      for(new i=1; i < 2000; i++) if(GetVehicleModel(i) != 0) vc++;
      return vc;
}

Reply
#2

Because You're asking it to delete cars that don't exist...

Let's say there are 2 players online, of 16, IDs 0 and 1.

p = 16 - 2 (14)

i < p
kick (i+p) which are IDs 14-27 There is no one on those IDs
Reply
#3

No , that's not true. I'm just trying to do a command which deletes the NEWS CARS CREATED.

Eg:
pawn Код:
I have 400 statics cars , and i create 5 < INGAME > , Total = 405 Vehicles

new CaRs = 2000 - 400 ( 1600 );
for(new i = 1; i < CaRs; i++)
{
  DestroyVehicle(i + 400); // Delete 401, 402, 403, 404, 405
}
~~~ Problem Resolved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)