Jump to content

Sasu

MTA Contributors
  • Posts

    1,056
  • Joined

  • Last visited

Everything posted by Sasu

  1. guiGridListGetItemText return a string, not a table. Replace line 5 to this one: table.insert(tabel, map) Edit: Where have you define 'maps'?
  2. Sasu

    Table Error

    local teams = {} local teamacl = {} function CreateNewTeam(player, cmd, newteam, tagname, gettag) if not gettag then outputChatBox("Please Specify the command completly!", getRootElement()) return end if (isObjectInACLGroup("user"..(getAccountName(getPlayerAccount(player))), aclGetGroup("Admin"))) then -- Check team if not teams.newteam then for v, i in ipairs(teams) do -- Check name if string.match(teams.v.name, tagname) then return outputChatBox('Tag Name is already occupied!', player) end -- Check tag if string.match(teams.v.tag, gettag) then return outputChatBox('Tag recognizing is already occupied!', player) end end local gettaglower = string.lower(gettag) teams[newteam] = {["name"] = ""..tagname.."", ["tag"] = ""..gettaglower.."" } teamacl[newteam] = aclCreateGroup(newteam) triggerEvent("onCreateNewTeam", newteam) else outputChatBox("Team already exists!", player) -- Team already exists end else outputChatBox("You cant use this!", player) end end addCommandHandler("newteam", CreateNewTeam, false,false)
  3. Sasu

    Table Error

    teams[newteam] = { ['name'] = tagname, -- Make sure "tagname" is defined ['tag'] = gettaglower, -- make sure "gettaglower" is defined } Also make sure "team" is defined as table.
  4. setCameraMatrix -- Para hacer que mire LV createExplosion -- Para crear explosiones setTimer -- Para crear las explosiones en diferentes tiempos Debes hacerlo todo en client side.
  5. Bueno, se que es algo tarde, pero como dice el dicho: " Mejor tarde que nunca ". Bueno, si quieres mas informacion, contactame por MP.
  6. Para reducir lineas, en la parte del comando, puedes remplazarlo por esto: addCommandHandler ( "panel", function () local value = guiGetVisible(PanelObjetosMapa) guiSetVisible(PanelObjetosMapa,not value) showCursor (not value) end end )
  7. En vez de un loop y utilizar el valor (v) para el outputChatBox es mejor utilizar root, seria mas eficiente.
  8. Recuerda que tienes que estar en el equipo "Criminals"
  9. Use onClientPreRender
  10. Because you have to update the variable "text" each time you change the gui text. Try this: local maxLabelSizeTable = {40,40,40,40,40} local makeTextFitForGrid = function (element,index) local text local size = guiLabelGetTextExtent ( element ) outputChatBox(size) local maxSize = maxLabelSizeTable[index] if size > maxSize then repeat text = guiGetText(element) guiSetText( element,string.sub(text,1,-2)) size = guiLabelGetTextExtent ( element ) until maxSize > size text = guiGetText(element) guiSetText( element, text .. "..") end end
  11. Sasu

    Solved

    Go to [admin]/server/admin_server.lua and try to replace line 527 this: if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end to this one: if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b, true ) end
  12. Sasu

    Small question

    local numberConverted = tonumber ( string.format ( "%.2f", -2029.6357442187 ) ) This will return -2029.63
  13. Sasu

    Small question

    local x, y, z = unpack ( split ( "-2035,148,28", ", " ) )
  14. Con respecto a este tema, intenta con esto: Cliente: addEvent("onServerSendMusicList",true) addEvent("OEZI",true) VolumenC = 1 Canciones = { } ASDF = false sx , sy=guiGetScreenSize() addEventHandler("OEZI",root, function() local state = ( not guiGetVisible ( Ventana ) ) guiSetVisible ( Ventana, state ) showCursor ( state ) end) Ventana = guiCreateWindow(sx/2-230,sy/2-225,504,464,"Canciones",false) guiWindowSetSizable(Ventana, false) Lista = guiCreateGridList(9, 21, 485, 383, false, Ventana) guiGridListAddColumn(Lista, "ID", 0.1) guiGridListAddColumn(Lista, "Nombre", 0.5) guiGridListAddColumn(Lista, "Duracion", 0.2) Play = guiCreateButton(10, 404, 125, 22, "Reproducir", false, Ventana) Stop = guiCreateButton(135, 404, 125, 22, "Parar", false, Ventana) Volumen = guiCreateScrollBar(260, 404, 167, 22, false, false, Ventana) guiScrollBarSetScrollPosition(Volumen, 2.0) Cargar = guiCreateButton(10, 432, 256, 22, "Cargar canciones desde la Base de datos", false, Ventana) Repetir = guiCreateCheckBox(287, 427, 163, 27, "Repetir Cancion", false, false, Ventana) guiSetVisible(Ventana,false) function CargarDatos(b) if b ~= "left" then return end if source ~= Cargar then return end if guiGetEnabled(Cargar) then triggerServerEvent("onClientRequestMusicList",localPlayer) guiGridListClear(Lista) Canciones = nil if ASDF then destroyElement(ASDF) ASDF = false end destroyElement(Cargar) end end addEventHandler("onClientGUIClick",Cargar,CargarDatos) function GridCanciones(songs) Canciones = songs for k,song in ipairs(Canciones) do local row = guiGridListAddRow(Lista) guiGridListSetItemText(Lista,row,1,k,false,true) guiGridListSetItemText(Lista,row,2,song.name,false,false) guiGridListSetItemText(Lista,row,3,song.length,false,false) end guiSetEnabled(Play,true) end addEventHandler("onServerSendMusicList",root,GridCanciones) function Reproductor(b) if b ~= "left" then return end if source ~= Play then return end local selected = guiGridListGetSelectedItem(Lista) + 1 if selected > 0 then if not ASDF then ASDF = playSound(Canciones[selected].url,guiCheckBoxGetSelected(Repetir)) triggerServerEvent("onSongStart", localPlayer, Canciones[selected].url, guiCheckBoxGetSelected(Repetir)) setSoundVolume(ASDF,Volumen) -- Creo que aqui te dara error puesto que 'Volumen' si no me equivoco devuelve un boolean. guiSetEnabled(Stop,true) guiSetEnabled(Play,false) end end end addEventHandler("onClientGUIClick",Play,Reproductor) addEvent("onClientSongStart", true) addEventHandler("onClientSongStart", root, function(url, repeatBool) ASDF = playSound(url, repeatBool) end) function Parar(b) if b ~= "left" then return end if source ~= Stop then return end if ASDF then destroyElement(ASDF) ASDF = false guiSetEnabled(Play,true) guiSetEnabled(Stop,false) end end addEventHandler("onClientGUIClick",Stop,Parar) addEventHandler("onClientGUIScroll",Volumen, function() VolumenC=guiScrollBarGetScrollPosition(Volumen)/100 if ASDF then setSoundVolume(ASDF,VolumenC) end end) Server: Canciones = { } Canciones[1] = { name = "Los Picantes - Mamut Chiquitito", length = "04:22", url = "http://dc495.4shared.com/img/570535322/6a7a4ae0/dlink__2Fdownload_2F6DF4SbUs_3Ftsid_3D20140117-062138-6604aea4/preview.mp3", } Canciones[2] = { name = "Los Picantes - Falso Amor 'Maraca'", length = "06:01", url = "http://dc312.4shared.com/img/790339471/2cb89f8b/dlink__2Fdownload_2FA4JPoV4N_3Ftsid_3D20140117-062257-ef3182c/preview.mp3", } addEvent("onClientRequestMusicList",true) addEventHandler("onClientRequestMusicList",root, function() triggerClientEvent(source,"onServerSendMusicList",root,Canciones) end) addEvent("onSongStart", true) addEventHandler("onSongStart", root, function(url, repeatBool) if url then if repeatBool == nil then repeatBool = false end triggerClientEvent("onClientStartSong", root) end end) function FactorPanel( thePlayer ) local acc = getPlayerAccount ( thePlayer ) if not isGuestAccount( acc ) then if isObjectInACLGroup ("user."..getAccountName ( acc ), aclGetGroup ( "Owner" ) ) then triggerClientEvent (thePlayer, "OEZI", thePlayer) end end end addEventHandler( 'onPlayerLogin', root, function() bindKey ( source, "F5", "down", FactorPanel ) end ) for k, i in ipairs( getElementsByType( 'player' )) do bindKey ( i, "F5", "down", FactorPanel ) end
  15. Where have you define "angle"?
  16. Tambien puedes usar ese metodo..Igualmente usando playSound3D tiene que funcionar.. No debido a que playSound3D o playSound no esta sincronizado con el server y solo se ejecutaria para el cliente que presiono el boton. Deberias saber eso.
  17. Tenes que hacer un trigger en el cliente enviando los datos (url, info, etc.) al server y luego lo envias al cliente para todos los jugadores y ahi haces playSound.
  18. Use: string.len(guiGetText(source)) or #(guiGetText(source)) To get first the lenght and check if is empty if string.len(guiGetText(source)) > 0 then
  19. Sasu

    dxDrawText

    Line 13: addEventHandler should be removeEventHandler to stop rendering the text.
  20. Aqui puedes ver los codigos de errores: https://wiki.multitheftauto.com/wiki/Error_Codes
  21. local screenWidth, screenHeight = guiGetScreenSize() local sx, sy = screenWidth/1400, screenHeight/900 --(...) guiCreateLabel(1229*sx, 56*sy, 140*sx, 48*sy, "00:00", false) The same with dx positions.
  22. Give me your original positions from guieditor and the resolution where you used the guieditor.
  23. Try to use guieditor resource to get your preferred positions.
  24. Line 5: getScreenSize should be guiGetScreenSize
×
×
  • Create New...