Search the Community

Showing results for tags 'system'.



More search options

  • 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
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • 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
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Gang


Location


Occupation


Interests

Found 24 results

  1. Thisdp's DirectX Graphical User Interface System ( MTASA 2D+3D DxLIB ) This dxlib provide dx gui functions and events to make it easier to use and alternative to change the style more flexibly. Warning: Old function name like dgsDxGUI*/dgsDx* are no longer supported after 3.4, please change your functions and events name 'dgsDxGUI*'/'dgsDx*' have been changed to 'dgs*' Current Version: 3.37 Final Version: 3.99 Features: 1. Update Check(DGS will notice you if there is a higher version, and you can choose to ignore it or disable it in the config file) Update Command: "updatedgs" 2. Dx GUI Types: Window Edit Box Button Grid List Image Scroll Bar Scroll Pane Text Label Tab Panel Ellipse Detect Area (EDA) Detect Area Radio Button Combo Box Check Box Memo 3D Interface Media Browser Browser 3. Edit Selection Fixed 4. dgs-dxeda is used to check whether your mouse is in the target ellipse area. 5. Debug Mode , Command: "debugdgs" 6. You can apply shader to the dxgui 7. Include CMD, Command: "cmd" ( For more help, please input "help" in the CMD ) 8. Memo rewritten. 9. OOP Class Notice:Do not close your server or stop the script when it is updating. Wiki: https://wiki.multitheftauto.com/wiki/Dgs ( Still Working In Process ) Auto Completion For N++ (Thanks To Ahmed Ly): http://www.mediafire.com/file/m6dm7815d5dihax/lua.zip Discord Server: https://discord.gg/QEs8q6W Download DGS : https://github.com/thisdp/dgs Notice: Need acl rights to call fetchRemote. To Contact Me , Skype: thisdpzjl My server is based on DGS , if you want to see the exact effect of dgs ( not best, my design is bad ). Please have a look. IP: angel.mtaip.cn:10010 If you want to sell your script which involves DGS, please exclude DGS from your price. HurtWorld Backpack Panel(Example) DGS Network Monitor(Built-in)
  2. mehmet

    Turn signal (texture)

    Hello, how to make a system of turn signals? (using car textures)
  3. iRack

    News Resource

    Hi ! Can someone help me ? I want: ONLY in that cylinder you can use command [/ad], only in it, I don't know how to do it. ( it's an advertisement system for RPG ) Thanks a lot ! function Advertisment(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getPlayerName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "Advertisment from " .. playerName.. ": " ..table.concat ( chatContent, " "), player, 0, 190, 40) end end addCommandHandler( "ad", Advertisment ) cylinder = createMarker(1168.6981201172, -1489.6285400391, 21.756763458252, "cylinder", 5, 100, 0, 0) setElementInterior(cylinder, 0) function Advertisment (thePlayer) if source == Advertisment then setElementInterior(thePlayer, 0) setElementPosition(thePlayer, 1168.6981201172, -1489.6285400391, 22.756763458252) elseif source == cylinder then outputChatBox("Type [/ad] to publish your advertisment.", thePlayer, 255, 255, 0) end end addEventHandler("onMarkerHit", getRootElement(), Advertisment)
  4. here's a video about the bug..: How to fix this bug? I tried many things, but unsuccessfully.. :s Here the code: Client.lua: local sX, sY = guiGetScreenSize() setElementData(localPlayer,"name",nil) GUIEditor = { button = {}, edit = {} } GUIEditor.button[1] = guiCreateButton(0.72, 0.74, 0.03, 0.04, ">", true) kuldottpmek = {} fogadottpmek = {} GUIEditor.edit[1] = guiCreateEdit(0.38, 0.74, 0.34, 0.04, ".", true) guiEditSetMaxLength(GUIEditor.edit[1], 150) local dxfont0_gothic = dxCreateFont(":mta_wintertime/gothic.ttf", 14) local screenW, screenH = guiGetScreenSize() local players = getElementsByType ( "player" ) addEventHandler("onClientRender", root, function() local players = getElementsByType ( "player" ) local elem = 0 local fpm = 0 local kpm = 0 local uzenet = guiGetText(GUIEditor.edit[1]) dxDrawRectangle(screenW * 0.3722, screenH * 0.2722, screenW * 0.3833, screenH * 0.5100, tocolor(0, 0, 0, 162), false) dxDrawRectangle(screenW * 0.1757, screenH * 0.2722, screenW * 0.1896, screenH * 0.5100, tocolor(0, 0, 0, 162), false) dxDrawText("Játékoslista", screenW * 0.1764, screenH * 0.2722, screenW * 0.3653, screenH * 0.3167, tocolor(255, 255, 255, 255), 1.00, dxfont0_gothic, "center", "center", false, false, false, false, false) for id,player in ipairs(players) do local plname = getPlayerName(player) elem = elem + 1 dxDrawText(plname, screenW * 0.1764, screenH * 0.2500+(elem*70), screenW * 0.3653, screenH * 0.3578, tocolor(255, 255, 255, 255), 0.65, dxfont0_gothic, "left", "center", false, false, true, true, false) dxDrawRectangle(screenW * 0.1764, screenH * 0.2850+(elem*35), screenW * 0.1889, screenH * 0.0367, tocolor(0, 0, 0, 162), false) end dxDrawText(getElementData(localPlayer,"name") or "Válassz játékost", screenW * 0.3722, screenH * 0.2722, screenW * 0.7556, screenH * 0.3167, tocolor(255, 255, 255, 255), 1.00, dxfont0_gothic, "center", "center", false, false, false, true, false) dxDrawText(getElementData(localPlayer,"name") and "Elérhető most" or "", screenW * 0.5278, screenH * 0.3056, screenW * 0.6014, screenH * 0.3411, tocolor(255, 255, 255, 255), 0.65, dxfont0_gothic, "center", "center", false, false, false, true, false) dxDrawRectangle(screenW * 0.3722, screenH * 0.3467, screenW * 0.3833, screenH * 0.3844, tocolor(0, 0, 0, 162), false) for k,v in ipairs(kuldottpmek) do kpm = kpm + 1 dxDrawRectangle(screenW * 0.3722, screenH * 0.2775+(kpm*62), screenW * 0.3833, screenH * 0.0633, tocolor(94, 192, 254, 162), false) dxDrawText("Te:", screenW * 0.3729, screenH * 0.1430+(kpm*124), screenW * 0.7556, screenH * 0.4367, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", false, false, false, true, false) dxDrawText(v, screenW * 0.3729, screenH * 0.3050+(kpm*62), screenW * 0.7556, screenH * 0.4733, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, true, false, false) for k,v in ipairs(fogadottpmek) do kpm = kpm + 1 dxDrawRectangle(screenW * 0.3722, screenH * 0.2775+(kpm*62), screenW * 0.3833, screenH * 0.0633, tocolor(255, 255, 254, 162), false) dxDrawText(getElementData(localPlayer,"name")..":", screenW * 0.3729, screenH * 0.1430+(kpm*124), screenW * 0.7556, screenH * 0.4367, tocolor(110, 110,111, 200), 1.00, "default-bold", "left", "center", false, false, false, true, false) dxDrawText(v, screenW * 0.3729, screenH * 0.3050+(kpm*62), screenW * 0.7556, screenH * 0.4733, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, true, false, false) end end end ) function onClientClick(button, state) local elem = 0 if button == "left" and state == "down" then for k, v in ipairs(players) do local plname = getPlayerName(v) elem = elem+1 if isInBox(screenW * 0.1764, screenH * 0.2850+(elem*35), screenW * 0.1889, screenH * 0.0367) then if plname == getPlayerName(localPlayer) then return end setElementData(localPlayer,"name",plname) kuldottpmek = {} fogadottpmek = {} end end end end addEventHandler("onClientClick", root, onClientClick) function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*sX, cursorY*sY if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end function trig1() if getElementData(localPlayer,"name") == nil then return end local nev =getElementData(localPlayer,"name") or "" local targetPlayer = getPlayerFromName ( nev ) if targetPlayer then local uzenet = guiGetText(GUIEditor.edit[1]) table.insert(kuldottpmek,uzenet) end end addEvent("uzenet",true) addEventHandler("uzenet",root,trig1) function trig2() if getElementData(localPlayer,"name") == nil then return end local nev =getElementData(localPlayer,"name") or "" local targetPlayer = getPlayerFromName ( nev ) if targetPlayer then local uzenet = guiGetText(GUIEditor.edit[1]) table.insert(fogadottpmek,uzenet) end end addEvent("uzenet2",true) addEventHandler("uzenet2",root,trig2) function test() if getElementData(localPlayer,"name") == nil then return end local uzenet = guiGetText(GUIEditor.edit[1]) triggerServerEvent("pmuzenet",localPlayer,getLocalPlayer(),uzenet) end addEventHandler("onClientGUIClick",GUIEditor.button[1],test,false) Server.lua: function privateMessage(thePlayer) local sendToName = getElementData(thePlayer,"name") local toPlayer = getPlayerFromParticalName (sendToName) triggerClientEvent(thePlayer,"uzenet",toPlayer) triggerClientEvent(toPlayer,"uzenet2",thePlayer) setElementData(toPlayer,"fogadott",true) setElementData(thePlayer,"fogadott",false) end addEvent("pmuzenet",true) addEventHandler("pmuzenet",root,privateMessage) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  5. Abdul KariM

    [SELL] Uber Script

    كيف حالكم عساكم بخير , مثل ماهو معروض بعنوان الموضوع للبيع سكربت اوبر للي مايعرف وش اوبر , تطلب سيارة وتختار مكان ويجي شخص يوصلك للمكان الي اخترته الي انا سويته خليت بيد تلقائي يجي يوصلك للمكان الي تبغاه طبعا هذا اول سكربت اعرضه للبيع تفتحلك لوحة وفيها الاماكن وانت تضيف الاماكن والسعر بيكون على حسب بعدك عن المكان الي تبي تروح له سعر الميل انا حاطه 2 ويمديك تغيره بس تشتري السكربت , الاماكن القريبة لك ماراح تظهر لازم يكون بعدك 150 عن المكان عشان يظهر هذا الحد الادنى وطبعا تقدر تغير البعد تقدر تخلي السكربت يفتح من زر وتقدر تخليه يفتح من امر من اف8 صور من السكربت طبعا في حال استعجالك عشان تروح للمكان تضغط انتر وراح ينتقلك للمكان الي تبيه بثانية الخصائص الموجودة بالسكربت ولو يتبرع واحد من الشباب يسوي فديو ويحطه بأكون شاكر له الي يبي يجرب السكربت وياخذ صورة اوضح منه يخش السيرفر mtasa://178.32.99.229:22222 uber او اكتب باف8 m طبعا بس تخش راح يعطيك فلوس واضغط حرف حاب اقولك ماخذت من السكربت الا احداثيات الطرق traffic وجرب لين تقتنع , الي يجي يسوي نفسه محقق كونان ويقول نسخ لصق من سكربت السكربت يحتوي على ملفين كلينت وسيرفر وملف احداثيات الطرق مثل ماذكرت فوق التحميل حق السكربت قليل مره لان احداثيات الطرق سيرفر واغلب الشغل على السيرفر والمعروف ان ملفات السيرفر ماتتحمل على جهاز الاعب الكلينت عليه اللوحة وبعض الامور البسيطة , السكربت مبرمج بأفضل الطرق ومافيه ولا بق ان شاء الله والحين نجي للسعر صراحة انا معطيه سعر مو من حقه مقارنة بالسكربت ومواصفاته السعر بالريال السعودي : 100 السعر بالدولار الامريكي : 26 طرق الدفع واول 3 اشخاص يشترون السكربت بيحصلون على الاصدار الثاني من السكربت مجانا الاصدار الثاني بيكون مختلف جذريا والسعر راح يكون اغلى من هذا واتمنى مايكون فيه ردود خارجا عن صياغ الموضوع واي استفسار بخصوص السكربت حط ردك : طرق التواصل معي وهذا وصل الله وسلم على نبينا محمد
  6. Faisal49

    [SELL] Fortnite building system

    Hi, Fortnite building system for sell put your offer (: - you can test scripts if you want. https://youtu.be/wlxe1g1oMDQ
  7. IvanTBG

    Mta Dayz Base System

    Hi im looking for a script that kill's other groups/people's if they enter your base and that is freezing unused cars and give them god mode . I saw this script on some dayz server's . Thanks.
  8. mvrlin

    [QUESTION] Character System

    Hello! I'm trying to figure out how to create the same system. What should I use? I think that it's obvious that it's changing the texture only, not the model. I have read about shader, but didn't quite understood. Here's the video what I want to get: https://www.youtube.com/watch?v=jPDYwPUhL6c
  9. magnux

    SISTEMA DE BOMBEIRO

    Pessoal não consigo termina esse trampo coloquei um comando para digita /s e nick, sem código para executar uma função de da Health a outro player Mais quando eu digito o comando /s nick, Ele só executa a função da Animação, e a de dar vida não funciona, AJUDEM AI ! -- server addCommandHandler ("s", function (thePlayer, command, Jogador) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("SAMU")) then triggerClientEvent(thePlayer, "SAMU", getRootElement()) setPedAnimation(thePlayer, "medic", "CPR") if not hasObjectPermissionTo(thePlayer, "command.slap", false) then outputChatBox ( "Você não pode usar este comando", source ) return false end local targetPlayer = getPlayerFromName ( Jogador ):gsub("#%x%x%x%x%x%x", "") if targetPlayer then setElementHealth ( targetPlayer, getElementHealth(targetPlayer) + 100 ) else outputChatBox ( "Não há nenhum jogador chamado " .. Jogador .. "!", source ) end end end)
  10. I want create a bank-system. But i don't know, how to begin the script. Can i make it possible this with setElementData, and getElementDatas? sorry for my bad english
  11. Hi everyone im new in scripting and i wanna script a level system All i want is when player plays in server +5 hours make the player ranked up exp: +5 hourse lvl 1 +10hourse lvl2 15hourse lvl3 And how can i show this levels in scoreboard Sorry for my TERRIBLE english
  12. After I finished the first version of my character customization system i just realized its such a piece of crap, so i started writing a new version with a whole new concept. The first version worked with CJ skin and i just attached some custom head models to it. Conversely the new version is running with shaders and the skin is a custom dff. Here is a video of the head customization. The clothing is in progress yet, it takes a lot of time because i have to make custom cloth models. Hope you like it. Please don't ask for the source code, this script will never be released. Sorry.
  13. nexUss

    Radio script help

    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 )
  14. nexUss

    Radio script help

    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 )
  15. Sistema de radio Sistema de radio vehicular -Caracteristicas: Reproduce links de web's y de Youtube. Audio en 3D ( Alcanze maximo 30 metros ). Volumen configurable. Sistema de guardado de links ( Puedes Copiar/Eliminar los links guardados ) Solo el conductor podra abrir el panel. Todos las cosas se guardan en una base de datos local. Codigo libre 7w7. Imágenes del sistema: Comandos: F5 Para abrir el panel /radio para abrir el panel por comando Debes darle permisos de ACL Al script ( Obligatorio para funcione el YoutubeMP3 ) Link del script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14289
  16. Gabriel1375

    [HELP] Blip Event System

    Hello guys, what's up ? I've made myself an blip event script, that attach a blip on the admin on the map, and the user who kills it get a random item. The most complicated part of the script is working fine, but i have a problem... The problem is: When the admin kills himself, the event doesn't end, if i die 10x, i'll have the function still running, so everytime i die it gives the message and the item... The script: (i've already commented all the lines to get easier to understand...) --function blip has paremeter: theplayer function blip (thePlayer) --variable accountname receive the value of the getaccountname of the player, to see the player login accountname = getAccountName(getPlayerAccount(thePlayer)) --if the player who triggered the blip function is a supermoderator or an admin then if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) or isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then --output the message "special event - kill the adm identified as a $ on the map, the winner will get random items" outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF【 EVENTO ESPECIAL! 】#FFFFFF Mate o ADM identificado com o #098700cifrão ($) verde no mapa',getRootElement(),255,255,255,true) outputChatBox ('#FFFFFFO vencedor ganhará itens aleátorios!',getRootElement(),255,255,255,true) outputChatBox ('#00BFFF==============================================================',getRootElement(),255,255,255,true) --attach a "$" blip to the admin or supermod who started the event blip = createBlipAttachedTo (thePlayer,52,10) --set the admin data blood to 100 setElementData(thePlayer, "blood",100) --set the admin data blip event to true setElementData(thePlayer, "eventoblip",true) --set the max slots of the admin backpack to 350 setElementData(thePlayer, "MAX_Slots",350) end end --add the command /eventoblip that triggers the function blip addCommandHandler("eventoblip", blip) --table that determine what items the player will be given local itens = { {"Banana"}, {"Kiwi"}, {"Pizza"} } --function that calculates the size of the table itens above function tamanho( tabela ) local count = 0 for a in pairs( tabela ) do count = count + 1 end return count end -- function endevent has parameters: ammo, attacker, weapon, bodypart function fimdoevento(ammo, attacker, weapon, bodypart) -- if there is a attacker, and the element that killed him was a player, and the killed player has the data blip event then if attacker and getElementType ( attacker ) == "player" and getElementData(source,"eventoblip") == true then --declaring a local variable item that uses the tablecount system to pickup a random item of the table items local item = itens[math.random(tamanho(itens))][1] --declaring a local variable quantity, that's equal to 1x local quantidade = 1 --destroy the blip on the map after event is over destroyElement(blip) --remove the data blip event from staff setElementData(source, "eventoblip",false) --give to the attacker and the admin(test purposes) the random item, and quantity setElementData(attacker, item , quantidade) setElementData(source, item, quantidade) --output message "congratulations attackername killed the staff and wins X quantity of the X item" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" ..getPlayerName(attacker).."#00a5ff] matou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) -- else if there is a attacker, and the attacker killed with a vehicle, and the killed player has the data blip event then elseif attacker and getElementType ( attacker ) == "vehicle" and getElementData(source,"eventoblip") == true then --destroy the blip on the map after event is over destroyElement(blip) --remove the data blip event from staff setElementData(source, "eventoblip",false) --give to the attacker and the admin(test purposes) the random item, and quantity setElementData(attacker, item , quantidade) setElementData(source, item, quantidade) --output message "congratulations attackername killed the staff and wins X quantity of the X item" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ("#00a5ff Parabéns [#FF0000" ..getPlayerName(attacker).."#00a5ff] atropelou o Staff e ganhou [#ff0000 "..quantidade.."x "..item.."#00a5ff]!",getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) -- if none of this conditions is true then the admin accidentally killed himself from falling or other causes else --output message "the staff adminname killed himself, the event is still running" outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) outputChatBox ('#00a5ffO Staff ' .. getPlayerName(source) .. ' se matou, o evento continua.' ,getRootElement(),255,255,255,true) outputChatBox ('#00a5ff==============================================================',getRootElement(),255,255,255,true) end end --add an event handler of type onplayerwasted, that triggers the fimdoevento (translating: endevent) function addEventHandler("onPlayerWasted", getRootElement(), fimdoevento) Thank you guys, and please if anyone is thinking to use the script, please have my credits in: Gabriel Bigardi
  17. Yung_Lungs

    Job Points ranking in 3D GUI

    Hello I have, going to do a ranking of players where considered to be, and their quantity. The entry points I made to the MySQL database, there is written the number of points, the player and continuously updated. 3D GUI also I have done, I give the code below. I would like to make in this GUI was displayed ranking 10 or 5 players with the most points. I have no idea how I make such a ranking. This is beyond my skills. Here is the code for 3D GUI: local renderTarget = dxCreateRenderTarget(1000, 1000, true) local X, Y, Z = -345.5341796875, -1031.6298828125, 59.296432495117 local title_font = dxCreateFont(":server_fonts/main_font.ttf", 63) local ranking_font = dxCreateFont(":server_fonts/main_font.ttf", 50) addEventHandler("onClientRender", root, function() dxSetRenderTarget(renderTarget, true) dxDrawRectangle( 0, 0, 1000, 700, tocolor(72, 71, 81, 190)) -- Background dxDrawText("Job Ranking", 0, 0, 1000, 100, tocolor(255, 255, 255, 255), 1, title_font, "center", "center") -- Text dxDrawText("1. ", -830, 300, 1000, 50, tocolor(255, 255, 255, 255), 1, ranking_font, "center", "center") -- Text dxSetRenderTarget() dxDrawMaterialLine3D( X, Y, Z + 5, X, Y, Z, renderTarget, 5, tocolor(255, 255, 255, 255), -2000, 0, 0) end)
  18. NETCHK

    HELP SYSTEM LIFE

    sorry my photoshop have a error, I used Paint 3D kkk OK I need a help to create system is life heart person, for on life full and empty, 100% IMAGE SELECTION CUT == 50% life == 0% local life = getElementHealt(source) dxdrawimagesection() -- help ?
  19. Adiidas

    Gang system in date element

    Hello, I want to ask you for help. I'm trying to create a gang system but I do not want to use mta's default createTeam. I wanted to use an elementData, but I do not know how to do it. Tell me how to do in elementData. I have one with the default createTeam that is working, I wanted to change this by elementData. function createGang(name, tag, gr, gg, gb) if getTeamFromName(name) then triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FF0000Uma gang com esse nome já existe", source, 255, 255, 255, true) return else if name == "" or name == " " or tag == "" or tag == " " then triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FF0000Você deve completar todos os campos pedidos para criar uma gang.", source, 255, 255, 255, true) else gangCreate = createTeam(name) setPlayerTeam(source, getTeamFromName(name)) setTeamColor(gangCreate, gr, gg, gb) gang = getPlayerTeam(source) setElementData(source, "GangPTT", lider) if not getElementData(gang, "GangPlayer1") then setElementData(gang, "GangPlayer1", getPlayerName(source)) end local r, g, b = getTeamColor (gang) local hex = string.format("#%.2X%.2X%.2X", r, g, b) triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FFFFFFVocê criou a gang #666666[ "..hex..getTeamName(gang).." #666666]#FFFFFF e agora é lider dela.", source, 255, 255, 255, true) end end end addEvent("createGang", true) addEventHandler("createGang", getRootElement(), createGang)
  20. M3Mori3s93

    Group/Fraction system based on SQL

    Hi guys. Can u tell me which fuctions from mta:wiki should I use to make this system. I want in this system: saving group to the player based on sql, indvidual commands for group. Like a Police - /arrest, Medics /heal. For all groups leader panel inlc. cmd /invite /kick. For admin /creategroup /setownergroup. I think in sql I need some table which saves values like a loginplayer, nicknameplayer, idGroup, nameGroup, leaderGroup, membersGroup? and make permission system for indvidual cmd but which fuction is responsible for that ?
  21. felipebaidoloko

    Ajuda system radio

    Boa noite, novamente eu estou com varios projetos em mente, e estou criando eu mesmo por isso venho aqui no forum pedir ajuda, por que eu nao gosto de pega coisa feita, gosto de aprender com meus erros... Bom mais vamos la OPS: FIZ ESSE SISTEMA DO ZERO (AGORA MESMO FIQUEI 3 HORAS FAZENDO) Fiz esse Painel de radio, nele vai ter varios IP de radios.. o jogador seleciona a radio que quer e clica em Escutar Musica (botão), e a musica começa a toca e se quiser pausar ele clica no botão (Pausar Musica)... Só que no sistema se vc fica varias vezes clicando em "escutar musica" com ip selecionado começa a toca varias vezes a radio e buga, e nao da para pausar mais, outro bug é que ele seleciona todos os IP que esta na tabela da gaveta dele ["","",""] ai começa toca varias radio junto Podem me ajudar? GuiOpen = guiCreateWindow(60, 197, 400, 470, "", false) GuiTable = guiCreateGridList(21, 34, 358, 304, false, GuiOpen) Guiesta = guiGridListAddColumn(GuiTable,"Estação da Radio",0.60) Guilocal = guiGridListAddColumn(GuiTable,"Localidade",0.35) GuiButtonPlay = guiCreateButton(21, 355, 170, 54, "Escutar Radio", false, GuiOpen) GuiButtonStop = guiCreateButton(205, 355, 170, 54, "Pausar Radio", false, GuiOpen) TbaleMusic = { ["Radios"] = { {"Sound POP","Brasil","https://radiosoundpop.com.br/ouvir/windows.asx"}, {"Jovem Pan","Brasil","http://69.175.13.131:8280"} }, ["Generos"] = { {"RAP","Brasil","http://67.228.177.4:9944/"}, {"RAP 2","Brasil","http://69.64.56.11:8130/ "}, {"Funk","Brasil","http://96.47.227.156:9122/"} }, } addEventHandler("onClientGUIClick",getRootElement(),function(Guiesta) if source == GuiButtonPlay then if SpamTime and SpamTime + 7000 > getTickCount() then return else SpamTime = getTickCount() end local Lists = guiGridListGetItemText(GuiTable,guiGridListGetSelectedItem(GuiTable)) if Lists ~= "" then for i,music in ipairs(TbaleMusic["Radios"])do sound = playSound(music[3]) setSoundVolume(sound,1) alert("Você esta escutando: "..music[3]) end for i,music in ipairs(TbaleMusic["Generos"])do sound = playSound(music[3]) setSoundVolume(sound,1) alert("Você esta escutando: "..music[3]) end end elseif source == GuiButtonStop then local ListsStop = guiGridListGetItemText(GuiTable,guiGridListGetSelectedItem(GuiTable)) if ListsStop ~= "" then for i,music in ipairs(TbaleMusic["Radios"])do sound = playSound(music[3]) setSoundVolume(sound,0) end for i,music in ipairs(TbaleMusic["Generos"])do sound = playSound(music[3]) setSoundVolume(sound,0) end end end end) function refreshList () if(Guiesta) then row1,column1 = guiGridListGetSelectedItem(GuiTable) guiGridListClear(GuiTable) local rows = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,rows,Guiesta,"- Radios",true,false) for id,Radioss in ipairs(TbaleMusic["Radios"])do local Radiosssss = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,Radiosssss,Guiesta,Radioss[1],false,false) guiGridListSetItemText(GuiTable,Radiosssss,Guilocal,Radioss[2],false,false) end local rowss = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,rowss,Guiesta,"- Generos",true,false) for id,Radio in ipairs(TbaleMusic["Generos"])do local Radios = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,Radios,Guiesta,Radio[1],false,false) guiGridListSetItemText(GuiTable,Radios,Guilocal,Radio[2],false,false) end if row1 and column1 then guiGridListSetSelectedItem(GuiTable,row1,column1) end end end Obrigado desde de já
  22. Cuyi

    Gang_System

    Hola, soy nuevo en todo lo que sea de mta dayz y pues en el servidor que tengo descargue un recurso de Gang_System y pues lo puse en ...mods\deathmatch\resources y pues puse luego "start Gang_System y me sale que cargo todo correcto pero cuando entro al sv para crear clan osea presione T y luego escribo /creategang no sale nada ¿Porque? AYUDA. Hello, I am new to everything that is Mta Dayz and since on the server I have downloaded a Gang_System resource and then I put it in ... mods \ deathmatch \ resources and then I put "start Gang_System and I get it I charge everything Correct but when I enter sv to create clan osea press T and then write / creategang nothing comes out Why? HELP.
  23. --client local beszelget = { } local localPlayer = getLocalPlayer () local root = getRootElement () local w,h = guiGetScreenSize() local y = h-35-340 local gomb = guiCreateButton ( w*0.275,h-35, 100, 35, "Privát üzenetek", false ) guiSetAlpha ( gomb, 1 ) local options = { colorCode=false, chatbox=true, noti=true, bind=false, bindbutton="" } local players local img_default = { w=30, h=75, x=w*0.275 + 120, y=h} local img local speed_default = 0.09 local speed local hideTimer local refreshTimer local lastSearch = "" local backTimer local wrongTable = { "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "mouse_wheel_up", "mouse_wheel_down", "arrow_l", "arrow_u", "arrow_r", "arrow_d", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_mul", "num_add", "num_sep", "num_sub", "num_div", "num_dec", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "backspace", "tab", "lalt", "ralt", "enter", "space", "pgup", "pgdn", "end", "home", "insert", "delete", "lshift", "rshift", "lctrl", "rctrl", "[", "]", "pause", "capslock", "scroll", ";", ",", "-", ".", "/", "#", "\\", "=" } local keyTable = {} function togglePM ( ) if isElement ( ablak ) then if guiGetVisible ( ablak ) then guiSetVisible ( ablak, false ) guiSetInputEnabled(false) else guiSetVisible ( ablak, true ) end end end function loadSettings () for i, v in ipairs ( wrongTable ) do keyTable[ v ] = true end if fileExists ( "settings.xml" ) then local file = xmlLoadFile ( "settings.xml" ) for i, v in ipairs ( xmlNodeGetChildren ( file ) ) do if xmlNodeGetValue ( v ) == "true" or xmlNodeGetValue ( v ) == "false" then options [ xmlNodeGetName ( v ) ] = loadstring ( "return " .. xmlNodeGetValue ( v ) )() else options [ xmlNodeGetName ( v ) ] = xmlNodeGetValue ( v ) end end if options.bind then bindWindowTo ( options.bindbutton ) end xmlUnloadFile ( file ) end end function saveSettings () local file = xmlLoadFile ( "settings.xml" ) or xmlCreateFile ( "settings.xml", "settings" ) for k, v in pairs ( options ) do local child = xmlFindChild ( file, k, 0 ) or xmlCreateChild ( file, k ) xmlNodeSetValue ( child, tostring(v) ) end xmlSaveFile ( file ) xmlUnloadFile ( file ) end function bindWindowTo ( button ) if keyTable[ button ] then guiSetText ( bindedit, button ) if options.bindbutton and options.bindbutton ~= "" then unbindKey ( options.bindbutton, "down", togglePM ) end bindKey ( button, "down", togglePM ) options.bindbutton = button else guiSetText ( bindedit, options.bindbutton ) end end function refreshList ( ) local name = guiGetText ( keres ) if name ~= lastSearch then lastSearch = name for i, v in pairs(players) do if string.find(v.name:lower(), tostring(name):lower(), 1, true) then v.hide = false else v.hide = true end end reCreateNameList ( true ) end end addEventHandler ( "onClientResourceStop", resourceRoot, saveSettings ) function onClick ( ) --outputChatBox ( "a: " .. tostring(guiGetInputEnabled()) ) if source ~= keres and isTimer ( refreshTimer ) then killTimer ( refreshTimer ) lastSearch = "" end if source == keres then if guiGetText ( keres ) == "Keresés" then guiSetText(keres,"") end guiSetInputEnabled ( true ) if not isTimer ( refreshTimer ) then refreshTimer = setTimer ( refreshList, 1000, 0 ) end elseif source == grid then local r, c = guiGridListGetSelectedItem(grid) if r and r ~= -1 then kezoOldal ( false ) local player = guiGridListGetItemData(grid,r,1) if beszelget[player] then guiSetText(memo,beszelget[player]) guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) end end elseif source == kuld then --outputChatBox ( "b: " .. tostring(guiGetInputEnabled()) ) local text = guiGetText(msg) if text == "" then guiSetInputEnabled(false) end local r, c = guiGridListGetSelectedItem(grid) if text and r and text ~= "" and r ~= -1 then local player = guiGridListGetItemData(grid,r,1) if not beszelget[player] then beszelget[player] = players [ localPlayer ].name .. ": "..text kijelol(player) else beszelget[player] = beszelget[player] .."\n".. players [ localPlayer ].name .. ": "..text end local leng = string.len(beszelget[player]) if leng > 3000 then beszelget[player] = string.sub(beszelget[player], leng-3000) end guiSetText(msg,"") if string.len(guiGetText ( memo ) ) <= 1 then guiSetText(memo,players [ localPlayer ].name .. ": "..text) else guiSetText(memo,guiGetText(memo)..players [ localPlayer ].name .. ": "..text) end if options.chatbox then outputChatBox ( "-> " .. players [ player ].name .. ": "..text, 255, 170, 0 ) end guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) guiBringToFront(msg) guiSetInputEnabled(true) triggerServerEvent("uzenet",getLocalPlayer(),player,text) --outputChatBox ( "c: " .. tostring(guiGetInputEnabled()) ) end elseif source == msg then guiSetInputEnabled(true) elseif source == color then options.colorCode = not guiCheckBoxGetSelected ( color ) reCreateNameList () elseif source == chatbox then options.chatbox = guiCheckBoxGetSelected ( chatbox ) elseif source == noti then options.noti = guiCheckBoxGetSelected ( noti ) elseif source == bind then if guiCheckBoxGetSelected ( bind ) then guiSetEnabled ( bindedit, true ) else guiSetText ( bindedit, options.bindbutton or "" ) guiSetEnabled ( bindedit, false ) end options.bind = guiCheckBoxGetSelected ( bind ) if options.bind then bindWindowTo ( options.bindbutton ) elseif options.bindbutton and options.bindbutton ~= "" then unbindKey ( options.bindbutton, "down", togglePM ) end elseif source == bindedit then guiSetInputEnabled ( true ) elseif source ~= memo then kezoOldal ( true ) end end function draw ( time ) if img.y >= h - img.h then img.y = img.y - (time * speed ) end dxDrawImage ( img.x, img.y, img.w, img.h, "fl.png" ) end function startAnim ( state ) if state == nil then state = true end if state == true then img = img_default speed = speed_default if isTimer ( hideTimer ) then killTimer ( hideTimer ) elseif isTimer ( backTimer ) then killTimer ( backTimer ) end if not drawing then addEventHandler ( "onClientPreRender", root, draw ) drawing = true end backTimer = setTimer ( startAnim, 5000, 1, "back" ) elseif state == "back" and drawing then speed = -1 * speed img.y = img.y + ( h - img.h - img.y ) hideTimer = setTimer ( startAnim, 2100, 1, false ) elseif drawing then removeEventHandler ( "onClientPreRender", root, draw ) drawing = false end end addEvent("uzenet_jott",true) addEventHandler("uzenet_jott",getRootElement(), function(text) local r, c = guiGridListGetSelectedItem(grid) local player if text and r and text ~= "" and r ~= -1 then player = guiGridListGetItemData(grid,r,1) end if player ~= source or not guiGetVisible(ablak) then guiSetText(gomb,"Privát üenetek\n ( Új üzenet! )") end if options.chatbox then outputChatBox ( "* PM from " .. players [ source ].name .. ": ".. text, 255, 100, 100 ) end if options.noti and not guiGetVisible ( ablak ) then startAnim () end text = "> ".. players [ source ].name .. ": "..text if not beszelget[source] then beszelget[source] = text kivesz(source) local row = guiGridListInsertRowAfter(grid,-1) guiGridListSetItemText(grid,row,column,players [ source ].name,false,false) guiGridListSetItemColor(grid,0,1,10,200,255) guiGridListSetItemData ( grid, row, 1, source ) else beszelget[source] = beszelget[source] .."\n".. text end if player == source then guiSetText(memo,guiGetText(memo)..text) guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) end if guiGetVisible ( msg ) then guiSetInputEnabled(true) end end) function onClick_gomb ( ) guiSetText(gomb,"Privát üzenetek") startAnim ( false ) togglePM ( ) end addEventHandler ( "onClientGUIClick", gomb, onClick_gomb) addEventHandler("onClientPlayerJoin",getRootElement(), function(arg) if grid and isElement(grid) then local row = guiGridListInsertRowAfter ( grid, guiGridListGetRowCount ( grid ) ) guiGridListSetItemData ( grid, row, 1, source ) players[ source ] = { name=options.colorCode and getPlayerName(source) or string.gsub(getPlayerName ( source ), '#%x%x%x%x%x%x', ''), blue=false } guiGridListSetItemText(grid,row,column,players [ source ].name, false,false) end end) addEventHandler( "onClientPlayerQuit", getRootElement(), function() kivesz(source) players[ source ] = nil end) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), function ( regi, uj) if grid and isElement(grid) then -- outputChatBox("nev") for i = 0, guiGridListGetRowCount(grid) do if guiGridListGetItemData(grid,i,1) == source then players[ source ].name = options.colorCode and getPlayerName(source) or string.gsub(getPlayerName ( source ), '#%x%x%x%x%x%x', '') guiGridListSetItemText(grid,i,1, players[ source ].name,false,false) end end end end ) function kivesz(player) if grid and isElement(grid) then for i = 0, guiGridListGetRowCount(grid) do if guiGridListGetItemData(grid,i,1) == player then guiGridListRemoveRow(grid,i,1) break end end end end function kijelol(player) if grid and isElement(grid) then players[ player ].blue = true kivesz ( player ) local row = guiGridListInsertRowAfter ( grid, -1, 1 ) guiGridListSetItemText(grid,row,1,players[ player ].name,false,false) guiGridListSetItemColor(grid,row,1,10,200,255) guiGridListSetItemData ( grid, row, 1, player ) guiGridListSetSelectedItem ( grid, row, 1 ) --triggerEvent("onClientGUIClick",grid) end end function reCreateNameList ( noRescan ) guiGridListClear ( grid ) if not noRescan or not players then players = {} lastSearch = "" for i, v in ipairs(getElementsByType("player")) do --if v ~= localPlayer then players[ v ] = { name=options.colorCode and getPlayerName ( v ) or string.gsub(getPlayerName ( v ), '#%x%x%x%x%x%x', ''), blue=beszelget[v] and true or false } --end end end for k, v in pairs ( players ) do if not v.hide then if not v.blue then local row = guiGridListAddRow(grid) guiGridListSetItemText ( grid, row, column, v.name, false, false) guiGridListSetItemData ( grid, row, column, k ) else local row = guiGridListInsertRowAfter(grid, 0) guiGridListSetItemText ( grid, row, column, v.name, false, false) guiGridListSetItemColor(grid,row,column,10,200,255) guiGridListSetItemData ( grid, row, column, k ) end end end end function kezoOldal ( state ) if state then guiSetText ( memo, "Légy üdvözölve kedves Játékos!\n\nVálassz egy nevet oldalról a listából akivel beszélgetni szeretnél, és írj neki!\nHa úgy szeretnél a rendes chat-be írni, hogy közben ez az ablak is nyitva van, nyomj úgy entert vagy kattints a Küldés gombra, hogy nincs beí­rva üzenet. Ezután írhatsz (t-vel általában...) a chatbox-ba, majd ide visszakattintva újra ide." ) guiSetSize ( memo, 0.75, 0.40, true ) guiSetInputEnabled ( false ) else guiSetSize ( memo, 0.75, 0.7324, true ) guiSetText ( memo, "" ) end guiSetVisible ( color, state ) guiSetVisible ( chatbox, state ) guiSetVisible ( noti, state ) guiSetVisible ( bind, state ) guiSetVisible ( bindedit, state ) guiSetVisible ( kuld, not state ) guiSetVisible ( msg, not state ) guiSetVisible ( help, state) end function init() ablak = guiCreateWindow ( w*0.275, y, 550, 340, "PM ablak", false ) guiSetVisible(ablak,false) guiWindowSetMovable( ablak, false ) guiWindowSetSizable( ablak, false ) grid = guiCreateGridList ( 0.017, 0.0706, 0.1989, 0.8265, true, ablak ) guiGridListSetSortingEnabled(grid,false) guiGridListSetSelectionMode ( grid, 2 ) bindedit = guiCreateEdit(128, 296, 130, 23, options.bindbutton, false, ablak) guiEditSetMaxLength ( bindedit, 16 ) loadSettings () column = guiGridListAddColumn ( grid, "Játékosok", 1.2 ) reCreateNameList ( ) keres = guiCreateEdit ( 0.017, 0.9176, 0.1989, 0.0559, "Keresés", true, ablak ) --guiSetEnabled(keres, false) help = guiCreateLabel ( 0.2348, 0.0765, 0.7311, 0.0706, "Válassz egy játékost, akivel beszélgetni szeretnél. Akivel már van megkezdett beszélgetésed, azt a lista elején, kék szí­nnel kiemelve találod.", true, ablak ) guiLabelSetHorizontalAlign ( help, "left", true ) guiSetFont ( help, "default-small" ) memo = guiCreateMemo(0.23, 0.16, 0.75, 0.40, "Légy üdvözölve kedves Játékos!\n\nVálassz egy nevet oldalról a listából akivel beszélgetni szeretnél, és írj neki!\nHa úgy szeretnél a rendes chat-be írni, hogy közben ez az ablak is nyitva van, nyomj úgy entert vagy kattints a Küldés gombra, hogy nincs beí­rva üzenet. Ezután írhatsz (t-vel általában...) a chatbox-ba, majd ide visszakattintva újra ide.", true, ablak) guiMemoSetReadOnly ( memo, true ) color = guiCreateCheckBox(0.23, 0.59, 0.69, 0.04, "Színkodok elrejtése a nevekben (Hide color codes in names)", true, true, ablak) guiCheckBoxSetSelected ( color, not options.colorCode ) chatbox = guiCreateCheckBox(0.23, 0.66, 0.69, 0.04, "Üzenet kiírása a chatboxba (Output messages to the chatbox)", true, true, ablak) guiCheckBoxSetSelected ( chatbox,options.chatbox ) noti = guiCreateCheckBox(0.23, 0.74, 0.68, 0.04, "Feltűnőbb üzenetjelző használata (More visible notification)", true, true, ablak) guiCheckBoxSetSelected ( noti, options.noti ) bind = guiCreateCheckBox(0.23, 0.81, 0.71, 0.04, "Ablak megnyitása a következő gombbal (Bind opening this window)", true, true, ablak) guiCheckBoxSetSelected ( bind, options.bind ) help = guiCreateLabel ( 260, 300, 270, 25, "Nyomj entert a mentéshez (Press enter to save)", false, ablak ) guiSetEnabled ( bindedit, options.bind ) msg = guiCreateEdit ( 0.2292, 0.9147, 0.6364, 0.0588, "", true, ablak ) guiEditSetMaxLength ( msg, 128 ) kuld = guiCreateButton ( 0.8693, 0.9059, 0.1136, 0.0676, "Küldés", true, ablak ) kezoOldal ( true ) addEventHandler( "onClientGUIAccepted", root, function( theElement ) if theElement == msg then --guiSetInputEnabled ( false ) guiBringToFront ( msg ) triggerEvent("onClientGUIClick",kuld) elseif theElement == bindedit then local text = guiGetText ( bindedit ) if text then guiSetInputEnabled ( false ) guiMoveToBack ( bindedit ) bindWindowTo ( text ) end end end ) addEventHandler ( "onClientGUIClick", ablak, onClick, true) end addEventHandler("onClientResourceStart",getResourceRootElement(),init) addCommandHandler ( "pm", togglePM ) --server addEvent("uzenet", true) addEventHandler("uzenet", getRootElement(), function(toplayer, text) triggerClientEvent(toplayer, "uzenet_jott", source, source, text) end ) What wrong? client.lua:228: attempt to concatenate local 'text' a userdata value