Jump to content

Search the Community

Showing results for tags 'system'.

  • 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. a system like putting a gun in the trunk of a car, but instead of a car trunk, I want to be able to take and put a specified amount of guns from a chosen object or marker. If such a system exists, could you send it?
  2. mod_downloader is a system that allows your players to control which replacement mods (skins, vehicles, objects/weapons) they want to download and use: Highly customizable Translatable Robust Optimized Up to date The following features are available: Resource settings to control everything Minimalistic CEGUI panel Alternative DGS panel (optional) Permissions system (per mod and to use the GUI) Teleportation system with GUI (example/demo) This resource is intended for servers that want to give players the choice of which server replacement mods they can use (e.g. Freeroam/RPG/Drift/Racing servers). It supports model files encrypted with NandoCrypt so no-one can steal your mods. GitHub Repo (Download): https://github.com/Fernando-A-Rocha/mta-mod-downloader#readme (Documentation here) Screenshots: https://github.com/Fernando-A-Rocha/mta-mod-downloader#screenshots Community Page (Download): https://community.multitheftauto.com/index.php?p=resources&s=details&id=18799 For support/questions please access my main thread: https://forum.multitheftauto.com/topic/139644-rel-nandos-resources/ I hope you enjoy!
  3. 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. 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: Basic: Window Edit Box Button Grid List Image Scroll Bar Scroll Pane Text Label Tab Panel Detect Area Radio Button Combo Box Check Box Memo 3D Interface 3D Text Browser Switch Button Selector Plugin: Media Browser Color Picker Mask Remote Image QRCode Blur Box Rounded Rectangle Nine Slice Scaling Object Preview Support Canvas Scroll Pane's 3D Effect 3. Edit/Memo rewrite ( You can no longer find the problems in dgs, the problems which exist in cegui) 4. Detect Area is efficient when checking whether your cursor is in a complicated shape. 5. Debug Mode , Command: "debugdgs" 6. You can apply shader to the dxgui ( Compatible with some resources like Objec tPreview ). 7. Include CMD, Command: "dgscmd" ( For more help, please input "help" in the CMD ) 8. Memo/Edit rewritten. 9. Object Oriented Programming Class. 10. Render Target Failure Check ( Warns when there's no enough video memory to create render target ). 11. DGS resembles cegui, you can find the similar feeling when scripting with dgs. 12. 48-hour-response service, your suggestions and bug report will be dealt with in 48 hours ( or less, like 12 hours ? ) 13. Custom Style system 14. Built-in shader plugin 15. More properties 16. Built in multi-language support 17. Simple GUI To DGS (G2D) 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/getPlayerIP. 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)
  4. As the title says, I'm interested in a finished Custom Weapon System (CWS in short). There are a few criteria that must be met with the CWS, which I will go in detail privately. So if you're interested in selling one, feel free to DM me. Best regards, Vseven
  5. Hi! I want to sell my drone system Contains: Model Images VIDEO: Use autumn coupon code to get 25% off! Coupon will expire at 30/10/2020 If you want to buy this script, please PM me or email: [email protected] or use this link: BUY HERE Other scripts HERE
  6. I would like to do a recoil system in such a way that a player who is hit by someone is thrown upwards simultaneously E <---- this is element X <---- point position example x x x x x E x
  7. 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.
  8. redditing

    Inventory

    Hi, I would like to make an inventory system, could anyone give me commands to create this work? and I don't mean ready scripts or anything because I want to do it myself, I just don't know where to start here. I would like to ask for all the commands that I will definitely need.
  9. Hello, how to make a system of turn signals? (using car textures)
  10. 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
  11. كيف حالكم عساكم بخير , مثل ماهو معروض بعنوان الموضوع للبيع سكربت اوبر للي مايعرف وش اوبر , تطلب سيارة وتختار مكان ويجي شخص يوصلك للمكان الي اخترته الي انا سويته خليت بيد تلقائي يجي يوصلك للمكان الي تبغاه طبعا هذا اول سكربت اعرضه للبيع تفتحلك لوحة وفيها الاماكن وانت تضيف الاماكن والسعر بيكون على حسب بعدك عن المكان الي تبي تروح له سعر الميل انا حاطه 2 ويمديك تغيره بس تشتري السكربت , الاماكن القريبة لك ماراح تظهر لازم يكون بعدك 150 عن المكان عشان يظهر هذا الحد الادنى وطبعا تقدر تغير البعد تقدر تخلي السكربت يفتح من زر وتقدر تخليه يفتح من امر من اف8 صور من السكربت طبعا في حال استعجالك عشان تروح للمكان تضغط انتر وراح ينتقلك للمكان الي تبيه بثانية الخصائص الموجودة بالسكربت ولو يتبرع واحد من الشباب يسوي فديو ويحطه بأكون شاكر له الي يبي يجرب السكربت وياخذ صورة اوضح منه يخش السيرفر mtasa://178.32.99.229:22222 uber او اكتب باف8 m طبعا بس تخش راح يعطيك فلوس واضغط حرف حاب اقولك ماخذت من السكربت الا احداثيات الطرق traffic وجرب لين تقتنع , الي يجي يسوي نفسه محقق كونان ويقول نسخ لصق من سكربت السكربت يحتوي على ملفين كلينت وسيرفر وملف احداثيات الطرق مثل ماذكرت فوق التحميل حق السكربت قليل مره لان احداثيات الطرق سيرفر واغلب الشغل على السيرفر والمعروف ان ملفات السيرفر ماتتحمل على جهاز الاعب الكلينت عليه اللوحة وبعض الامور البسيطة , السكربت مبرمج بأفضل الطرق ومافيه ولا بق ان شاء الله والحين نجي للسعر صراحة انا معطيه سعر مو من حقه مقارنة بالسكربت ومواصفاته السعر بالريال السعودي : 100 السعر بالدولار الامريكي : 26 طرق الدفع واول 3 اشخاص يشترون السكربت بيحصلون على الاصدار الثاني من السكربت مجانا الاصدار الثاني بيكون مختلف جذريا والسعر راح يكون اغلى من هذا واتمنى مايكون فيه ردود خارجا عن صياغ الموضوع واي استفسار بخصوص السكربت حط ردك : طرق التواصل معي وهذا وصل الله وسلم على نبينا محمد
  12. Hi, Fortnite building system for sell put your offer (: - you can test scripts if you want. https://youtu.be/wlxe1g1oMDQ
  13. 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.
  14. 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
  15. 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)
  16. 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
  17. 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
  18. 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 )
  19. 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 )
  20. 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
  21. 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
  22. 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)
  23. 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 ?
  24. 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)
  25. 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 ?
×
×
  • Create New...