28.07.2009, 02:35
Stupid me, I think I know what's the major bug.
You need to store vehicleid in enumeration
Example
Same as buy/sell cars.
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][...]