Search the Community

Showing results for tags 'scripting'.



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
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/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

Found 230 results

  1. function walkstyle(thePlayer) setPedWalkingStyle(localPlayer,128) end function walk ( thePlayer ) elseif isObjectInACLGroup("user."..walk, aclGetGroup("Console")) then walkstyle(thePlayer) end end addCommandHandler("walk", walk) I couldn't fix it. How can i fix this code.
  2. Somehow i can make this possible? When a player connect, then he have to wait the end of download, then he can use the fr gui. I want make fr gui usable when player download the mods. Sorry for my bad english..
  3. I attached a song to my car, but when i'll go far away from car, the music starts from the beginning... s: how to fix this?
  4. client: function rtwjhrt() if isElement(ss) then stopSound(ss) return end local car = getPedOccupiedVehicle ( localPlayer ) local gettext = guiGetText ( GUIEditor.edit[1] ) local x, y, z = getElementPosition( car ) local ss = playSound3D( 'asd.mp3', x, y, z ) setSoundMaxDistance( ss, 85 ) attachElements(ss,car) end addEvent("asd123asd456",true) addEventHandler("asd123asd456",root,rtwjhrt) server: function trig() triggerClientEvent(root,"asd123asd456",root) end addEvent( "asjdlaj", true ) addEventHandler( "asjdlaj", root, trig ) Why not hear the sound another players?
  5. If i play a music from youtube with fetchRemote, the .mp3 downloaded it somewhere?
  6. hey guys i've made CJ Custom Clothes and it's working but there's a problem when a player reconnect or resource restart it back to original clothes i want save it any help ? screenshot : https://imgur.com/a/iBAzGog
  7. I want create a dxdraw rectangle and text on the map. But how to make this possible?
  8. i added this line to my script: takeWeapon( source, 38, 99999 ) buuut, does not working.. how to fix this?
  9. Problem with TabPanel on FR

    Hi all, I'm putting together a section of My Account on my server, I want it to be a little window with a tabpanel that has the following tabs: Start (where it shows the basic statistics, name, type of account, level, etc) Configuration (where it will show buttons to change the password, delete the account, etc) Clan/Gang (where it would show data exported from the gangystem) For now I can not think of any other flap, if any one sees a utility to a flap I could also recommend it The problem is this, I am creating this through the freeroam resource GUI (since the My Account button is in the freeroam too, then I wanted to do everything together). The code is the following: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } The result: It's strange, but I say ... maybe the tab is missing for it to work, so I add it and the code looks like this: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } But the result is that when I want to open this section (My Account) it shows the last 2 errors in the debugscript (ignore 'callesgroove' resource) Somebody could help me? From already thank you very much!
  10. Problema con TabPanel en FR

    Buenas a todos, estoy armando una sección de Mi Cuenta en mi servidor, quiero que sea una ventanita con un tabpanel que tenga las siguientes pestañas: Inicio (donde muestra las estadisticas basicas, nombre, tipo de cuenta, nivel, etc) Configuración (donde mostrara botones para cambiar la clave, eliminar la cuenta, etc) Clan (donde mostraria datos exportados del gangystem) Por ahora no se me ocurre ninguna otra solapa, si alguno le ve alguna utilidad a una solapa podría recomendármela también El problema es el siguiente, estoy creando esto a través de la GUI del resource freeroam (ya que el botón de Mi Cuenta está en el freeroam también, entonces quería hacer todo junto). El código es el siguiente: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, }, } Y el resultado el siguiente: Es extraño, pero digo... quizá le faltan las tab para que funcione, entonces la agrego y el codigo queda así: wndCuenta = { 'wnd', text = 'LPMV2 - Mi Cuenta', x = 380, y = 190, width = 500, height = 800, controls = { {'tbp', id='tbp1', text='pruebaTabPanel', width=200 , height=200}, {'tab', id='tab1', text='pruebaTab', width=200 , height=200}, }, } Pero el resultado es que cuando quiero abrir esta sección (Mi Cuenta) muestra los ultimos 2 errores en el debugscript (ignoren el de callesgroove) Alguien podría ayudarme? Desde ya, muchas gracias!
  11. this is my code: function onQuit(thePlayer) for i,v in pairs(getElementsByType("vehicle",resourceRoot)) do if getElementData(v,"oveie") == getPlayerName(thePlayer) then destroyElement(v) end end end addEventHandler ( "onPlayerQuit", root, onQuit ) but this does not working.. why? how to fix it?
  12. I want create a custom scoreboard.. But, how to add players to it with rectangle, and dxdrawtext(s), and when there are xy players, how to make scrollable?? Sorry for my bad english.. :c
  13. Sobre o Nick do voice

    Como faço para arrumar o nick do voice ( tirar o id das cores e deixar normal "bonito" )
  14. So, i choose MTA over SAMP recently, to start learn scripting and developing my own server. Okay... I'm reading some scripts and by them, start browsing about the MTA's integrated systems that could help me develop an amazing or at least good experience, to my self and other players. The first thing that I've been facing is SQLite. I understood that it's a language of some kind to create a database, which could have: group names with their slots and store any change related with those; Items in market with fluctuating price; Car names, colors or price that are owned by the players; Inventory system, etc... But, when i read about SQlite i noticed that there's some features that could be invasive, since it can access third-party programs or CSV files to create analysis between variables. In resume, i want to know if all assets that i could use normally with SQlite is available on MTA:SA.
  15. I want create a script, which play a sound, when a player shot another player head. But the sound play for killed player and localplayer too. How to make this?
  16. Vinyl Script for Vehicle

    Guys, who has a vinyl system that can move stickers on the vehicle?I would be grateful to those who answer) Show please)
  17. 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
  18. I want create a animation for my dx image. The image hide, and appear again continuously. How to make this?
  19. Tuneable cars

    Hello. So, I made a MTA server the other day. I made it only for fun, like to play with my IRL friends. Once I downloaded a modded car, which had tuneable parts, and in the rar file I had a lot of files like these : fbmp_a_l.dff, and a lot more, and I don't know what to do with them. Can I get some help pls? I have another question: I was searching for a tuning system but I couldn't really find any. Can somebody link me some?
  20. I want create a script, which tp a player to me, and teleport me to a player, like in admin panel, just with command. How to make this? For example: /tpto playername , and /tpme playername. And when i teleport a player to me, the player get out from vehicle
  21. [HELP] How to create 3d text?

    I want create a script, which creates a 3d text with a cmd. For example, when i type "/word asd" then this make a 3d text the player position "#playername : asd", then after elapse 3 hours, the text will hide. How to make this?
  22. function outputChatBoxRemote ( playerName, message, type, serverport ) outputChatBox ( "From " .. playerName .. " on " .. serverport .. ": " .. message ) return "hello sailor" end function finishedCallback( responseData, errno ) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString( "callRemote: ERROR #" .. errno ) elseif responseData ~= "hello sailor" then outputDebugString( "callRemote: Unexpected reply: " .. responseData ) else end end function playerChat ( message, type ) callRemote ( "87.229.77.40:22030", getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end addEventHandler ( "onPlayerChat", getRootElement(), playerChat ) This is the code, but does not working.. what wrong?
  23. I want make a script, which plays sound from youtube.. But.. there is no one converter which would work.. How to use a converter as sound player? Anyone can help?? Sorry for my bad english..
  24. 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
  25. Olá pessoal! Estou tendo um pequeno problema, sou iniciante em scripting e estava usando o recurso Object_Preview em um script, e vi um exemplo disso em GUI, mas não sei como fazê-lo em Dx. GUI EXEMPLO: https://wiki.multitheftauto.com/wiki/Resource:Object_preview Meu código: local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 10) local myObject,myElement = nil, nil local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function menu() color = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495) then -- M4 --exports.preview:setPositionOffsets(m4view,0,1.5,0.1) --exports.preview:setRotation(m4view, getTickCount()/10, 0, 0) color = tocolor(16, 102, 231, 100) end color2 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.3802, screenW * 0.3360, screenH * 0.0495) then -- Desert color2 = tocolor(16, 102, 231, 100) end color3 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.4297, screenW * 0.3360, screenH * 0.0495) then -- Cacetete color3 = tocolor(16, 102, 231, 100) end color4 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.4792, screenW * 0.3360, screenH * 0.0495) then -- Vida e colete color4 = tocolor(16, 102, 231, 100) end colorF = tocolor(0, 0, 0, 0) if isCursorOnElement(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469) then colorF = tocolor(255, 0, 0, 150) end myElement = createObject(356,0,0,0) myObject = exports.preview:createObjectPreview(myElement,0,0,1,1,1,1, true, true, true) dxDrawRectangle(screenW * 0.3221, screenH * 0.2656, screenW * 0.3551, screenH * 0.4844, tocolor(0, 0, 0, 185), false) dxDrawRectangle(screenW * 0.3221, screenH * 0.2656, screenW * 0.3551, screenH * 0.0469, tocolor(0, 0, 0, 185), false) dxDrawText("Menu de itens - #1066E7PMESP", screenW * 0.3294, screenH * 0.2786, screenW * 0.4971, screenH * 0.3242, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469, colorF, false) dxDrawText("X", screenW * 0.6618, screenH * 0.2786, screenW * 0.8294, screenH * 0.3242, tocolor(255, 255, 255, 200), x*1.30, "default-bold", "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495, color, false) dxDrawText("(#1066E7Armamento#FFFFFF) M4", screenW * 0.3368, screenH * 0.3438, screenW * 0.5044, screenH * 0.3893, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.3802, screenW * 0.3360, screenH * 0.0495, color2, false) dxDrawText("(#1066E7Armamento#FFFFFF) Desert Eagle", screenW * 0.3368, screenH * 0.3932, screenW * 0.5044, screenH * 0.4388, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.4297, screenW * 0.3360, screenH * 0.0495, color3, false) dxDrawText("(#1066E7Armamento#FFFFFF) Cacetete", screenW * 0.3368, screenH * 0.4427, screenW * 0.5044, screenH * 0.4883, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.4792, screenW * 0.3360, screenH * 0.0495, color4, false) dxDrawText("Vida e Colete", screenW * 0.3368, screenH * 0.4922, screenW * 0.5044, screenH * 0.5378, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.5612, screenW * 0.3360, screenH * 0.1615, tocolor(0, 0, 0, 185), false) end function render() if not isEventHandlerAdded("onClientRender", root, menu) then addEventHandler("onClientRender", root, menu) showCursor(true) showChat(false) -- l_0_1 = true end end addEvent("openMenuPM", true) addEventHandler("openMenuPM", root, render) function close(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469) then showCursor(false) showChat(true) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, menu) if l_0_1 then l_0_1 = false end end end end end addEventHandler("onClientClick", root, close) function m4(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495) then triggerServerEvent("m4", localPlayer) removeEventHandler("onClientRender", root, menu) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) if l_0_1 then l_0_1 = false end end end end end addEventHandler("onClientClick", root, m4) function isCursorOnElement( posX, posY, width, height ) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return false end