(vehicleid, &Float:z_angle)
vehicleid
The ID of the vehicle to set the rotation of.
Float:z_angle
The Z angle to set.
- A vehicle's X and Y (pitch and roll) rotation will be reset when this function is used. The X and Y rotations can not be set.
- This function does not work on unoccupied vehicles (It is believed to be a GTA limitation).
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/flip", true) == 0)
{
new currentveh;
new Float:angle;
currentveh = GetPlayerVehicleID(playerid);
GetVehicleZAngle(currentveh, angle);
SetVehicleZAngle(currentveh, angle);
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been flipped.");
return 1;
}
return 0;
}
The following functions may be useful, as they are related to this function in one way or another.