MAX_VEHICLES to find ID?
#1

How can you find the vehicle ID of for(new i=0;i<MAX_VEHICLES;i++)
because I want to make a command, but I need the vehicleID.

Thanks, all help appreciated.
Reply
#2

Like, for checking a players vehicle id?

And just like:
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
  if(i == vehicle_id)
  {
   // do something
  }
}
Reply
#3

just do GetPlayerVehicleID(playerid);

Or change MAX_VEHICLES to MAX_PLAYERS and change playerid to i
Reply
#4

Well what I'm trying to do is create an admin command that shuts off all car engines, but I think I need the vehicle ID to do that...

FactionCar[x][fcEngine] is my engine where x = vehicleid.

What I want to do is have the command shut all engines off.
Reply
#5

Just put vehicle id inside?
Like VehicleInfo[vehicleid][fcEngine].
Reply
#6

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Well what I'm trying to do is create an admin command that shuts off all car engines, but I think I need the vehicle ID to do that...

FactionCar[x][fcEngine] is my engine where x = vehicleid.

What I want to do is have the command shut all engines off.
pawn Код:
for(new v; v < MAX_VEHICLES; v++) //v can be everything that is under MAX_VEHICLES(2000), so v is appointed 0, but also 324, etc. Missed out on mathematics? :P
{
VehicleInfo[v][fcEngine] = 0; //Stops engine of 'v'.
}
Reply
#7

Thanks, I'll test it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)