Wiki

Clone wiki

EFLC-MP LUA / onPlayerRequestVehicleEntry

Description

This function is triggered once the player is starting to enter a vehicle

Parameters

Int playerId, Int vehicleId, int seatId, Bool carJack
Int playerId

Int vehicleId

int seatId

Bool carJack: Whether the player is carjacking someone

Return values


Example

#!lua
function myPlayerRequestVehicleEntry(playerid, vehicleId, seatId, carjack)
    print("Player " .. getPlayerName(playerid) .. "(" .. playerid .. ") entering vehicle " .. vehicleId .. " on seat " .. seatId)
    if(carJack) then
        removePlayerFromVehicle(playerid)
        sendPlayerMsg(playerid, "Be nice, dont carjack", 0xFFFF0000)
    end
end
registerEvent("myPlayerRequestVehicleEntry", "onPlayerRequestVehicleEntry")

Updated