Matevsz Posted April 2, 2024 Share Posted April 2, 2024 Hi all, I'm trying to make these clocks appear after entering models with appropriate IDs, but they show up after entering each vehicle model local modelsID = {511, 593, 512, 460, 513, 548, 425, 417, 487, 488, 497, 563, 447, 469} GUIEditor = { staticimage = {} } addEventHandler("onClientPlayerVehicleEnter", localPlayer, function(modelsID) GUIEditor.staticimage[1] = guiCreateStaticImage(373, 741, 257, 244, "clocks/Turn_indicator.png", false) GUIEditor.staticimage[2] = guiCreateStaticImage(56, 96, 142, 34, "clocks/airplane.png", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[3] = guiCreateStaticImage(118, 149, 17, 17, "clocks/icon.png", false, GUIEditor.staticimage[1]) GUIEditor.staticimage[4] = guiCreateStaticImage(634, 741, 255, 244, "clocks/ALDDIAL.png", false) GUIEditor.staticimage[5] = guiCreateStaticImage(-4, 10, 266, 211, "clocks/DALTLONG.png", false, GUIEditor.staticimage[4]) GUIEditor.staticimage[6] = guiCreateStaticImage(32, 11, 193, 200, "clocks/DALTSHORT.png", false, GUIEditor.staticimage[4]) GUIEditor.staticimage[7] = guiCreateStaticImage(893, 741, 262, 244, "clocks/StucznyHoryzont.png", false) GUIEditor.staticimage[8] = guiCreateStaticImage(1159, 741, 257, 244, "clocks/ASDDIAL.png", false) GUIEditor.staticimage[9] = guiCreateStaticImage(21, 10, 216, 246, "clocks/DALTLONG.png", false, GUIEditor.staticimage[8]) GUIEditor.staticimage[10] = guiCreateStaticImage(1416, 741, 254, 244, "clocks/licznikStopni.png", false) GUIEditor.staticimage[11] = guiCreateStaticImage(79, 51, 98, 139, "clocks/samolotDoLicznikaStopni.png", false, GUIEditor.staticimage[10]) end ) Link to comment
Mkl Posted April 2, 2024 Share Posted April 2, 2024 Hi, onClientPlayerVehicleEnter first paramater is theVehicle element you entered addEventHandler("onClientPlayerVehicleEnter", localPlayer, function(theVehicle) You can get the model id of this vehicle using getElementModel(theVehicle) and check if the vehicule you entered is a valid model It is faster to use a table with key as id of the vehicle and set a boolean true as value because it allows you to check by calling the table with the id of vehicule you entered as key instead of checking with a loop. validModels = { [124] = true, [126] = true, -- etc } addEventHandler("onClientPlayerVehicleEnter", localPlayer, function(theVehicle) local id = getElementModel(theVehicle) if (validModels[id]) then -- your stuff end end) Cya, 1 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