Jump to content

Search the Community

Showing results for tags 'question'.

  • 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


About Me


Member Title


Gang


Location


Occupation


Interests

  1. Hey guys! My question is where should I store static data? For exaple list of achievements, or list of weapon config (damage, model etc). In a local XML file, or an uniqe sql table? Thank you!
  2. local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 13) addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"playerFallen") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "b" or button == "F9" or button == "F10" or button == "F11" or button == "F12" then cancelEvent() end end end ) function text() for _, player in ipairs(getElementsByType('player')) do if isElementOnScreen(player) and getElementData(player, "playerFallen") then local x, y, z = getElementPosition(player) local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition(player, 8) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) local drawDistance = 30.0 if (dist < drawDistance or player == target) then if(isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false)) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.6) if(x and y) then local px, py = getScreenFromWorldPosition (vx, vy, vz + 0.3) local w = dxGetTextWidth("PRECISANDO DE CURA!", 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawImage(x -6 - w / 2,y - 15 - h - 12, w + 25, h + 115, 'images/hp.png', 0, 0, 0, tocolor(255, 0, 0, math.abs(math.sin(getTickCount()/170))*200)) --dxDrawRectangle(x -6 - w / 2,y - 15 - h - 12, w + 9, h, tocolor(0, 0, 0, 194), false) --dxDrawText("#FFFFFFNECESIDAD DE #FF0000CURACION#FFFFFF!", x - 0 - w / 2,y - 15 - h - 12, w, h, tocolor(255,0,0, math.abs(math.sin(getTickCount()/170))*200), 1, "default-bold", "left", "top", false, false, false, true, false) end end end end end end addEventHandler("onClientRender", root, text) function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end 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 contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) if minutes < 10 then minutes = "0"..minutes end if seconds < 10 then seconds = "0"..seconds end dxDrawRectangle(screenW * 0.3580, screenH * 0.8099, screenW * 0.2621, screenH * 0.1328, tocolor(0, 0, 0, 182), false) dxDrawText("BVA EMERGÊNCIA", screenW * 0.3580, screenH * 0.7878, screenW * 0.6201, screenH * 0.8151, tocolor(255, 25, 25, 255), 1.20, "default-bold", "center", "top", false, false, false, false, false) dxDrawText("Estás lesionado y necesitas un médico.", screenW * 0.3580, screenH * 0.8229, screenW * 0.6201, screenH * 0.8477, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Llame a los paramédicos al /192 y espere", screenW * 0.3580, screenH * 0.8477, screenW * 0.6201, screenH * 0.8724, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("um paramédico chegar.", screenW * 0.3580, screenH * 0.8724, screenW * 0.6201, screenH * 0.8971, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("TIEMPO DE VIDA:", screenW * 0.3616, screenH * 0.9154, screenW * 0.4305, screenH * 0.9375, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("#ff0000".. minutes.."#ffffff:#ff0000"..seconds, screenW * 0.3580, screenH * 0.9023, screenW * 0.6201, screenH * 0.9505, tocolor(255, 25, 25, 255), 1.40, "default-bold", "center", "center", false, false, false, true, false) if getElementHealth(localPlayer) < 30 then end end function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") end function DxChamar() dxDrawText("Llamaste a un paramédico, espera.", screenW * 0.3580, screenH * 0.7500, screenW * 0.6223, screenH * 0.7799, tocolor(245, 254, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function updateShader() upDateScreenSource() if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function render() if not isEventHandlerAdded("onClientRender", root, contador) then tick = getTickCount() createShader() addEventHandler("onClientRender", root, contador) addEventHandler("onClientPreRender", root, updateShader) end end addEvent("startDeadTime", true) addEventHandler("startDeadTime", root, render) function remove() if isEventHandlerAdded("onClientRender", root, contador) then removeEventHandler("onClientRender", root, contador) removeEventHandler("onClientPreRender", root, updateShader) end end addEvent("stopDeadTime", true) addEventHandler("stopDeadTime", root, remove) i made a knock system and i want to put godmode to the player who knocked
  3. How to encrypt server vehicle mods dff and txd
  4. I had mta open and was connected to a server but was alt-tabbed out of the game for around 20 minutes and when I alt-tabbed back in to the game I was greeted by an error saying I had DLL Injectors and could not connect to the server, So I assumed it was a glitch and could be fixed by realunching MTA but after launching mta when I tried to connect back to the server I was greeted by a CD47 Ban with description of using DLL Injector. The ban was only for an hour so that's not the problem I wanted to know which process caused the ban to try and avoid this in the feature, I was hoping there would be like a log or something that I could see to indicate what caused it? Because I did not have any DLL Injector open and neither Injected anything into the game. For now my I think it might have been the MSI Afterburner and Rivatuners overlay but I'm not sure. tl;dr I got banned for dll injector and I want to know which process caused it.
  5. I want to do this: Using webhook, something like this: -- created by zsenel local discordWebhookURL = "https://discord.com/api/webhooks/835103134270488596/FY5*********EXAMPLE************yKEaRsKJp4" function sendDiscordMessage(message) sendOptions = { formFields = { content = "Example:", username = "webhook - Example", embed = { description= "```Some user have typed \"help\" command.```", color= null, author= { name= "Webhook - Example" }, footer = { text = "I want to do this..." }, }, }, } fetchRemote ( discordWebhookURL, sendOptions, WebhookCallback ) end function WebhookCallback(responseData) outputDebugString("(Discord webhook callback): responseData: "..responseData) end function SendDiscordTestMessage(player, command, ...) local msg = table.concat({...}," ") -- for multiple words sendDiscordMessage(msg) end Return < Thats only a example do i want to do, any kind of help please?
  6. Hi guys, this is my first topic and I hope to get my answer soon :D The question I had was, can the cmd be entered into MTA:SA Server through Discord Bot? for example: Inside the discord: !kill <playerid> Then inside the MTA:SA: function kill(player) { setElementHealth(player, 0) } I just wanted to know if this is done or not. In that case, I'm glad you taught me a solution :D
  7. Anyone can send me a working yt mp3 converter API? Or how to create one, to play music from youtube on my server?
  8. Hello, I would like some help. Imagine a hypothetical situation. I create 100 pickups on my server and each pickup sends a different message to the player. I came up with 2 ways to do this and I wish you could tell me which is the best in terms of resources. addEventHandler("onPickupHit", pickupSourceHere, function(player) outputChatBox("the message here", player) cancelEvent() end) addEventHandler("onPickupHit", resourceRoot, function(player) if source == pickupSourceHere then outputChatBox("the message here", player) cancelEvent() end end) Thanks! Oh, and sorry about my english.
  9. Hey, someone knows where can i find a host company to my mta:sa server? I do not want to buy from a reseller, I want to be the reseller but only do it for my server
  10. Hi! I'm a kind of noob scripter making a VIP panel, but I do not find a way to set.. for example, I want the player to spawn op weapons (only for vip users in this case), like Rocket Launcher, only a few times at day, not more than the established number of times for spawning it. Is it possible to do that? Also spawn Rhino's and some vehicles that I made only for VIP's.
  11. Buenas gente, alguno me podria ayudar a darle la funcion de traer o warp un vehiculo para un boton de un panel de concesionario
  12. Buenas Gente, Alguno me puede explicar como bloquear un comando para que solo funcione para un usuario?. Lo que quiero hacer es spawnear un auto por comando pero que solo un usuario pueda hacerlo
  13. I want to know something.. When someone does a script and finds something hard to do for him to make his script works well.. I know we have to ask here for help but if he found what he was looking for in a free resource.. Does that consider stealing? For example: -if he wanted to use a table function in a certain way but doesn't know how & he found a script using that table in the same way he wanted. So if he used it. Consider stealing? Btw he used just the way not the script
  14. como hago para quitar los nombres de autos que aparecen cuando me subo a un auto y quitar los nombres de los lugares que aparecen cada que paso por una parte del mapa
  15. I created a youtube player, and i want to remove the event handler, when the music ends, but i dont know how to get the song length from web browser... anyone can help?
  16. Hi, I would like to know if there's a way to change the texture of the objects as in SA-MP, I have many mappings on another server, and I would like to use them here too. I've been looking around but didn't find anything similar. Thank you.
  17. Sooo, how can I use (I think for you well known) dxDrawTextOnElement() (client-side function, MTA Wiki site: [click]) in server-side scripts? I tried to export, plus this code: addEventHandler("onPlayerChat", resourceRoot, function(message, type_) if(type_ == 0) then call(resourceRoot, "dxDrawTextOnElement", source, message, 1, 20, 255, 255, 255, 255, 1, "default-bold") end end) (export in meta.xml for proof): <meta> <info author="VaporZ" name="VaporZ's utility [PL]" description="(desc)" type="script" version="1.0.1"/> <script src="cars.Lua" type="server"/> <script src="bank.Lua" type="server"/> <script src="utility.Lua" type="server"/> <script src="utility-c.Lua" type="client"/> <script src="testy.Lua" type="server"/> <file src="bank/accounts.xml"/> <file src="bank/atms.xml"/> <file src="cars/saved.xml"/> <file src="cars/shops.xml"/> <export function="dxDrawTextOnElement" type="client"/> </meta> But this don't work. Any ideas? Okay, I got further, but still it's not good. Look at this one (console error): ERROR: systems\utility.Lua:108: call: failed to call 'systems:dxDrawTextOnElement'
  18. This is the dumbest question I've ever asked on this forum, but I have problem even not only with this. So, how can I add scripts from different folders in my meta.xml? And in these scripts, how can I load xml files from different folders, too? Any idea? If yes, please, show me example I know, that I would use xml = xmlLoadFile("filename.xml") But how to load xml in different folders? Same <script src="script.Lua" type="server"/> But how to tell MTA to load script from different folder?
  19. I want create a HUD with image progress bars. I think i need dxDrawImageSection, but i don't know how to use this for a progress bar. Anyone can give me a example of this progress bar with imagesection?
  20. How to remove the error CC21, which was added artificially, for example on the launcher of a large MTA project, I hope for help.
  21. ENGLISH Let's say I have a player and I want to spawn a car in front of it with a specific distance away from the player. It must considers the player's rotation. It involves some math calculations, but I can't formulate it. BRASIL Vamos supor que eu tenha um player e eu queira spawnar um carro na frente dele com uma distância específica. Para fazer isso, deve levar em consideração a rotação atual do player. Eu sei que isso envolve cálculos matemáticos, mas não consegui formulá-los. Thanks all
  22. This is the code: local now = getTickCount() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 2500) - start), "Linear") local now2 = getTickCount() local x2,y2 = interpolateBetween(asd, asd1, 0, fgh, fgh1, 0, (now2 - start2) / ((start2 +2500) - start2), "Linear") if right == false then dxDrawRectangle(x, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255)) else dxDrawRectangle(x2, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255)) end -- if x >= 1063 and x <= 1073 and right == false then test = true elseif x >= 1089 and x <= 1099 and right == false then test = true elseif x >= 1158 and x <= 1172 and right == false then test = true elseif x >= 1212 and x <= 1232 and right == false then test = true elseif x >= 1276 and x <= 1293 and right == false then test = true elseif x >= 1423 and x <= 1433 and right == false then test = true elseif x >= 1476 and x <= 1487 and right == false then test = true else test = false end i want change the test to true when the rectangle is in the granted position, but how can i get the momentary position of the dx rectangle?
  23. This is the code: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end else return false end end function payScript(player,cmd,other,amount) local name = getPlayerFromPartialName(other) local atg local rpm = getPlayerMoney(player) local err = {} local penz = getElementData(player,"char:money") or 0 if name == false then err[#err+1] = "#FFffFFA név nem található!" end if tonumber(amount) < 0 then err[#err+1] = "#FFffFFNegatív szám nem lehet!" end atg = tonumber(amount) if (penz-atg) < 0 then err[#err+1] = "#FFffFFNincs elég pénzed!" end if(player == name) then err[#err+1] = "# nem tudsz." end if #err == 0 then setElementData(player,"char:money",penz-atg) setElementData(name,"char:money",atg+penz) else for i=1,#err do end end end addCommandHandler( "pay", payScript ) the other and the local player's money changes to the same... how to fix this??
  24. I want to render a rectangle to the cursor, but the rectangle too far from the cursor.. How to fix this in my code? code: local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ function render() local screenx, screeny = getCursorPosition() dxDrawRectangle((sx_-687) * xm * screenx, (sy_/2+70) * ym * screeny, 170 * xm, 25 * ym,tocolor(255,181,64,80)) end addEventHandler("onClientRender",root,render) the problem:
  25. No errors / warnings in debugscript 3... then what wrong in this script? Client: requestBrowserDomains({"www.convertmp3.io"}) local browser = createBrowser( 1, 1, false ) local currentSound = {} addEvent( 'Play' , true ) addEventHandler( 'Play' , root , function( link ) local vehicle = getPedOccupiedVehicle ( source ) local x, y, z = getElementPosition(vehicle) currentSound[source] = playSound3D( link, x, y, z ) attachElements(currentSound[source],vehicle) setSoundMaxDistance(currentSound[source],30) setSoundVolume(currentSound[source],50) end ) function fetch(_,url) if url and url ~= "" then fetchRemote("http://www.convertmp3.io/fetch/?format=JSON&video="..url, callback) end end addCommandHandler("p",fetch) function callback(data, error) if (error ~= 0) then return outputChatBox(error) end if (data == "ERROR") then return outputChatBox("data error") end local data = fromJSON("["..data.."]") if (data) then outputChatBox("Title: "..data.title) outputChatBox("Length: "..data.length) outputChatBox("Link: "..data.link) loadBrowserURL( browser, data.link ) end end addEventHandler( "onClientBrowserNavigate", browser, function( link ) if not link:find("www.convertmp3.io") then triggerServerEvent( 'play' , localPlayer , link ) -- trigger the event when the script actially gets the playable link! end end ) server: addEvent( 'play' , true ) addEventHandler( 'play' , root , function( link ) triggerClientEvent( root , 'Play' , client , link ) end )
×
×
  • Create New...