10.10.2017, 16:50
Quote:
Thats why you should use my version cause it doesnt require a for loop.
|
If anything he should really store the vehicle information in a single place not have vehicles spawned under different arrays.
Should have one array for all vehicles and then have an enum inside that array to define if it's a public vehicle or not...
PHP код:
enum EVehicleInfo {
EVehicleOwner
// then simply assign public = 0, 1 = blah 2 = blah 3 = blah when a vehicle is created
};
new VehicleInfo[MAX_VEHICLES][EVehicleInfo];
if you want to set a car to x gang
do that else where in the script and just put
in this case...GsfCar
VehicleInfo[vehicleid][1];
How he gets the vehicle id is up to him but thats just a 10 second example.
Then it would literally just be a case of
OnPlayerEnterVehicle(playerid, vehicleid) {
new carowner = VehicleInfo[vehicleid][EVehicleOwner];
if(carowner != BlahBlah) {
do this
} else { do this }
}