Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Problema

    Porque es client side.
  2. Usa la grid list y luego usas las funciones: guiGridListGetSelectedItem guiGridListGetItemText
  3. 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.
  4. Of course, is a client side script.
  5. 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.
  6. Must be that it always returns 1, because here I see others as well.
  7. Well, I set "gasmask" data to 1 and it worked, I didn't get chocked.
  8. De nada. No hay porque cerrarlo, otro podria tener el mismo problema.
  9. "player" no esta definido. Para bindear la tecla tenes que hacer un for-loop con los jugadores online y ahi bindearla.
  10. 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'.
  11. 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.
  12. 1: Quita 'thePlayer' de la funcion. 2: Tu elemento no es 'thePlayer', es 'source'.
  13. http://lua-users.org/wiki/TablesTutorial
  14. -- 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.
  15. Make a table and a index variable, update it each time: "MyTestTextFunction" function is executed and get the new text.
  16. 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.
  17. That's because again, you forgot the commas after ")" in createObject.
  18. That should create the text every 15 seconds if it doesn't exist already.
  19. @Alexs_Steel: There's an extra 'end'.
  20. 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
  21. Castillo

    Que falla?

    Lo siento, ami me gustan las mujeres De nada.
×
×
  • Create New...