OnVehicleSpawn() bug
#1

SetVehicleZAngle() seems to have no effect in OnVehicleSpawn().

Example code:

pawn Code:
public OnVehicleSpawn(vehicleid)
{
    if (OwnedVehicles[vehicleid])
    {
        new vid = OwnedVehicles[vehicleid];
        SetVehicleZAngle(vehicleid, vehicles[vid][cr]);
        SetVehiclePos(vehicleid, vehicles[vid][cx], vehicles[vid][cy], vehicles[vid][cz]);
    }
    else
    {
        Fuel[vehicleid] = MAX_FUEL;
    }
    return 1;
}
Vehicle angle was the same as when it was first spawned. When I'm trying to load it's position where it was last parked, the position is set correctly, but angle isn't. When using another function to load vehicle position from these variables, it works correctly.
Reply
#2

This is an old problem as far as I know.

The solution would be destroying and creating the vehicle again on the save coords + zangle.
Reply
#3

couldn't you just switch the setvehiclezangle and setvehiclepos around and it will work?
Reply
#4

Quote:
Originally Posted by Raz0r1000
View Post
couldn't you just switch the setvehiclezangle and setvehiclepos around and it will work?
I tried that, didn't work.
Reply
#5

SetVehicleZAngle wont work without driver in it, i have reported this while ago..
Reply
#6

I have noticed this bug too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)