Hi i would like some help about table using. What i'm trying to do is to block the entry to a certain car model depending on the level needed to enter that specific model.(i use the level sys by castillo)
My script:
local cars = {
[411] = 20,
}
function test (player,seat,jacked)
local level = exports.exp_sys:getPlayerLevel ( player )
local model = getElementModel(source)
if ( cars[getElementModel(source)] < level ) then
cancelEvent()
outputChatBox ("[CORE] *You have to be at least level "..unpack(autos[getElementModel(source)]), player, 255, 100, 100, false)
else
outputChatBox ("[CORE] *Authorized Vehicle", player, 255, 100, 100, false)
end
end
addEventHandler ( "onVehicleStartEnter", root, test )