05.03.2009, 07:19
Is OnVehicleSpawn called before the car is respawned or after the callback is returned?
public OnVehicleSpawn(vehicleid) // OnVehicleSpawn
{
new tmpowner = CarsOwner[vehicleid];
new Float:tmpx, Float:tmpy, Float:tmpz, Float:tmpang;
GetVehiclePos(vehicleid, tmpx, tmpy, tmpz);
GetVehicleZAngle(vehicleid, tmpang);
if(PlayerCar[tmpowner][x] != tmpx && PlayerCar[tmpowner][y] != tmpy && PlayerCar[tmpowner][z] != tmpz && PlayerCar[tmpowner][ang] != tmpang)
{
DestroyVehicle(vehicleid);
CreateVehicle(
PlayerCar[tmpowner][model],
PlayerCar[tmpowner][x],
PlayerCar[tmpowner][y],
PlayerCar[tmpowner][z],
PlayerCar[tmpowner][ang],
PlayerCar[tmpowner][color1],
PlayerCar[tmpowner][color2],
60000
);
}
return 1;
} //----------