Gets the position of a vehicle.
|vehicleid||The ID of the vehicle to get the position of.|
|&Float:x||A float variable in which to store the X coordinate, passed by reference.|
|&Float:y||A float variable in which to store the Y coordinate, passed by reference.|
|&Float:z||A float variable in which to store the Z coordinate, passed by reference.|
1: The function was executed successfully.
0: The function failed to execute. The vehicle specified does not exist.
public OnPlayerCommandText(playerid, cmdtext)
if (strcmp(cmdtext, "/vehpos", true) == 0)
playerVehicle = GetPlayerVehicleID(playerid);
// if playerVehicle is equal to 0
return SendClientMessage(playerid, -1, "You are not in any vehicle!");
Float: vehX, Float: vehY, Float: vehZ,
GetVehiclePos(playerVehicle, vehX, vehY, vehZ);
format(clientMessage, sizeof(clientMessage), "The current vehicle positions are: %f, %f, %f", vehX, vehY, vehZ);
SendClientMessage(playerid, 0xFFFFFFFF, clientMessage);