Skip to main content

IsPlayerInVehicle

คำอธิบาย

Checks if a player is in a specific vehicle.

NameDescription
playeridID of the player.
vehicleidID of the vehicle. Note: NOT the modelid!

ส่งคืน

1 - Player IS in the vehicle.

0 - Player is NOT in the vehicle.

ตัวอย่าง

new specialcar;

public OnGameModeInit()
{
specialcar = AddStaticVehicle(411, 0.0, 0.0, 5.0, 0.0, -1, -1);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/specialcar", true) == 0)
{
if (IsPlayerInVehicle(playerid, specialcar))
{
SendClientMessage(playerid, -1, "You're in the special car!");
}
return 1;
}
return 0;
}

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