-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Usa la grid list y luego usas las funciones: guiGridListGetSelectedItem guiGridListGetItemText
-
Tu problema es el siguiente: function PanelRuedas() PanelRuedas = guiCreateWindow(290,201,357,410,"Ruedas",false) El nombre de la funcion es el mismo al de tu elemento GUI.
-
Of course, is a client side script.
-
There's nothing to fix, you just get always the same random number, you could make a check so it doesn't return the same always.
-
Must be that it always returns 1, because here I see others as well.
-
Well, I set "gasmask" data to 1 and it worked, I didn't get chocked.
-
De nada. No hay porque cerrarlo, otro podria tener el mismo problema.
-
"player" no esta definido. Para bindear la tecla tenes que hacer un for-loop con los jugadores online y ahi bindearla.
-
function MyTestTextFunction ( ) if ( not text01 ) then display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text01 = textCreateTextItem ( "Report all the bugs you find with /report.", 0.01, 0.20 ) -- create a text item text02 = textCreateTextItem ( "Some text", 0.01, 0.20 ) -- create a text item text03 = textCreateTextItem ( "Some text", 0.01, 0.20 ) -- create a text item textItemSetScale ( text01, 1.5) textItemSetScale ( text02, 1.5) textItemSetScale ( text03, 1.5) local any = math.random ( 1, 3 ) if ( any == 1 ) then textDisplayAddText ( display, text01 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text01 ) text01 = nil end ,20000, 1 ) elseif ( any == 2 ) then textDisplayAddText ( display, text02 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text02 ) text02 = nil end ,20000, 1 ) elseif ( any == 3 ) then textDisplayAddText ( display, text03 ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text03 ) text03 = nil end ,20000, 1 ) end end end setTimer ( MyTestTextFunction, 15000, 0 ) addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction ) You had a missing 'end'.
-
Que yo sepa es: "capslock".
-
What do you mean by done before? this function has been used a lot of times by a lot of people, including myself for a bank robbery alarm.
-
playSound3D
-
1: Quita 'thePlayer' de la funcion. 2: Tu elemento no es 'thePlayer', es 'source'.
-
The element: "infopoint" exist?
-
http://lua-users.org/wiki/TablesTutorial
-
-- Gas mask: function cancelTearGasChoking ( weaponID ) local gas = getElementData ( localPlayer, "gasmask" ) -- You have to get it inside the function. if ( weaponID == 17 ) and ( gas == 1 ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerChoke", localPlayer, cancelTearGasChoking ) About blood, I don't know what's wrong with it.
-
Make a table and a index variable, update it each time: "MyTestTextFunction" function is executed and get the new text.
-
function MyTestTextFunction ( ) if ( not text ) then display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Report all the bugs you find with /report.", 0.01, 0.20 ) -- create a text item textItemSetScale ( text, 1.5) textDisplayAddText ( display, text ) -- Add the text item to the text display setTimer ( function ( ) textDestroyTextItem ( text ) text = nil end ,20000, 1 ) end end setTimer ( MyTestTextFunction, 15000, 0 ) addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction ) Seems like: "textDestroyTextItem" doesn't remove the element, now it works.
-
That's because again, you forgot the commas after ")" in createObject.
-
That should create the text every 15 seconds if it doesn't exist already.
-
@Alexs_Steel: There's an extra 'end'.
-
1: No deberias llamar a tu funcion como el boton. 2: El event handler tiene que ir dentro de la funcion: Panel ( ), ademas al ultimo tenes que poner "false", no "true", si no cuando presiones otro GUI se ejecutara esa funcion. 3: Usa esto: function Panel() Panel = guiCreateWindow(850,197,494,410,"",false) guiSetAlpha(Panel,0.75) guiWindowSetMovable(Panel,false) guiWindowSetSizable(Panel,false) Reparar = guiCreateButton(17,31,83,34,"Repair",false,Panel) addEventHandler ( "onClientGUIClick", Reparar, RepararVehiculo, false ) guiSetAlpha(Reparar,0.80000001192093) guiSetFont(Reparar,"default-bold-small") Cerrar = guiCreateButton(179,348,106,38,"Cerrar",false,Panel) guiSetFont(Cerrar,"default-bold-small") Info = guiCreateMemo(413,21,72,358,"Repair=100\nNitro=500",false,Panel) end addCommandHandler ( "guimecanico", Panel ) function RepararVehiculo () triggerServerEvent("onFix", getLocalPlayer()) end
-
Lo siento, ami me gustan las mujeres De nada.