06.07.2011, 15:51
yes, Mike already told you everything you need:
new IsASpawnedCar[MAX_VEHICLES]; belongs into the cars-filterscript. this array is only known to this car-filterscript, despite that its sharing all vehicle ids with the gamemode indeed. as soon the filterscript creates a car (CreateVehicle), let it set the
...just add that line below your CreateVehicle() line, so the filterscript will know that that car got spawned by itself.
in your OnPlayerExitVehicle(playerid,vehicleid) callback, add the check if the car, is one of the filterscripts spawned cars. the gamemode wont see the "set to 1" variable, so that check
will return 0 for any gamemode created cars. it will return 1 in the filterscripts cars, so you can destroy it then.
ah, maybe you need to GetPlayerVehicleID(playerid) first, but i presume you already know that
new IsASpawnedCar[MAX_VEHICLES]; belongs into the cars-filterscript. this array is only known to this car-filterscript, despite that its sharing all vehicle ids with the gamemode indeed. as soon the filterscript creates a car (CreateVehicle), let it set the
Код:
//your CreateVehicle(blablablab); variable IsASpawnedCar[vehicleid] = 1;
in your OnPlayerExitVehicle(playerid,vehicleid) callback, add the check if the car, is one of the filterscripts spawned cars. the gamemode wont see the "set to 1" variable, so that check
Код:
if(IsASpawnedCar[vehicleid]) { //your DestroyVehicle(vehicleid); }
ah, maybe you need to GetPlayerVehicleID(playerid) first, but i presume you already know that
