Skip to main content

OnPlayerEnterVehicle

คำอธิบาย

This callback is called when a player starts to enter a vehicle, meaning the player is not in vehicle yet at the time this callback is called.

NameDescription
playeridID of the player who attempts to enter a vehicle.
vehicleidID of the vehicle the player is attempting to enter.
ispassenger0 if entering as driver. 1 if entering as passenger.

ส่งคืน

มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ

ตัวอย่าง

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "You are entering vehicle %i", vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}

บันทึก

tip

This callback is called when a player BEGINS to enter a vehicle, not when they HAVE entered it. See OnPlayerStateChange. This callback is still called if the player is denied entry to the vehicle (e.g. it is locked or full).

ฟังก์ชั่นที่เกี่ยวข้องกัน