-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Vos decis asi con las flechitas para cambiar de jugador, etc? si es asi, eso lo tenes que crear vos como lo hizo el creador del "race".
-
Yo te di todas las funciones necesarias, ahora empeza a pensar en como usarlas.
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[15] = guiCreateButton(191,46,103,38,"UnMute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) guiSetVisible ( GUIEditor_Button[15], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], false) guiSetVisible ( GUIEditor_Button[15], true ) end elseif ( source == GUIEditor_Button[15] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "unmute", localPlayer, playerName ) guiSetVisible(GUIEditor_Button[1], true) guiSetVisible ( GUIEditor_Button[15], false ) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) You had missing: playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column )
-
Esa funcion que te di es server side.
-
Pues tendrias que crear la tabla server side, luego al enviar el mensaje, buscas con quien estas chateando y lo añadis a esa tabla y lo envias para ambos jugadores. Seria algo asi: local mensajes = { } function prueba ( jugadorAlQueEnvias, mensaje ) if ( not mensajes [ source ] ) then mensajes [ source ] = { } end if ( not mensajes [ source ] [ jugadorAlQueEnvias ] ) then mensajes [ source ] [ jugadorAlQueEnvias ] = { } end table.insert ( mensajes [ source ] [ jugadorAlQueEnvias ], mensaje ) end Luego envias la tabla: mensajes [ source ] [ jugadorAlQueEnvias ] a ambos, source y jugadorAlQueEnvias.
-
Si, eso es solo para mostrate como funciona.
-
Lo que yo hice en el chat de los clanes en SAUR fue crear una tabla con los mensajes, luego usas un for-loop y los vas añadiendo al memo, asi: local messages = { "Hola", "Mundo!" } for index, msg in ipairs ( messages ) do guiSetText ( elMemo, guiGetText ( elMemo ) .."".. tostring ( msg ) ) guiSetProperty ( elMemo, "CaratIndex", tostring ( elMemo ):len ( ) ) ) end
-
Para hacer un PM GUI podes usar varias cosas: Una grid list ( para los jugadores online ): guiCreateGridList guiGridListAddRow guiGridListSetItemText guiGridListGetSelectedItem guiGridListGetItemText Un edit ( para el texto ): guiCreateEdit guiGetText Un boton ( para enviar el mensaje ): guiCreateButton Y te queda para luego enviarlo de verdad: triggerServerEvent addEvent addEventHandler outputChatBox
-
Yo tambien uso el notepad++, y tiene syntax highlight para Lua tambien, la cosa es que me olvide como lo puse
-
@ElMota: Copy my client side code again, I've fixed a small problem. P.S: I also fixed your player-search function.
-
@Genius: You attached the event handlers to a non-existent element, the marker wasn't created for then. jobMarker = createMarker ( 2055.4, -1775.08, 12.6, "cylinder" ,2, 249, 19, 75, 190 ) teamCriminal = createTeam( "Criminal", 249, 19, 75) function robber ( hitPlayer ) setElementModel ( hitPlayer, 115 ) setPlayerTeam ( hitPlayer, teamCriminal ) outputChatBox ( "You are now Robber.", hitPlayer ) firstMarker = createMarker ( 2144.3, -1663.7, 14.6, "cylinder", 2, 249, 19, 75, 190 ) addEventHandler ( "onMarkerHit", firstMarker, onmarker1 ) -- Here end addEventHandler ( "onMarkerHit", jobMarker, robber ) function onmarker1 ( thePlayer ) destroyElement ( secondMarker ) givePlayerMoney ( thePlayer, 856 ) secondMarker = createMarker ( 2146.3, -1470.4, 25.1, "cylinder", 2, 249, 19, 75, 190 ) addEventHandler ( "onMarkerHit", secondMarker, onmarker2 ) -- And here end function onmarker2 ( hitPlayer ) destroyElement ( thirdMarker ) givePlayerMoney ( hitPlayer, 856 ) end @Jaysd1: There's no such function: setTeamFromName.
-
Me parece que Julián piensa que solo los botones se pueden usar para ejecutar funciones, pero no, es cualquier elemento GUI.
-
@mauro: Yo sabia que ivas a tener ese problema, podes usar una funcion que yo cree para que puedas obtener una dimension que no este usada. function getFreeDimension ( ) local dim = 0 local tempTable = { } for index, player in ipairs ( getElementsByType ( "player" ) ) do tempTable [ getElementDimension ( player ) ] = true end repeat dim = dim + 1 until not tempTable [ dim ] return tonumber ( dim ) end La cosa es que yo la uso server side, no se si va a funcionar bien client side.
-
That's really wrong. -- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.4925,0.3317,0.51,0.6717,"GUI Admin",true) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(11,87,167,307,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.7) GUIEditor_Edit[1] = guiCreateEdit(11,46,167,34,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(191,46,103,38,"Mute",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(191,96,103,38,"Ban",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(191,146,103,38,"Kick",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(191,200,103,38,"Dimension",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(191,259,103,38,"Warp to Player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(190,345,213,51,"Admin Panel By ElMota",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Button[6] = guiCreateButton(313,46,86,38,"Resources",false,GUIEditor_Window[1]) GUIEditor_Window[2] = guiCreateWindow(0.35,0.2783,0.3388,0.4217,"Ban Times",true) guiWindowSetSizable(GUIEditor_Window[2],false) GUIEditor_Button[7] = guiCreateButton(32,39,189,40,"1 Year",false,GUIEditor_Window[2]) GUIEditor_Button[8] = guiCreateButton(32,87,189,40,"1 Month",false,GUIEditor_Window[2]) GUIEditor_Button[9] = guiCreateButton(32,138,189,38,"1 Day",false,GUIEditor_Window[2]) GUIEditor_Button[10] = guiCreateButton(172,216,90,28,"Cancelar",false,GUIEditor_Window[2]) GUIEditor_Window[3] = guiCreateWindow(0.2988,0.2867,0.4737,0.4267,"Dimension GUI",true) GUIEditor_Label[2] = guiCreateLabel(48,102,107,18,"Set Dimension ...",false,GUIEditor_Window[3]) GUIEditor_Edit[2] = guiCreateEdit(131,123,65,27,"",false,GUIEditor_Window[3]) GUIEditor_Button[11] = guiCreateButton(246,199,120,44,"Set Dimension",false,GUIEditor_Window[3]) GUIEditor_Button[12] = guiCreateButton(9,199,120,44,"Cancel",false,GUIEditor_Window[3]) GUIEditor_Window[4] = guiCreateWindow(0.3613,0.13,0.3025,0.845,"GUI Resources",true) guiWindowSetSizable(GUIEditor_Window[4],false) GUIEditor_Grid[2] = guiCreateGridList(21,71,201,358,false,GUIEditor_Window[4]) guiGridListSetSelectionMode(GUIEditor_Grid[2],2) guiGridListAddColumn(GUIEditor_Grid[2],"resources :",0.2) GUIEditor_Edit[3] = guiCreateEdit(23,32,197,35,"",false,GUIEditor_Window[4]) GUIEditor_Button[13] = guiCreateButton(141,453,92,37,"Start Resource",false,GUIEditor_Window[4]) GUIEditor_Button[14] = guiCreateButton(10,453,92,37,"Cancel",false,GUIEditor_Window[4]) guiSetVisible ( GUIEditor_Window[1], false ) guiSetVisible ( GUIEditor_Window[2], false ) guiSetVisible ( GUIEditor_Window[3], false ) guiSetVisible ( GUIEditor_Window[4], false ) showCursor ( false ) function GUIOpen ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent ( "onVisibleAdmin", true ) addEventHandler ( "onVisibleAdmin", getLocalPlayer(), GUIOpen ) function clientsideResourceStart ( ) guiGridListClear ( GUIEditor_Grid[1] ) for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName ( playeritem ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) addEventHandler ( "onClientPlayerJoin", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerQuit", root, clientsideResourceStart ) addEventHandler ( "onClientPlayerChangeNick", root, clientsideResourceStart ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible(GUIEditor_Window[2],true) elseif ( source == GUIEditor_Button[10] ) then guiSetVisible ( GUIEditor_Window[2], false ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible ( GUIEditor_Window[3], true) elseif ( source == GUIEditor_Button[12] ) then guiSetVisible ( GUIEditor_Window[3], false ) elseif ( source == GUIEditor_Button[1] ) then local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, column ) triggerServerEvent ( "mute", localPlayer, playerName ) end end end ) addEventHandler ( "onClientGUIChanged", GUIEditor_Edit[1], function ( ) local text = guiGetText ( source ) for row = 1, guiGridListGetRowCount ( GUIEditor_Grid[1] ) do if ( guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) == text ) then guiGridListSetSelectedItem ( GUIEditor_Grid[1], row, 1 ) end end end ,false ) -- server side: function opGUI ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "onVisibleAdmin", thePlayer ) end end addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "p", "down", opGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "p", "down", opGUI ) end end ) addEvent("mute", true) addEventHandler("mute", getRootElement(), function ( playerName ) local thePlayer = getPlayerFromName ( playerName ) if ( not thePlayer ) then outputChatBox ( "Este jugador no esta online.", source ) end if setPlayerMuted ( thePlayer, true ) then outputChatBox ( "Has Sido Muteado por un Admin", thePlayer ) end end )
-
Cambia la dimension del jugador? setElementDimension
-
Si, eso estaria bien, igual no hay porque definir "user" . Ademas aconsejo verificar si el que lo mato al jugador existe y es un jugador. function SetSpect ( killer ) if ( killer and getElementType ( killer ) == "player" ) then setCameraTarget ( localPlayer, killer ) end end addEventHandler ( "onClientPlayerWasted", localPlayer, SetSpect )
-
Cuando una variable esta fuera de la funcion y la haces local, entonces no podras usarla en otro script en el mismo recurso, lo mismo pasa con las tablas. El orden importa, no podes hacer lo que vos hiciste ahi, el evento va despues de la funcion, AMENOS que lo hagas asi: addCommandHandler ( "traer", function () -- código end ) Los scripts server side son globales, osea que si defines una variable y luego la cambias, se cambia para todo el servidor. Pero tambien estan los scripts client side, que ahi no pasa lo mismo, las variables son solo para el jugador local.
-
Hola Julián y bienvenido al foro. 1: "local" se usa para que una variable pueda ser usada solo dentro de la funcion que donde la definiste, si pones algo asi: function hola ( ) local miVariable = "Hola Mundo!" end No vas a poder acceder a la variable "miVariable". Pero si le quitas el "local", entonces si. Tambien existen tablas y arrays en Lua, eso es mas conmeniente para cuando necesitas guardar mucha informacion. 2: Podes usar Account data/SQLite/MySQL/XML, para mucha informacion recomiendo MySQL o SQLite. Funciones SQLite: executeSQLCreateTable executeSQLDelete executeSQLDropTable executeSQLInsert executeSQLQuery executeSQLSelect executeSQLUpdate Funciones para MySQL y tambien SQLite: dbConnect dbExec dbQuery dbPoll dbFree Sobre los datos temporales se referia a: getElementData setElementData
-
Entonces deberias hablar mejor, si no nadie te va a entender .
-
Yo no tengo ninguna obligación? yo ayudo a la gente porque quiero.
-
No hay porque cerrarlo, talvez otro tenga un problema similar . P.D: De nada.
-
No necesitas otra tabla Edikosh, puede usar la misma . GUIEditor_Button = {} GUIEditor_Edit = {} local rotation = 0 local numero = 1 local skins = { { 0, "CJ" }, { 7, "Nombre" }, { 9, "Nombre 2" }, { 10, "Nombre 3" }, { 11, "Nombre 4" } } GUIEditor_Button[1] = guiCreateButton(624,753,104,33,"<~~",false) GUIEditor_Button[2] = guiCreateButton(883,753,104,33,"~~>",false) GUIEditor_Button[3] = guiCreateButton(751,796,104,33,"Play!",false) GUIEditor_Edit[1] = guiCreateEdit(751,753,103,29,"",false) for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], false ) end guiSetVisible ( GUIEditor_Edit[1], false ) addEvent("onVisible",true) addEventHandler("onVisible", getLocalPlayer(), function() for i=1, 3 do guiSetVisible ( GUIEditor_Button[i], true ) end guiSetVisible ( GUIEditor_Edit[1], true ) showPlayerHudComponent ("radar",false) showCursor(true) guiSetInputMode("no_binds_when_editing") triggerServerEvent("onCameraMatrix", getLocalPlayer()) ped = createPed( 0, -1586.671875, 1351.53125, 8.2823114395142 ) end ) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor_Button[3] then guiSetVisible(GUIEditor_Button[1],false) guiSetVisible(GUIEditor_Button[2],false) guiSetVisible(GUIEditor_Button[3],false) guiSetVisible(GUIEditor_Edit[1],false) setCameraTarget( localPlayer ) showCursor(false) setElementPosition( localPlayer, 2580.7265625, 2328.77734375, 17.822208404541) local skin = getElementModel( ped ) setElementModel( localPlayer, tonumber(skin) ) destroyElement(ped) showPlayerHudComponent ("radar",true) end end ) function rotateTempPed ( ) if isElement ( ped ) then rotation = rotation + 1 if ( rotation > 359 ) then rotation = 0 end setPedRotation ( ped, rotation ) end end addEventHandler ( "onClientRender", root, rotateTempPed ) function on_pushButton_2_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero == 1 ) then return end numero = numero - 1 setElementModel ( ped, skins [ numero ] [ 1 ] ) guiSetText ( GUIEditor_Edit[1], skins [ numero ] [ 2 ] ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], on_pushButton_2_clicked ) function on_pushButton_3_clicked ( button, state ) if ( button == "left" and state == "up" ) then if ( numero >= #skins ) then return end numero = numero + 1 setElementModel ( ped, skins [ numero ] [ 1 ] ) guiSetText ( GUIEditor_Edit[1], skins [ numero ] [ 2 ] ) end end addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], on_pushButton_3_clicked )
-
Lo que vos queres es crear la interface cuando se inicie el recurso? function build_MainWindow() local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 414, 381 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, "Login windows By Oter", false) guiWindowSetSizable(gui["_root"], false) gui._placeHolders["toolBox"] = {left = 40, top = 65, width = 331, height = 231, parent = gui["_root"]} gui[""] = guiCreateScrollPane(40, 65, 100, 30, false, gui["_root"]) gui._placeHolders["qt_calendar_calendarview"] = {left = 31, top = 11, width = 100, height = 30, parent = gui[""]} gui["qt_spinbox_lineedit"] = guiCreateEdit(31, 11, 76, 30, "2012", false, gui[""]) guiEditSetMaxLength(gui["qt_spinbox_lineedit"], 32767) gui[""] = guiCreateScrollPane(40, 125, 331, 171, false, gui["_root"]) gui._placeHolders["textEdit"] = {left = 17, top = 11, width = 303, height = 149, parent = gui[""]} return gui, windowWidth, windowHeight end addEventHandler ( "onClientResourceStart", resourceRoot, build_MainWindow )
-
You want all server vehicles currently created? if so use: for index, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- Code here end