Chuyển tới nội dung chính

GetVehicleDriver

cảnh báo

Đã thêm hàm trong phiên bản omp v1.1.0.2612. Mục này không hoạt động trên các phiên bản cũ hơn!

Description​

Get the playerid of the person driving the vehicle.

Parameters​

NameDescription
vehicleidThe ID of the vehicle to get the driver of.

Returns​

Returns the driver ID (player ID).

INVALID_PLAYER_ID - The vehicle has no driver.

Examples​

public OnPlayerExitVehicle(playerid, vehicleid)
{
new driverid = GetVehicleDriver(vehicleid);
if (driverid != INVALID_PLAYER_ID)
{
SendClientMessage(driverid, -1, "Someone is exiting your vehicle.");
}
return 1;
}