Jump to content

Search the Community

Showing results for tags 'help'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Hi, I want to create a simple event with a check I wrote down two local variables that create a team In the spawn function of the player specified setPlayerTeam If the player hit the marker, then a message is shown in the chat, if, of course, he is in this team Also I tried this function getPlayerTeam But as far as I understand it is not required here, I hope I'm not mistaken Well, I'm hoping for your help.
  2. This is the code (not the full): addEvent("robbed", true ) addEventHandler("robbed", root, function () setTimer(function() addEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end, 10000, 1) setTimer(function() removeEventHandler("onClientRender",root,remainingtime); resetTimer(remainingt) end,1800000,1) end) and when i reconnect to the server, the remainingtime dx elements are hide.. how to fix this?
  3. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  4. This is the code: When i type twice " /asd " the marker position does not change.. How to fix this?
  5. This is the code: And i get this warnings: bad argument @ 'stopSound' [expected sound at argument 1, got nil] and bad argument @ 'detachElement' [expected element at argument 1, got nil] .. -.- how to fix this?
  6. I want create a script, which create a marker with random position, from a table. How to make this?
  7. (PT) -tem como eu colocar bots em uma base, e configura-los para atacar qualquer player que se aproximar ? (ENG) -how do I put bots on a base, and configure them to attack any player that approaches?
  8. How do I create a script that allows players to choose a team and start with Specific Skins and Spawn on the specific base of the team? If anyone can help me, thank you very much.
  9. someone knows how I can achieve what is shown in the following images?
  10. [2018-01-12 14:55:12] ERROR: Could not load /home/gameservers/mta/turbo1/x64/./dbconmy.so - /home/gameservers/mta/turbo1/x64/./dbconmy.so: symbol __cxa_pure_virtual, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference[2018-01-12 14:55:12] ERROR: san_mysql/server.lua:19: dbConnect failed; Could not connect [2018-01-12 14:55:12] INFO: [mysql]: Sikertelen MYSQL csatlakozás! please help me, how to fix this?
  11. This is the code: addEvent ( "aPlayer", true ) addEventHandler ( "aPlayer", _root, function ( player, action, data, additional, additional2, kickedname ) if checkClient( "command."..action, source, 'aPlayer', action ) then return end if not isElement( player ) then return -- Ignore if player is no longer valid end if ( hasObjectPermissionTo ( source, "command."..action ) ) then local admin = source local mdata = "" local more = "" if ( action == "kick" ) then local reason = data or "" mdata = reason~="" and ( "(" .. reason .. ")" ) or "" setTimer ( kickPlayer, 100, 1, player, source, reason ) exports.ig_kickban:showBoxS (root ,"Kirúgás", player.." kirúgta "..source.." nevű játékost", "kick") the exports.ig_ki...etc line does not working.. why? i get this error: "Attempt to concatenate global source (a userdata value)"
  12. I tried triggering, but does not working :c How to get my account name in client side?
  13. I have lag in foggy weather and i want to completely remove fog from my game. I play on mta pubg server and game lags whenever I get fog weather. I have replaced the models of smoke with empty png files and the smoke and couds vanished , but lag is still there. I want to remove fog completely. Please help.
  14. what is the commands to create a video intro for server ? and how to create automated video stop timer ? addEventHandler("onClientResourceStart",resourceRoot, function () ? = ?("video.mp4",true) end )
  15. this is the code: and the problem: if i'm far away then the dx elements will be bigger, and when i'm closer.. how to fix this?
  16. I have this music script but it does not destroy the music when the vehicle is destroyed and how can I solve it? client function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 guiSetPosition(center_window, x, y, false) end GUIEditor = { tab = {}, label = {}, tabpanel = {}, edit = {}, button = {}, window = {}, scrollbar = {}, radiobutton = {} } GUIEditor.window[1] = guiCreateWindow(500, 187, 378, 280, "Radio Vehicular", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 358, 227, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Radio", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 178, 16, "Ingresa una url:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.edit[1] = guiCreateEdit(10, 31, 199, 26, "", false, GUIEditor.tab[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(20, 67, 18, 15, "", false, GUIEditor.tab[1]) GUIEditor.radiobutton[2] = guiCreateRadioButton(112, 69, 18, 15, "", false, GUIEditor.tab[1]) GUIEditor.label[2] = guiCreateLabel(44, 67, 60, 17, "Radio/Web", false, GUIEditor.tab[1]) GUIEditor.label[3] = guiCreateLabel(133, 67, 200, 17, "Youtube", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(13, 97, 91, 28, "Reproducir", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.scrollbar[1] = guiCreateScrollBar(20, 161, 239, 22, true, false, GUIEditor.tab[1]) guiScrollBarSetScrollPosition(GUIEditor.scrollbar[1], 100.0) GUIEditor.label[4] = guiCreateLabel(10, 135, 178, 16, "Volumen:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[4], "default-bold-small") porcientomusica = guiCreateLabel(67, 135, 86, 17, "0%", false, GUIEditor.tab[1]) GUIEditor.button[2] = guiCreateButton(114, 97, 91, 28, "Detener", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.tab[2] = guiCreateTab("Mis links", GUIEditor.tabpanel[1]) GUIEditor.label[5] = guiCreateLabel(10, 10, 138, 15, "Ingresa el url a guardar:", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[5], "default-bold-small") GUIEditor.edit[2] = guiCreateEdit(10, 31, 199, 26, "", false, GUIEditor.tab[2]) GUIEditor.button[3] = guiCreateButton(145, 67, 74, 28, "Guardar", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") GUIEditor.button[4] = guiCreateButton(10, 67, 125, 28, "Ver links guardados", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[4], "default-bold-small") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA") closebutton = guiCreateButton(307, 249, 60, 24, "Cerrar", false, GUIEditor.window[1]) guiSetFont(closebutton, "default-bold-small") guiSetProperty(closebutton, "NormalTextColour", "FFAAAAAA") guiSetVisible( GUIEditor.window[1], false ) centerWindow ( GUIEditor.window[1] ) myLinksGUI = guiCreateWindow(378, 133, 503, 292, "Mis links", false) guiWindowSetSizable(myLinksGUI, false) mylinksGridlist = guiCreateGridList(9, 26, 485, 218, false, myLinksGUI) a = guiGridListAddColumn(mylinksGridlist, "Url", 0.5) b = guiGridListAddColumn(mylinksGridlist, "Fecha", 0.5) copyurlbutton = guiCreateButton(19, 254, 86, 29, "Copiar url", false, myLinksGUI) guiSetFont(copyurlbutton, "default-bold-small") guiSetProperty(copyurlbutton, "NormalTextColour", "FFAAAAAA") deleteurlbutton = guiCreateButton(115, 254, 86, 29, "Eliminar url", false, myLinksGUI) guiSetFont(deleteurlbutton, "default-bold-small") guiSetProperty(deleteurlbutton, "NormalTextColour", "FFAAAAAA") closeMyLinksGUI = guiCreateButton(211, 254, 86, 29, "Cerrar", false, myLinksGUI) guiSetFont(closeMyLinksGUI, "default-bold-small") guiSetProperty(closeMyLinksGUI, "NormalTextColour", "FFAAAAAA") guiSetVisible( myLinksGUI, false ) centerWindow ( myLinksGUI ) --guiSetEnabled( GUIEditor.radiobutton[2], false ) local radios = { } function openPanel( ) local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if isPedInVehicle( getLocalPlayer( ) ) and getVehicleController( veh ) == getLocalPlayer( ) then openMain( ) end end bindKey( "F5", "down", openPanel ) addCommandHandler( "radio", openPanel ) function openMain( ) if guiGetVisible( GUIEditor.window[1] ) == false then guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) guiSetText( porcientomusica, tostring( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) ).."%") else guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end end function clicksBotones( ) if source == GUIEditor.button[1] then if guiRadioButtonGetSelected( GUIEditor.radiobutton[1] ) == true or guiRadioButtonGetSelected( GUIEditor.radiobutton[2] ) == true then local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then local editT = guiGetText( GUIEditor.edit[1] ) if string.len( editT ) > 5 then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) triggerServerEvent ( "reproducirLink", getLocalPlayer( ), editT, veh, ( ( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) * 1.0 ) / 100 ), tipoRepro( ) ) else outputChatBox( "Link no valido!", 255, 255, 255, true ) end else outputChatBox( "Solo el conductor puede reproducir la radio!", 255, 255, 255, true ) end else outputChatBox( "Selecciona un tipo de url!", 255, 255, 255, true ) end elseif source == GUIEditor.button[2] then local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then triggerServerEvent ( "detenerRepro", getLocalPlayer( ), veh ) else outputChatBox( "Solo el conductor puede reproducir la radio!", 255, 255, 255, true ) end elseif source == closebutton then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) elseif source == GUIEditor.button[3] then local editT = guiGetText( GUIEditor.edit[2] ) if string.len( editT ) > 5 then triggerServerEvent ( "saveALink", getLocalPlayer( ), editT ) guiSetText( GUIEditor.edit[2], "" ) else outputChatBox( "Link no valido!", 255, 255, 255, true ) end elseif source == GUIEditor.button[4] then guiSetVisible( GUIEditor.window[1], false ) guiSetVisible( myLinksGUI, true ) guiGridListClear( mylinksGridlist ) triggerServerEvent ( "obtenerMisLnks", getLocalPlayer( ) ) elseif source == closeMyLinksGUI then guiSetVisible( GUIEditor.window[1], true ) guiSetVisible( myLinksGUI, false ) elseif source == copyurlbutton then local row, col = guiGridListGetSelectedItem( mylinksGridlist ) if row == -1 or col == -1 then outputChatBox( "Selecciona un Url!", 255, 255, 255, true ) return end local link = guiGridListGetItemText( mylinksGridlist, row, a ) setClipboard( link ) outputChatBox( "Url copiado al portapapeles!", 255, 255, 255, true ) elseif source == deleteurlbutton then local row, col = guiGridListGetSelectedItem( mylinksGridlist ) if row == -1 or col == -1 then outputChatBox( "Selecciona un Url!", 255, 255, 255, true ) return end local link = guiGridListGetItemText( mylinksGridlist, row, a ) triggerServerEvent ( "deleteALink", getLocalPlayer( ), link ) setTimer( function( ) guiGridListClear ( mylinksGridlist ) triggerServerEvent ( "obtenerMisLnks", getLocalPlayer( ) ) end , 250, 1 ) end end addEventHandler( "onClientGUIClick", getRootElement( ), clicksBotones ) function tipoRepro( ) local tipo if guiRadioButtonGetSelected( GUIEditor.radiobutton[1] ) == true then tipo = "radio" elseif guiRadioButtonGetSelected( GUIEditor.radiobutton[2] ) == true then tipo = "youtube" else tipo = "radio" end return tipo end function onVehicleExit( thePlayer ) if thePlayer == getLocalPlayer( ) then if guiGetVisible( GUIEditor.window[1] ) == true then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end if guiGetVisible( myLinksGUI ) == true then guiSetVisible( myLinksGUI, false ) showCursor( false ) end end end addEventHandler( "onClientVehicleExit", getRootElement( ), onVehicleExit ) function playASound( tipo, link, vehicle ) if tipo == "radio" then elseif tipo == "youtube" then end end function stopASound( vehicle ) if radios[vehicle] then stopSound( radios[vehicle] ) radios[vehicle] = nil end end addEvent( "stopActualVehicleSound", true ) addEventHandler( "stopActualVehicleSound", getLocalPlayer( ), stopASound ) local timerTitle function playAsound( url, vehicle, volumne, nameArtist ) if radios[vehicle] then stopSound( radios[vehicle] ) radios[vehicle] = nil end local tipo = tipoRepro( ) local x, y, z = getElementPosition( vehicle ) local link = url radios[vehicle] = playSound3D( link, x, y, z, false ) if isTimer( timerTitle ) then killTimer ( timerTitle ) end timerTitle = setTimer( function( ) if radios[vehicle] then local meta = getSoundMetaTags(radios[vehicle]) if tipo == 'radio' then if meta.stream_title and meta.stream_name then if isTimer( timerTitle ) then killTimer ( timerTitle ) end outputChatBox( tostring( meta.stream_name ), 255, 255, 255 ) outputChatBox( tostring( meta.stream_title ), 0, 255, 0 ) end elseif tipo == "youtube" then if meta.title then if isTimer( timerTitle ) then killTimer ( timerTitle ) end outputChatBox( "Youtube MP3", 255, 255, 255 ) outputChatBox( tostring( nameArtist ), 0, 255, 0, true ) end end end end, 3000, 0 ) setSoundMaxDistance( radios[vehicle], 30 ) setSoundVolume( radios[vehicle], volumne ) attachElements( radios[vehicle], vehicle ) end addEvent( "playVehicleSound", true ) addEventHandler( "playVehicleSound", getLocalPlayer( ), playAsound ) function setSoundCar( veh, vol ) if radios[veh] then setSoundVolume( radios[veh], tonumber( vol ) ) end end addEvent( "setActualVehicleVolume", true ) addEventHandler( "setActualVehicleVolume", getLocalPlayer( ), setSoundCar ) function soundCarVolume( ) local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then if radios[veh] then local porciento = ( ( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) * 1.0 ) / 100 ) triggerServerEvent( "setVolumeCar", getLocalPlayer( ), veh, porciento ) end end guiSetText( porcientomusica, tostring( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) ).."%") end addEventHandler( "onClientGUIScroll", GUIEditor.scrollbar[1], soundCarVolume ) function saads( url, fecha ) local row = guiGridListAddRow( mylinksGridlist ) guiGridListSetItemText( mylinksGridlist, row, a, url, false, false ) guiGridListSetItemText( mylinksGridlist, row, b, fecha, false, false ) end addEvent( "addGridLinks", true ) addEventHandler( "addGridLinks", getLocalPlayer( ), saads ) if fileExists("client.lua") then fileDelete("client.lua") end server local db = dbConnect( "sqlite", "dbData_byRex.db" ) local vehiculos = { } function reproll( url, vehicle, volumne, tipe ) if not vehiculos[vehicle] then vehiculos[vehicle] = true else triggerClientEvent( getRootElement( ), "stopActualVehicleSound", getRootElement( ), vehicle ) end if tipe == "youtube" then url = "http://youtubeinmp3.com/fetch/?format=text&video="..url local f = fetchRemote ( url, myCallback, "", false, source, vehicle, volumne ) else triggerClientEvent( getRootElement( ), "playVehicleSound", getRootElement( ), url, vehicle, volumne ) end end addEvent( "reproducirLink", true ) addEventHandler( "reproducirLink", getRootElement( ), reproll ) function myCallback( responseData, errno, playerToReceive, vehicle, volumne ) if errno == 0 then local t = split ( responseData, " ") local buffer = "" for i=2, #t do if t ~= "<br/>Length:" then buffer = buffer..t.." " else break end end triggerClientEvent( getRootElement( ), "playVehicleSound", getRootElement( ), t[#t], vehicle, volumne, buffer ) end end function pararRadio( vehicle ) if vehiculos[vehicle] then vehiculos[vehicle] = false triggerClientEvent( getRootElement( ), "stopActualVehicleSound", getRootElement( ), vehicle ) outputChatBox( "Radio detenida!", source, 255, 255, 255, true ) else outputChatBox( "No se esta reproduciendo nada!", source, 255, 255, 255, true ) end end addEvent( "detenerRepro", true ) addEventHandler( "detenerRepro", getRootElement( ), pararRadio ) function volumeCarro( vehicle, vol ) if vehiculos[vehicle] then triggerClientEvent( getRootElement( ), "setActualVehicleVolume", getRootElement( ), vehicle, vol ) end end addEvent( "setVolumeCar", true ) addEventHandler( "setVolumeCar", getRootElement( ), volumeCarro ) function createRadioLinkssa( ) local qh = dbQuery( db,"CREATE TABLE IF NOT EXISTS radio_links ( serial STRING, theLink STRING, fecha STRING )") dbFree( qh ) outputDebugString( "Tabla de url's creada") end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), createRadioLinkssa ) function saveALink( Url ) if not datoExistente( getPlayerSerial( source ), Url ) then local time = getRealTime( ) local date = tostring( time.monthday.."/"..( time.month +1 ).."/20"..( time.year - 100 ).." "..time.hour..":"..time.minute ) db:exec( "INSERT INTO radio_links ( serial, theLink, fecha ) VALUES(?,?,?)", getPlayerSerial( source ), tostring( Url ), date ) outputChatBox( "Link guardado!", source, 255, 255, 255, true ) else outputChatBox( "Ese link ya esta guardado!", source, 255, 255, 255, true ) end end addEvent( "saveALink", true ) addEventHandler( "saveALink", getRootElement( ), saveALink ) function datoExistente( serial, url ) local qh = db:query( "SELECT * FROM radio_links WHERE serial=?", tostring( serial ) ) for i, v in ipairs( dbPoll( qh, -1 ) ) do if v["theLink"] == url then return true end end return false end function obtenerMisLinks( ) local qh = db:query( "SELECT * FROM radio_links WHERE serial=?", tostring( getPlayerSerial( source ) ) ) for i, v in ipairs( dbPoll( qh, -1 ) ) do local url, Fecha = v["theLink"], v["fecha"] triggerClientEvent( source, "addGridLinks", source, url, Fecha ) end end addEvent( "obtenerMisLnks", true ) addEventHandler( "obtenerMisLnks", getRootElement( ), obtenerMisLinks ) function borrarUnLink( url ) if datoExistente ( getPlayerSerial( source ), url ) then db:exec( "DELETE FROM radio_links WHERE serial=? AND theLink=?", getPlayerSerial( source ), url ) outputChatBox( "Url Eliminado!", source, 255, 255, 255, true ) else outputChatBox( "Link no valido!", source, 255, 255, 255, true ) end end addEvent( "deleteALink", true ) addEventHandler( "deleteALink", getRootElement( ), borrarUnLink )
  17. I have this music script but it does not destroy the music when the vehicle is destroyed and how can I solve it? client function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 guiSetPosition(center_window, x, y, false) end GUIEditor = { tab = {}, label = {}, tabpanel = {}, edit = {}, button = {}, window = {}, scrollbar = {}, radiobutton = {} } GUIEditor.window[1] = guiCreateWindow(500, 187, 378, 280, "Radio Vehicular", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 22, 358, 227, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Radio", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(10, 10, 178, 16, "Ingresa una url:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.edit[1] = guiCreateEdit(10, 31, 199, 26, "", false, GUIEditor.tab[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(20, 67, 18, 15, "", false, GUIEditor.tab[1]) GUIEditor.radiobutton[2] = guiCreateRadioButton(112, 69, 18, 15, "", false, GUIEditor.tab[1]) GUIEditor.label[2] = guiCreateLabel(44, 67, 60, 17, "Radio/Web", false, GUIEditor.tab[1]) GUIEditor.label[3] = guiCreateLabel(133, 67, 200, 17, "Youtube", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(13, 97, 91, 28, "Reproducir", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.scrollbar[1] = guiCreateScrollBar(20, 161, 239, 22, true, false, GUIEditor.tab[1]) guiScrollBarSetScrollPosition(GUIEditor.scrollbar[1], 100.0) GUIEditor.label[4] = guiCreateLabel(10, 135, 178, 16, "Volumen:", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[4], "default-bold-small") porcientomusica = guiCreateLabel(67, 135, 86, 17, "0%", false, GUIEditor.tab[1]) GUIEditor.button[2] = guiCreateButton(114, 97, 91, 28, "Detener", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.tab[2] = guiCreateTab("Mis links", GUIEditor.tabpanel[1]) GUIEditor.label[5] = guiCreateLabel(10, 10, 138, 15, "Ingresa el url a guardar:", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[5], "default-bold-small") GUIEditor.edit[2] = guiCreateEdit(10, 31, 199, 26, "", false, GUIEditor.tab[2]) GUIEditor.button[3] = guiCreateButton(145, 67, 74, 28, "Guardar", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") GUIEditor.button[4] = guiCreateButton(10, 67, 125, 28, "Ver links guardados", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.button[4], "default-bold-small") guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA") closebutton = guiCreateButton(307, 249, 60, 24, "Cerrar", false, GUIEditor.window[1]) guiSetFont(closebutton, "default-bold-small") guiSetProperty(closebutton, "NormalTextColour", "FFAAAAAA") guiSetVisible( GUIEditor.window[1], false ) centerWindow ( GUIEditor.window[1] ) myLinksGUI = guiCreateWindow(378, 133, 503, 292, "Mis links", false) guiWindowSetSizable(myLinksGUI, false) mylinksGridlist = guiCreateGridList(9, 26, 485, 218, false, myLinksGUI) a = guiGridListAddColumn(mylinksGridlist, "Url", 0.5) b = guiGridListAddColumn(mylinksGridlist, "Fecha", 0.5) copyurlbutton = guiCreateButton(19, 254, 86, 29, "Copiar url", false, myLinksGUI) guiSetFont(copyurlbutton, "default-bold-small") guiSetProperty(copyurlbutton, "NormalTextColour", "FFAAAAAA") deleteurlbutton = guiCreateButton(115, 254, 86, 29, "Eliminar url", false, myLinksGUI) guiSetFont(deleteurlbutton, "default-bold-small") guiSetProperty(deleteurlbutton, "NormalTextColour", "FFAAAAAA") closeMyLinksGUI = guiCreateButton(211, 254, 86, 29, "Cerrar", false, myLinksGUI) guiSetFont(closeMyLinksGUI, "default-bold-small") guiSetProperty(closeMyLinksGUI, "NormalTextColour", "FFAAAAAA") guiSetVisible( myLinksGUI, false ) centerWindow ( myLinksGUI ) --guiSetEnabled( GUIEditor.radiobutton[2], false ) local radios = { } function openPanel( ) local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if isPedInVehicle( getLocalPlayer( ) ) and getVehicleController( veh ) == getLocalPlayer( ) then openMain( ) end end bindKey( "F5", "down", openPanel ) addCommandHandler( "radio", openPanel ) function openMain( ) if guiGetVisible( GUIEditor.window[1] ) == false then guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) guiSetText( porcientomusica, tostring( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) ).."%") else guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end end function clicksBotones( ) if source == GUIEditor.button[1] then if guiRadioButtonGetSelected( GUIEditor.radiobutton[1] ) == true or guiRadioButtonGetSelected( GUIEditor.radiobutton[2] ) == true then local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then local editT = guiGetText( GUIEditor.edit[1] ) if string.len( editT ) > 5 then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) triggerServerEvent ( "reproducirLink", getLocalPlayer( ), editT, veh, ( ( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) * 1.0 ) / 100 ), tipoRepro( ) ) else outputChatBox( "Link no valido!", 255, 255, 255, true ) end else outputChatBox( "Solo el conductor puede reproducir la radio!", 255, 255, 255, true ) end else outputChatBox( "Selecciona un tipo de url!", 255, 255, 255, true ) end elseif source == GUIEditor.button[2] then local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then triggerServerEvent ( "detenerRepro", getLocalPlayer( ), veh ) else outputChatBox( "Solo el conductor puede reproducir la radio!", 255, 255, 255, true ) end elseif source == closebutton then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) elseif source == GUIEditor.button[3] then local editT = guiGetText( GUIEditor.edit[2] ) if string.len( editT ) > 5 then triggerServerEvent ( "saveALink", getLocalPlayer( ), editT ) guiSetText( GUIEditor.edit[2], "" ) else outputChatBox( "Link no valido!", 255, 255, 255, true ) end elseif source == GUIEditor.button[4] then guiSetVisible( GUIEditor.window[1], false ) guiSetVisible( myLinksGUI, true ) guiGridListClear( mylinksGridlist ) triggerServerEvent ( "obtenerMisLnks", getLocalPlayer( ) ) elseif source == closeMyLinksGUI then guiSetVisible( GUIEditor.window[1], true ) guiSetVisible( myLinksGUI, false ) elseif source == copyurlbutton then local row, col = guiGridListGetSelectedItem( mylinksGridlist ) if row == -1 or col == -1 then outputChatBox( "Selecciona un Url!", 255, 255, 255, true ) return end local link = guiGridListGetItemText( mylinksGridlist, row, a ) setClipboard( link ) outputChatBox( "Url copiado al portapapeles!", 255, 255, 255, true ) elseif source == deleteurlbutton then local row, col = guiGridListGetSelectedItem( mylinksGridlist ) if row == -1 or col == -1 then outputChatBox( "Selecciona un Url!", 255, 255, 255, true ) return end local link = guiGridListGetItemText( mylinksGridlist, row, a ) triggerServerEvent ( "deleteALink", getLocalPlayer( ), link ) setTimer( function( ) guiGridListClear ( mylinksGridlist ) triggerServerEvent ( "obtenerMisLnks", getLocalPlayer( ) ) end , 250, 1 ) end end addEventHandler( "onClientGUIClick", getRootElement( ), clicksBotones ) function tipoRepro( ) local tipo if guiRadioButtonGetSelected( GUIEditor.radiobutton[1] ) == true then tipo = "radio" elseif guiRadioButtonGetSelected( GUIEditor.radiobutton[2] ) == true then tipo = "youtube" else tipo = "radio" end return tipo end function onVehicleExit( thePlayer ) if thePlayer == getLocalPlayer( ) then if guiGetVisible( GUIEditor.window[1] ) == true then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) end if guiGetVisible( myLinksGUI ) == true then guiSetVisible( myLinksGUI, false ) showCursor( false ) end end end addEventHandler( "onClientVehicleExit", getRootElement( ), onVehicleExit ) function playASound( tipo, link, vehicle ) if tipo == "radio" then elseif tipo == "youtube" then end end function stopASound( vehicle ) if radios[vehicle] then stopSound( radios[vehicle] ) radios[vehicle] = nil end end addEvent( "stopActualVehicleSound", true ) addEventHandler( "stopActualVehicleSound", getLocalPlayer( ), stopASound ) local timerTitle function playAsound( url, vehicle, volumne, nameArtist ) if radios[vehicle] then stopSound( radios[vehicle] ) radios[vehicle] = nil end local tipo = tipoRepro( ) local x, y, z = getElementPosition( vehicle ) local link = url radios[vehicle] = playSound3D( link, x, y, z, false ) if isTimer( timerTitle ) then killTimer ( timerTitle ) end timerTitle = setTimer( function( ) if radios[vehicle] then local meta = getSoundMetaTags(radios[vehicle]) if tipo == 'radio' then if meta.stream_title and meta.stream_name then if isTimer( timerTitle ) then killTimer ( timerTitle ) end outputChatBox( tostring( meta.stream_name ), 255, 255, 255 ) outputChatBox( tostring( meta.stream_title ), 0, 255, 0 ) end elseif tipo == "youtube" then if meta.title then if isTimer( timerTitle ) then killTimer ( timerTitle ) end outputChatBox( "Youtube MP3", 255, 255, 255 ) outputChatBox( tostring( nameArtist ), 0, 255, 0, true ) end end end end, 3000, 0 ) setSoundMaxDistance( radios[vehicle], 30 ) setSoundVolume( radios[vehicle], volumne ) attachElements( radios[vehicle], vehicle ) end addEvent( "playVehicleSound", true ) addEventHandler( "playVehicleSound", getLocalPlayer( ), playAsound ) function setSoundCar( veh, vol ) if radios[veh] then setSoundVolume( radios[veh], tonumber( vol ) ) end end addEvent( "setActualVehicleVolume", true ) addEventHandler( "setActualVehicleVolume", getLocalPlayer( ), setSoundCar ) function soundCarVolume( ) local veh = getPedOccupiedVehicle( getLocalPlayer( ) ) if getVehicleController( veh ) == getLocalPlayer( ) then if radios[veh] then local porciento = ( ( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) * 1.0 ) / 100 ) triggerServerEvent( "setVolumeCar", getLocalPlayer( ), veh, porciento ) end end guiSetText( porcientomusica, tostring( guiScrollBarGetScrollPosition ( GUIEditor.scrollbar[1] ) ).."%") end addEventHandler( "onClientGUIScroll", GUIEditor.scrollbar[1], soundCarVolume ) function saads( url, fecha ) local row = guiGridListAddRow( mylinksGridlist ) guiGridListSetItemText( mylinksGridlist, row, a, url, false, false ) guiGridListSetItemText( mylinksGridlist, row, b, fecha, false, false ) end addEvent( "addGridLinks", true ) addEventHandler( "addGridLinks", getLocalPlayer( ), saads ) if fileExists("client.lua") then fileDelete("client.lua") end server local db = dbConnect( "sqlite", "dbData_byRex.db" ) local vehiculos = { } function reproll( url, vehicle, volumne, tipe ) if not vehiculos[vehicle] then vehiculos[vehicle] = true else triggerClientEvent( getRootElement( ), "stopActualVehicleSound", getRootElement( ), vehicle ) end if tipe == "youtube" then url = "http://youtubeinmp3.com/fetch/?format=text&video="..url local f = fetchRemote ( url, myCallback, "", false, source, vehicle, volumne ) else triggerClientEvent( getRootElement( ), "playVehicleSound", getRootElement( ), url, vehicle, volumne ) end end addEvent( "reproducirLink", true ) addEventHandler( "reproducirLink", getRootElement( ), reproll ) function myCallback( responseData, errno, playerToReceive, vehicle, volumne ) if errno == 0 then local t = split ( responseData, " ") local buffer = "" for i=2, #t do if t ~= "<br/>Length:" then buffer = buffer..t.." " else break end end triggerClientEvent( getRootElement( ), "playVehicleSound", getRootElement( ), t[#t], vehicle, volumne, buffer ) end end function pararRadio( vehicle ) if vehiculos[vehicle] then vehiculos[vehicle] = false triggerClientEvent( getRootElement( ), "stopActualVehicleSound", getRootElement( ), vehicle ) outputChatBox( "Radio detenida!", source, 255, 255, 255, true ) else outputChatBox( "No se esta reproduciendo nada!", source, 255, 255, 255, true ) end end addEvent( "detenerRepro", true ) addEventHandler( "detenerRepro", getRootElement( ), pararRadio ) function volumeCarro( vehicle, vol ) if vehiculos[vehicle] then triggerClientEvent( getRootElement( ), "setActualVehicleVolume", getRootElement( ), vehicle, vol ) end end addEvent( "setVolumeCar", true ) addEventHandler( "setVolumeCar", getRootElement( ), volumeCarro ) function createRadioLinkssa( ) local qh = dbQuery( db,"CREATE TABLE IF NOT EXISTS radio_links ( serial STRING, theLink STRING, fecha STRING )") dbFree( qh ) outputDebugString( "Tabla de url's creada") end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), createRadioLinkssa ) function saveALink( Url ) if not datoExistente( getPlayerSerial( source ), Url ) then local time = getRealTime( ) local date = tostring( time.monthday.."/"..( time.month +1 ).."/20"..( time.year - 100 ).." "..time.hour..":"..time.minute ) db:exec( "INSERT INTO radio_links ( serial, theLink, fecha ) VALUES(?,?,?)", getPlayerSerial( source ), tostring( Url ), date ) outputChatBox( "Link guardado!", source, 255, 255, 255, true ) else outputChatBox( "Ese link ya esta guardado!", source, 255, 255, 255, true ) end end addEvent( "saveALink", true ) addEventHandler( "saveALink", getRootElement( ), saveALink ) function datoExistente( serial, url ) local qh = db:query( "SELECT * FROM radio_links WHERE serial=?", tostring( serial ) ) for i, v in ipairs( dbPoll( qh, -1 ) ) do if v["theLink"] == url then return true end end return false end function obtenerMisLinks( ) local qh = db:query( "SELECT * FROM radio_links WHERE serial=?", tostring( getPlayerSerial( source ) ) ) for i, v in ipairs( dbPoll( qh, -1 ) ) do local url, Fecha = v["theLink"], v["fecha"] triggerClientEvent( source, "addGridLinks", source, url, Fecha ) end end addEvent( "obtenerMisLnks", true ) addEventHandler( "obtenerMisLnks", getRootElement( ), obtenerMisLinks ) function borrarUnLink( url ) if datoExistente ( getPlayerSerial( source ), url ) then db:exec( "DELETE FROM radio_links WHERE serial=? AND theLink=?", getPlayerSerial( source ), url ) outputChatBox( "Url Eliminado!", source, 255, 255, 255, true ) else outputChatBox( "Link no valido!", source, 255, 255, 255, true ) end end addEvent( "deleteALink", true ) addEventHandler( "deleteALink", getRootElement( ), borrarUnLink )
  18. this is the code(not the full code): function markerbelepkocsival() if isPedInVehicle ( localPlayer ) then local playerVehicle = getPlayerOccupiedVehicle ( localPlayer ) addEventHandler("onClientRender", root, paynspray1) addEventHandler("onClientRender", root, paynspray2) addEventHandler("onClientRender", root, paynspray4) guiSetVisible(GUIEditor.button[1], true) guiSetVisible(GUIEditor.button[2], true) guiSetVisible(GUIEditor.button[3], true) setElementFrozen ( playerVehicle, true ) playSound("1.mp3") showChat(false) showCursor(true) end end addEventHandler ( "onClientMarkerHit", merker1, markerbelepkocsival ) when i hit the marker, the panel will appear to everyone.. how to fix this? :c
  19. Hi, i have a trouble with my fuction . It's simply trigerred by hiting marker but the clue is that i want it to be trigerred ONLY ONCE like "onceTrigerredonMarkerHit". My code as an example : marker2=createMarker(3399.2,-1899.2,30.1,"corona",2,0,0,255,0) tr1=createVehicle(584,3357.5,-1956.8,31.29,0,0,90) tr2=createVehicle(515,3347.2,-1957,31.29,0,0,90) function open_smashb() ... function m() ... blowVehicle(tr) blowVehicle(tr2) end setTimer(m,2000,1) end addEventHandler("onMarkerHit", marker2, open_smashb)
  20. Ingles: My problem is the following I can not just one server, the others do not give me a problem, I already ask the owner and everything and he tells me that it is not a server problem but the MTA I already did the MTAdiag here is my pastebin https://pastebin.mtasa.com/553467985 If you can help me, I would appreciate it. I have about 1 month since I can not play that server in specific Thanks in advance Español: Mi problema es el siguiente No puedo solo a un servidor los otros no me da problema, ya consulte con el dueño y todo y me dice que no es un problema del server sino del MTA Ya hice lo del MTAdiag aqui esta mi pastebin https://pastebin.mtasa.com/553467985 si me pueden ayudar se los agradeceria ya tengo como 1 mes que no puedo jugar a ese servidor en especifico Gracias de antemano
  21. What wrong with this script? Error: script.lua:1: unexpected symbol near '?' How to fix this?
  22. So, first of all greetings. These days, i was trying to make a script that would allow you to create custom blips and save them to a database. The creation and saving (in the DB) part went well, but i am having problems when trying to load them back into the game. Here's part of the code that handles that: function loadOneBlip( ) local result = mysql:query_fetch_assoc("SELECT x AS x1, y AS y1, z AS z1, icon AS icons, size AS sizes FROM `blip`") --loading the data from the DB if result then while true do local row = mysql:fetch_assoc(result) --make it so i can select the data from a string if not row then break end --if there is no result end the operation local blip = createBlip( row.x1 , row.y1 , row.z1 , row.icons , row.sizes, 255, 0, 0, 0, 0, visibleDistance) --creating the actual blip outputChatBox("loading one blip (#"..blips..")", thePlayer, 255,255,255) --count them ingame to see if it loads completely blips = blips + 1 end mysql:free_result(result) else outputDebugString("blip failed",1) --something went wrong end end addCommandHandler("loadblip",loadOneBlip,false,false) addEventHandler("onResourceStart",root, loadOneBlip) And for more thoughts, yes, the connection to the DB is running good. The script is made serverside. And i also think i did something very wrong here, that being in when i execute the command, neither the blip gets created nor the error message display.
  23. Hi everyone, I need some help. I made a script wich creates screenshots and save them in a custom folder and the name of image is saved in database, but not in .xml file, because the script will be open for all players, and if each image made by player has a line in .xml file then will be a lot of lines...... i want that the server can open images even the images aren't in .xml file. How can I do that ?
  24. trollik75

    Blurry text

    Hello! I'm struggling with very annoying (at least for me) problem. Text in menu is blurry and there are strange curves around cursor. Also chat in-game is unreadable screenshot: Additional info: Windows 10 PRO 64bit I have DirectPlay turned on I have directx 9.0c I have newest GPU drivers GPU R9 390 CPU i5 6600
×
×
  • Create New...