Jump to content

Sensacion

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Sensacion

  1. Sensacion

    Shout Admin

    Reemplaza lo de client por esto: function shouts( message ) if isTimer( d ) then return end theText = message addEventHandler ( "onClientRender", root, drawing ) d = setTimer ( function() removeEventHandler( "onClientRender", root, drawing ) end, 5000, 1 ) end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) function drawing() dxDrawText( theText, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) end tampoco, no aparece nada en la pantalla ya lo probé y funciona pero aparece a un costado, tienes que arreglar las coordenadas.
  2. Sensacion

    Shout Admin

    Reemplaza lo de client por esto: function shouts( message ) if isTimer( d ) then return end theText = message addEventHandler ( "onClientRender", root, drawing ) d = setTimer ( function() removeEventHandler( "onClientRender", root, drawing ) end, 5000, 1 ) end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) function drawing() dxDrawText( theText, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) end
  3. Sensacion

    Shout Admin

    Se me ocurre algo así: Server: function shout( player, cmd, ... ) local accountname = getAccountName( getPlayerAccount( player ) ) local w = {...} local message = table.concat(w, " ") if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( root, "onShouts", root, message ) else outputChatBox( "* #0080FFNo puedes usar este comando!", player, 255, 255, 255, true ) end end addCommandHandler( "shout", shout ) Client: function shouts( message ) if isTimer( d ) then killTimer( d ) end message = message addEventHandler ( "onClientRender", root, drawing ) d = setTimer ( function() removeEventHandler( "onClientRender", root, drawing ) end, 5000, 1 ) end addEvent( "onShouts", true ) addEventHandler( "onShouts", getRootElement(), shouts ) function drawing() dxDrawText( message, 0.5, 0.5, 2, 0, tocolor ( 255, 255, 255, 255 ), 3, "default-bold", "center", "center", false, false, true, true, false ) end
  4. Quizá estás poniéndole nil como string.
  5. Sensacion

    Ayuda Script

    isElementInWater pero para poner esa funcion es un triger event en server-side? o en el mismo client? En el mismo client, cuando devuelva true trigeas a server y apagas el fuego.
  6. está mal discoState[player] = false en onPlayerJoin y en onPlayerQuit, reemplaza player por source.
  7. Sensacion

    Ayuda Script

    Un timer en client side para detectar si está en agua y trigear a server para el killtimer del setPedOnFire indexado de un player.
  8. Sensacion

    Ayuda Script

    o: gracias, una pregunta, sabes como hacer para que al meterse al agua se apague? con otro timer
  9. significa que pruebes con lo que puse
  10. function elementosGUI() showCursor(true) --Ventana GUI.ventana[1] = guiCreateWindow(20, 200, 264, 283, "Controlador de datos", false) guiWindowSetSizable(GUI.ventana[1], false) --Tab panel GUI.tabpanel[1] = guiCreateTabPanel(9, 26, 245, 247, false, GUI.ventana[1]) --Tab guardar GUI.tab[1] = guiCreateTab("Guardar", GUI.tabpanel[1]) --Labels GUI.label[1] = guiCreateLabel(19, 19, 58, 17, "Jugador: ", false, GUI.tab[1]) guiSetFont(GUI.label[1], "default-bold-small") GUI.label[2] = guiCreateLabel(19, 70, 58, 17, "Dato: ", false, GUI.tab[1]) guiSetFont(GUI.label[2], "default-bold-small") GUI.label[3] = guiCreateLabel(18, 123, 58, 17, "Valor:", false, GUI.tab[1]) guiSetFont(GUI.label[3], "default-bold-small") --Edits GUI.edit[1] = guiCreateEdit(19, 36, 203, 30, "", false, GUI.tab[1]) GUI.edit[2] = guiCreateEdit(19, 87, 203, 30, "", false, GUI.tab[1]) GUI.edit[3] = guiCreateEdit(18, 140, 203, 30, "", false, GUI.tab[1]) --Botones GUI.boton[1] = guiCreateButton(76, 182, 67, 27, "Aceptar", false, GUI.tab[1]) GUI.boton[2] = guiCreateButton(154, 182, 67, 27, "Borrar", false, GUI.tab[1]) --Tab cargar GUI.tab[2] = guiCreateTab("Cargar", GUI.tabpanel[1]) --Labels GUI.label[4] = guiCreateLabel(19, 19, 58, 17, "Jugador: ", false, GUI.tab[2]) guiSetFont(GUI.label[4], "default-bold-small") GUI.label[5] = guiCreateLabel(19, 70, 58, 17, "Dato: ", false, GUI.tab[2]) guiSetFont(GUI.label[5], "default-bold-small") GUI.label[6] = guiCreateLabel(18, 123, 58, 17, "Valor:", false, GUI.tab[2]) guiSetFont(GUI.label[6], "default-bold-small") --Edits GUI.edit[4] = guiCreateEdit(19, 36, 203, 30, "", false, GUI.tab[2]) GUI.edit[5] = guiCreateEdit(19, 87, 203, 30, "", false, GUI.tab[2]) GUI.edit[6] = guiCreateEdit(18, 140, 203, 30, "", false, GUI.tab[2]) guiEditSetReadOnly(GUI.edit[6], true) --Botones GUI.boton[3] = guiCreateButton(76, 182, 67, 27, "Aceptar", false, GUI.tab[2]) GUI.boton[4] = guiCreateButton(154, 182, 67, 27, "Borrar", false, GUI.tab[2]) --Eventos addEventHandler('onClientGUIClick', GUI.boton[1], guardar, false ) addEventHandler('onClientGUIClick', GUI.boton[2], borrarGuardar, false ) addEventHandler('onClientGUIClick', GUI.boton[3], cargar, false ) addEventHandler('onClientGUIClick', GUI.boton[4], borrarCargar, false ) end
  11. Prueba con algo como: function hill_Enter ( hitElement ) if getElementType ( hitElement ) == "vehicle" then setVehicleDamageProof( hitElement, true) end end addEventHandler ( "onColShapeHit", hillArea, hill_Enter )
  12. Si es un colshape con onColShapeHit
  13. Editado Ok! "dr programador de mta"
  14. En realidad no se crean scripts. Se crean recursos. Estos recursos son interpretados. Para ser interpretados son leidos, y es exactamente lo mismo que ocurre con un programa. Es programación, pero de una forma distinta a la normal No te pregunté como funciona, en la wiki de mta dice Scripting, pero si para ti eso es programación, es cosa tuya, me quedo con lo de la wiki. http://es.wikipedia.org/wiki/Script_(inform%C3%A1tica)
  15. Ah bueno, no lo tenía del claro, al conversar con un amigo de experiencia le dije que ya se varios lenguajes y ahora último lua, me dijo que lua es solo script, y solid me dijo algo similar, pero igual lo que se hace en mta es solo crear scripts.
  16. lua no es un lenguaje de programación.
  17. como podria hacer para que los autos que esten en cierta area no exploten? osea si se como pero me refiero a detectar cuales estan dentro? getElementHealth setVehicleDamageProof
  18. Prueba cambiando: local fNitroLevel = getVehicleNitroLevel( car ) por esto: local fNitroLevel = getVehicleNitroLevel( car ) or 0 local fNitroLevel = math.floor( fNitroLevel*100 ) if fNitroLevel == 0 then fNitroLevel = "no nitro" end
  19. I agree with NeonBlack, luac.multitheftauto.com should be optional
  20. Usa getPlayerName y le cambias de color.
  21. updateText = function() texto = msgs[math.random(#msgs)] end setTimer(updateText, 2000, 0) texto es la variable.
  22. Uhmm también podrías usar metatables para inventarios opcionales, depende de ti.
×
×
  • Create New...