nimrod Posted January 27, 2014 Share Posted January 27, 2014 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 ) Link to comment
Castillo Posted January 27, 2014 Share Posted January 27, 2014 outputChatBox ("[CORE] *You have to be at least level "..unpack(autos[getElementModel(source)]), player, 255, 100, 100, false) You are using "autos" table name, but your table name is "cars", change that line into: outputChatBox ( "[CORE] *You have to be at least level ".. tostring ( cars [ model ] ), player, 255, 100, 100, false ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now