Car system has 1 bug
#5

Stupid me, I think I know what's the major bug.
You need to store vehicleid in enumeration

Example
pawn Код:
#define INVALID_CAR_ID (-1)
enum CarsInfo{
  //your old stuff
  Cars_Vecid
};
new Cars[...][CarsInfo];

stock Car_getVecCarID(vehicleid){
  for(new i,j = sizeof(Cars);i < j;i++)
    if(Cars[i][Car_VecID] == vehicleid) return i;
  return INVALID_CAR_ID;
}

//OnGameModeInit
Loop{
  Cars[i][Cars_VecID] = INVALID_CAR_ID
}
Cars[id][Cars_Vecid] = CreateVehicle//must use createvehicle


//OnPlayerEnterVehicle
new vecCarid = Car_getVecCarID(vehicleid);
if(vecCarID != INVALID_CAR_ID){
    //use Cars[vecCarID][...]
Same as buy/sell cars.
Reply


Messages In This Thread
Car system has 1 bug - by coole210 - 27.07.2009, 20:30
Re: Car system has 1 bug - by coole210 - 27.07.2009, 23:58
Re: Car system has 1 bug - by yezizhu - 28.07.2009, 00:17
Re: Car system has 1 bug - by coole210 - 28.07.2009, 00:28
Re: Car system has 1 bug - by yezizhu - 28.07.2009, 02:35
Re: Car system has 1 bug - by coole210 - 28.07.2009, 14:06
Re: Car system has 1 bug - by coole210 - 28.07.2009, 14:14
Re: Car system has 1 bug - by saiberfun - 28.07.2009, 14:39
Re: Car system has 1 bug - by coole210 - 28.07.2009, 14:41
Re: Car system has 1 bug - by yezizhu - 28.07.2009, 16:48

Forum Jump:


Users browsing this thread: 2 Guest(s)