[SOLVED] Vehicles in array - then in if(){
#5

Alternatively, dump it in a stock.

pawn Код:
stock IsListedCar(vehicleid)
{
  for(new i,j=sizeof(CopCars); i<j; i++)
  {
    if(CopCars[i][Vecid] == vehicleid) return 1;
  }
  return 0;
}
Example:

if(IsListedCar(CarID)) //player is in a listed car
if(!IsListedCar(CarID)) //Player isn't in a listed car

NOTE: You need to save the vehicle ID, as yezizhu showed.
Reply


Messages In This Thread
[SOLVED] Vehicles in array - then in if(){ - by kLx - 24.07.2009, 10:34
Re: Vehicles in array - then in if(){ - by woot - 24.07.2009, 10:41
Re: Vehicles in array - then in if(){ - by Weirdosport - 24.07.2009, 10:42
Re: Vehicles in array - then in if(){ - by yezizhu - 24.07.2009, 10:44
Re: Vehicles in array - then in if(){ - by Weirdosport - 24.07.2009, 10:48
Re: Vehicles in array - then in if(){ - by kLx - 24.07.2009, 10:57

Forum Jump:


Users browsing this thread: 3 Guest(s)