Search the Community
Showing results for tags 'script'.
-
Interactive Debug Terminal Screenshots Description: A sleek, modern in-game debug terminal built with JavaScript and winBox, designed for fast, real-time development and debugging inside MTA. Features: Real-time command execution and feedback Scrollable and auto-scrolling output UTF-8 safe messaging Command history (ArrowUp/Down) Builtin 'clear' and 'help' commands Built for developers who want a clean and interactive terminal-style experience for debugging and monitoring scripts. Work in progress I'm still developing this, so feedback and suggestions are very welcome!
-
MTA:SA - Claire Anticheat Claire is a modular, lightweight anticheat resource for MTA:SA, designed to improve the integrity and fairness of servers. Its core philosophy is simple: organize detections into clean, independent modules, make them easy to configure, and build an open platform that others can expand and improve. Claire runs silently in the background, acting as a guardian layer — constantly monitoring player behavior, network conditions, and client-side integrity without interfering with gameplay or degrading performance. Its design favors discretion and precision, targeting cheats without disrupting legitimate users. If you're looking for a solid, customizable way to secure your MTA:SA server, try out Claire. Why does it matter? By being fully open-source, Claire gives server owners an accessible and transparent tool to detect common exploits and improve their server environment. But more than that, it invites collaboration. The idea is that, together — through testing, feedback, improvements, and shared knowledge — we can create a more solid, trustworthy anticheat resource that benefits the entire MTA community. Current features Claire currently includes over 20 independent detection modules, covering movement, combat, environment manipulation, network spoofing, and more. All detections are modular, configurable, and designed to operate silently in the background with minimal performance impact. False positives are rare thanks to tolerance-based logic, score systems, and heuristic analysis. Overall reliability across all modules is expected to be around 95%, all features are listed at our GitHub page. Contributing Claire is an open-source project — contributions are welcome! Feel free to contribute with PRs, reports, or suggestions at our GitHub page. You can also reach out to us on Discord. Download Download from MTA Community: latest release - 1.1.5 from 2025/04/22 Download from GitHub: latest release - 1.1.5 from 2025/04/22 Please check our GitHub page before downloading it, I'm open for suggestions.
-
Hey there! I told you before in some other post that I used Grok for scripting. He nearly pulled off a very nice Racing map panel. However there is a slight problem - when you buy the map, money goes away (money is inside the script too I think when you win a race it gives you certain amount) and map doesn't play or its not set. If you guys have any idea how can it be fixed, lmk. By the way, to get this kinda script you need around 2 hours on Grok for him to properly understand MTA scripting Codes: server.lua local moneyFile = "money.xml" local nextMapQueue = nil -- Store the next map if race resource isn't running -- Load player's money from XML function loadPlayerMoney(player) local serial = getPlayerSerial(player) local xml = xmlLoadFile(moneyFile) or xmlCreateFile(moneyFile, "money") if not xml then outputDebugString("Failed to load or create money.xml", 1) return end local node = xmlFindChild(xml, serial, 0) or xmlCreateChild(xml, serial) local money = tonumber(xmlNodeGetValue(node)) or 0 setElementData(player, "money", money) xmlSaveFile(xml) xmlUnloadFile(xml) end -- Save player's money to XML function savePlayerMoney(player) local serial = getPlayerSerial(player) local money = getElementData(player, "money") or 0 local xml = xmlLoadFile(moneyFile) or xmlCreateFile(moneyFile, "money") if not xml then outputDebugString("Failed to load or create money.xml", 1) return end local node = xmlFindChild(xml, serial, 0) or xmlCreateChild(xml, serial) xmlNodeSetValue(node, tostring(money)) xmlSaveFile(xml) xmlUnloadFile(xml) end -- Handle player join addEventHandler("onPlayerJoin", root, function() loadPlayerMoney(source) end) -- Handle player quit addEventHandler("onPlayerQuit", root, function() savePlayerMoney(source) end) -- Fetch all race map resources function getMapList() local mapList = {} local resources = getResources() if not resources then outputDebugString("Failed to get resources - check ACL permissions for 'function.getResources'!", 1) return mapList end local includedCount = 0 local excludedCount = 0 for i, resource in ipairs(resources) do local resName = getResourceName(resource) -- Skip system resources, our own resource, and known gamemodes if resName ~= "race_map_panel" and not resName:find("^%[") and resName ~= "csrw" and resName ~= "race" and resName ~= "play" and resName ~= "assault" and resName ~= "destructionderby" and resName ~= "ctf" and resName ~= "as-cliff" and resName ~= "ctf-goldcove" then local metaPath = ":" .. resName .. "/meta.xml" local metaFile = xmlLoadFile(metaPath) if metaFile then -- Check if the resource is a gamemode local infoNode = xmlFindChild(metaFile, "info", 0) local isGamemode = false if infoNode then local resType = xmlNodeGetAttribute(infoNode, "type") if resType and resType:lower() == "gamemode" then isGamemode = true excludedCount = excludedCount + 1 end end if not isGamemode then local isRaceMap = false local hasMapFile = false local gamemodesValue = nil -- Check for <map> element with a .map file local mapNode = xmlFindChild(metaFile, "map", 0) if mapNode then local mapSrc = xmlNodeGetAttribute(mapNode, "src") if mapSrc and mapSrc:find("%.map$") then hasMapFile = true end end -- Check for #gamemodes setting local settingsNode = xmlFindChild(metaFile, "settings", 0) if settingsNode then local settingNodes = xmlNodeGetChildren(settingsNode) for j, setting in ipairs(settingNodes) do local settingName = xmlNodeGetAttribute(setting, "name") local settingValue = xmlNodeGetAttribute(setting, "value") if settingName == "#gamemodes" then gamemodesValue = settingValue -- Parse the gamemodes value (e.g., '[ "race" ]' or '[ "race", "assault" ]') local gamemodes = settingValue:gsub("%[", ""):gsub("%]", ""):gsub('"', ""):gsub(" ", "") local gamemodeList = split(gamemodes, ",") if #gamemodeList == 1 and gamemodeList[1]:lower() == "race" then isRaceMap = true end break end end end -- If no #gamemodes setting, assume it's a race map if the name suggests it if hasMapFile and not gamemodesValue then if resName:find("^%[race%]") or resName:find("race-") then isRaceMap = true end end -- Include or exclude the map if hasMapFile and isRaceMap then includedCount = includedCount + 1 local mapInfo = { resourceName = resName, -- Store the actual resource name name = resName, -- Default to resource name author = "Unknown", cost = math.random(300, 1000) -- Random cost } if infoNode then local author = xmlNodeGetAttribute(infoNode, "author") local name = xmlNodeGetAttribute(infoNode, "name") if author then mapInfo.author = author end if name then mapInfo.name = name end end table.insert(mapList, mapInfo) else excludedCount = excludedCount + 1 end end xmlUnloadFile(metaFile) else excludedCount = excludedCount + 1 end else excludedCount = excludedCount + 1 end end outputDebugString("INFO: Total race maps found: " .. #mapList .. " (Included: " .. includedCount .. ", Excluded: " .. excludedCount .. ")", 3) return mapList end -- Send map list and player money to client addEvent("requestMapList", true) addEventHandler("requestMapList", root, function() local mapList = getMapList() local player = source local money = getElementData(player, "money") or 0 triggerClientEvent(player, "receiveMapList", player, mapList) triggerClientEvent(player, "receivePlayerMoney", player, money) end) -- Send player money to client addEvent("requestPlayerMoney", true) addEventHandler("requestPlayerMoney", root, function() local player = source local money = getElementData(player, "money") or 0 triggerClientEvent(player, "receivePlayerMoney", player, money) end) -- Function to set the next map function setNextMapIfPossible(mapResource, mapDisplayName, player) local raceResource = getResourceFromName("race") outputDebugString("DEBUG: Attempting to set next map to " .. getResourceName(mapResource) .. " for player " .. getPlayerName(player), 3) if raceResource and getResourceState(raceResource) == "running" then outputDebugString("DEBUG: Race resource is running, calling queueNextMap", 3) local success, errorMsg = pcall(function() return exports.race:queueNextMap(mapResource) -- Updated to queueNextMap end) if success and errorMsg then outputDebugString("DEBUG: Successfully queued next map to " .. getResourceName(mapResource) .. " for player " .. getPlayerName(player), 3) outputChatBox(getPlayerName(player) .. " has queued the next map to '" .. mapDisplayName .. "'!", root, 255, 255, 0) nextMapQueue = nil -- Clear the queue since the map was set return true else outputDebugString("DEBUG: Failed to queue next map to " .. getResourceName(mapResource) .. " - queueNextMap failed: " .. (errorMsg or "unknown error"), 1) outputChatBox("Failed to queue the next map (queueNextMap failed). Please try again.", player, 255, 0, 0) return false end else outputDebugString("DEBUG: Race resource not running (state: " .. (raceResource and getResourceState(raceResource) or "not found") .. "). Queuing map " .. getResourceName(mapResource), 1) nextMapQueue = { resource = mapResource, displayName = mapDisplayName, player = player } outputChatBox("Race gamemode not running. Your map '" .. mapDisplayName .. "' will be set as the next map when the gamemode starts.", player, 255, 255, 0) return false end end -- Handle map purchase and set as next map addEvent("onPlayerBuyMap", true) addEventHandler("onPlayerBuyMap", root, function(mapResourceName, mapDisplayName, cost) local player = source local money = getElementData(player, "money") or 0 if money >= cost then setElementData(player, "money", money - cost) savePlayerMoney(player) -- Set the purchased map as the next map local mapResource = getResourceFromName(mapResourceName) if mapResource then setNextMapIfPossible(mapResource, mapDisplayName, player) else outputDebugString("DEBUG: Map resource " .. mapResourceName .. " not found for player " .. getPlayerName(player), 1) outputChatBox("Map resource not found. Please try again.", player, 255, 0, 0) end triggerClientEvent(player, "onMapPurchaseSuccess", player, mapDisplayName) outputChatBox("You now have $" .. (money - cost), player, 0, 255, 0) else triggerClientEvent(player, "onMapPurchaseFail", player) end end) -- Try to set the queued map when the race gamemode starts addEventHandler("onResourceStart", root, function(startedResource) local resourceName = getResourceName(startedResource) if resourceName == "race" and nextMapQueue then outputDebugString("DEBUG: Race resource started. Attempting to set queued map " .. getResourceName(nextMapQueue.resource), 3) setNextMapIfPossible(nextMapQueue.resource, nextMapQueue.displayName, nextMapQueue.player) end end) -- Try to set the queued map when the current map ends addEvent("onRaceEnd", true) addEventHandler("onRaceEnd", root, function(winner) outputDebugString("DEBUG: onRaceEnd triggered with winner " .. getPlayerName(winner), 3) local player = winner local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) -- Try to set the queued map if it exists if nextMapQueue then outputDebugString("DEBUG: Race ended. Attempting to set queued map " .. getResourceName(nextMapQueue.resource), 3) setNextMapIfPossible(nextMapQueue.resource, nextMapQueue.displayName, nextMapQueue.player) end end) -- Handle race win detected by client addEvent("onClientPlayerRaceWin", true) addEventHandler("onClientPlayerRaceWin", root, function() outputDebugString("DEBUG: onClientPlayerRaceWin triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Hook into possible race gamemode events (for debugging) addEvent("onPlayerFinish", true) addEventHandler("onPlayerFinish", root, function(rank) outputDebugString("DEBUG: onPlayerFinish triggered for " .. getPlayerName(source) .. " with rank " .. rank, 3) if rank == 1 then local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end end) addEvent("onPlayerWin", true) addEventHandler("onPlayerWin", root, function() outputDebugString("DEBUG: onPlayerWin triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) addEvent("onPlayerRaceFinish", true) addEventHandler("onPlayerRaceFinish", root, function(rank) outputDebugString("DEBUG: onPlayerRaceFinish triggered for " .. getPlayerName(source) .. " with rank " .. rank, 3) if rank == 1 then local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end end) addEvent("onPlayerVictory", true) addEventHandler("onPlayerVictory", root, function() outputDebugString("DEBUG: onPlayerVictory triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) addEvent("onPlayerWinDD", true) addEventHandler("onPlayerWinDD", root, function() outputDebugString("DEBUG: onPlayerWinDD triggered for " .. getPlayerName(source), 3) local player = source local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Debug command to simulate a race win (admin only) addCommandHandler("winrace", function(player) if not hasObjectPermissionTo(player, "general.adminpanel") then outputChatBox("You do not have permission to use this command!", player, 255, 0, 0) return end outputDebugString("DEBUG: Simulating race win for " .. getPlayerName(player), 3) local money = getElementData(player, "money") or 0 local reward = 1000 setElementData(player, "money", money + reward) savePlayerMoney(player) outputChatBox("You won the race and earned $" .. reward .. "! Total: $" .. (money + reward), player, 0, 255, 0) triggerClientEvent(player, "receivePlayerMoney", player, money + reward) end) -- Debug command to check money addCommandHandler("money", function(player) local money = getElementData(player, "money") or 0 outputChatBox("Your money: $" .. money, player, 255, 255, 0) end) client.lua local screenW, screenH = guiGetScreenSize() local mapPanelVisible = false local selectedMap = nil local maps = {} local playerMoney = 0 -- Create the map panel GUI function createMapPanel() if mapPanelVisible then return end mapPanelWindow = guiCreateWindow((screenW - 400) / 2, (screenH - 300) / 2, 400, 300, "Map Panel", false) guiWindowSetSizable(mapPanelWindow, false) mapGrid = guiCreateGridList(10, 30, 380, 150, false, mapPanelWindow) guiGridListAddColumn(mapGrid, "Map Name", 0.5) guiGridListAddColumn(mapGrid, "Author", 0.3) guiGridListAddColumn(mapGrid, "Cost", 0.2) for i, map in ipairs(maps) do local row = guiGridListAddRow(mapGrid) guiGridListSetItemText(mapGrid, row, 1, map.name, false, false) guiGridListSetItemText(mapGrid, row, 2, map.author or "Unknown", false, false) guiGridListSetItemText(mapGrid, row, 3, tostring(map.cost), false, false) end moneyLabel = guiCreateLabel(10, 190, 380, 20, "Your Money: $" .. playerMoney, false, mapPanelWindow) infoLabel = guiCreateLabel(10, 210, 380, 20, "Select a map to see details.", false, mapPanelWindow) buyButton = guiCreateButton(10, 230, 180, 30, "Buy Map", false, mapPanelWindow) quitButton = guiCreateButton(200, 230, 180, 30, "Quit", false, mapPanelWindow) addEventHandler("onClientGUIClick", mapGrid, onMapSelect, false) addEventHandler("onClientGUIClick", buyButton, buyMap, false) addEventHandler("onClientGUIClick", quitButton, closeMapPanel, false) mapPanelVisible = true showCursor(true) -- Show the cursor when the panel opens if #maps == 0 then outputChatBox("No maps found on the server!", 255, 0, 0) end end -- Handle map selection function onMapSelect() local row = guiGridListGetSelectedItem(mapGrid) if row ~= -1 then selectedMap = maps[row + 1] guiSetText(infoLabel, "Name: " .. selectedMap.name .. " | Author: " .. (selectedMap.author or "Unknown") .. " | Cost: $" .. selectedMap.cost) end end -- Buy the selected map function buyMap() if not selectedMap then outputChatBox("Please select a map first!", 255, 0, 0) return end triggerServerEvent("onPlayerBuyMap", localPlayer, selectedMap.resourceName, selectedMap.name, selectedMap.cost) end -- Close the panel function closeMapPanel() if mapPanelWindow then destroyElement(mapPanelWindow) mapPanelVisible = false selectedMap = nil showCursor(false) -- Hide the cursor when the panel closes end end -- Toggle the map panel with F3 addEventHandler("onClientResourceStart", resourceRoot, function() bindKey("f3", "down", function() if mapPanelVisible then closeMapPanel() else triggerServerEvent("requestMapList", localPlayer) end end) setTimer(function() outputChatBox("Press F3 to open the Map Panel!", 255, 255, 0) end, 5000, 1) end) -- Receive map list from server addEvent("receiveMapList", true) addEventHandler("receiveMapList", root, function(mapList) maps = mapList outputChatBox("Received " .. #maps .. " maps from server.", 0, 255, 0) createMapPanel() end) -- Receive player money from server addEvent("receivePlayerMoney", true) addEventHandler("receivePlayerMoney", root, function(money) playerMoney = money if moneyLabel and isElement(moneyLabel) then guiSetText(moneyLabel, "Your Money: $" .. playerMoney) end end) -- Handle successful purchase response from server addEvent("onMapPurchaseSuccess", true) addEventHandler("onMapPurchaseSuccess", root, function(mapDisplayName) outputChatBox("Map '" .. mapDisplayName .. "' purchased successfully and set as the next map!", 0, 255, 0) triggerServerEvent("requestPlayerMoney", localPlayer) closeMapPanel() end) -- Handle insufficient funds addEvent("onMapPurchaseFail", true) addEventHandler("onMapPurchaseFail", root, function() outputChatBox("Not enough money to buy this map!", 255, 0, 0) end) -- Detect "You have won the race!" message addEventHandler("onClientChatMessage", root, function(message) if message == "You have won the race!" then triggerServerEvent("onClientPlayerRaceWin", localPlayer) end end) It also creates money.xml which stores money, and I tried AI to understand that I wanted to pick up the money from the users account (when you add it via admin panel for example) but I couldn't. I'm also wondering if you guys could make this script better anyhow? I recommend debugscript 3 too Thanks for any help.
-
hola vengo en busca de ayuda ya que necesito editar el freeroam, y no se como puedo editar los botones de este, me refiero a editar su tamaño y posición, se que esto se edita en el fr_client.lua pero no se como, alguien me puede ayudar por favor?
-
¡Hola, tiempo sin pasarme por este foro! En esta oportunidad, vengo a vender un... SISTEMA DE DESCARGAS EN SEGUNDO PLANO + SISTEMA DE ENCRIPTACION DE ARCHIVOS Tal y como lo dice su nombre, estoy vendiendo un sistema de descarga de archivos en segundo plano, el cual incluye un sistema de encriptación para mantener los archivos protegidos en el cache y que estos no puedan ser extraídos o robados. ¿PORQUE COMPRAR ESTE SCRIPT? ♦ COMODIDAD: Para brindarle una mayor comodidad a la hora de descargar archivos a los usuarios, ya que el sistema descarga e instala los archivos que se le especifiquen, de forma automatizada mientras el usuario se encuentra jugando tranquilamente en el servidor. ♦ SEGURIDAD: El sistema descarga los archivos y los encripta a través de una clave la cual puede ser cambiada a voluntad dentro del propio código para mayor personalización en la encriptación. En ningún momento, el usuario contará con el archivo desencriptado en su cache, debido a que la información se desencripta solo para ser utilizada a nivel de código. El archivo se mantendrá siempre encriptado para el usuario. CARACTERISTICAS DEL SCRIPT ♦ METODO DE DESCARGA FRAGMENTADO: El sistema, para mayor optimización a la hora de descargar archivos de gran tamaño, divide el archivo en 10-12 partes, las cuales descarga una a una. Y al momento de tener todas las partes descargadas, las une todas para crear el archivo en cuestión. Esto, para que los usuarios no experimentaran problemas de lag al momento de descargar archivos de gran tamaño. En su lugar, descargarán el archivo en partes pequeñas para que de esta forma no haya caídas. ♦ METODO DE ENCRIPTACIÓN: Como bien mencioné antes, el sistema cuenta con un sistema de encriptación, en donde, encriptará los archivos que se le especifiquen al sistema y estos se guardarán en el cache encriptados. Estos nunca se desencriptarán para ser utilizados. En su defecto, el sistema desencriptará solo la información de los archivos a nivel de código, para que los archivos en ningún momento sean desencriptados ♦ UTILIZACIÓN DE ARCHIVOS DE MANERA GLOBAL: Si deseas utilizar un archivo descargado a través de este script, ya sea una skin (txd/dff), objeto (txd/dff/col) o una textura (png), podrás obtener dichos datos a través de una función para ser utilizada en cualquier script de terceros en donde consideres necesario. De esta manera, si necesitas colocar en este script las imágenes que utilizan otros scripts, podrás hacerlo tranquilamente (obviamente, revisando que los archivos estén previamente descargados y disponibles antes de eso) ♦ VERIFICACIÓN DE LA INTEGRIDAD DE LOS ARCHIVOS: Con el fin de evitar la modificación clandestina de algunos archivos dentro del script, al momento de iniciarse o al momento que un jugador entra al servidor, el sistema verifica archivo a archivo, que la integridad de estos no se haya visto afectada. Es decir, verifica que los archivos en el caché sean exactamente los mismos que se encuentran en el servidor. Si un archivo se encuentra afectado, el sistema lo borra y descarga nuevamente, con el fin de evitar modificaciones a los archivos caché del script. ♦ OPORTUNIDAD PARA INTERFAZ PERSONALIZADA: El script NO cuenta con una interfaz de barra de descarga ni nada por el estilo, mas allá de un texto ubicado debajo del radar, donde se especifica el archivo que se está descargando y el % de la descarga. Sin embargo, en el código, se puede especificar un nombre y una descripción a cada archivo individualmente, el cual puede ser utilizado, o bien para informar a otros usuarios que manipulen este código, el saber para que es cada archivo, o bien, añadirle por su cuenta una barra de descarga que contenga dicha información para notificarle al usuario que está descargando. No se colocó ningún diseño para dejar la ventana abierta a cualquier personalización. El código está enfocado mas en la descarga y encriptación, no en el diseño como tal. FORMATO DE ARCHIVOS SOPORTADOS: TXD DFF COL PNG ¿QUE INCLUYE EL SCRIPT? El script. (duh) Un skin de personaje (ID: 217) y vehículo (ID: 402), para ejemplificar su uso Un skin de un objeto (Reemplazo directo al mapa del juego), para ejemplificar su uso (en el script aparecen las coordenadas del mapa modificado) Una textura (png, reemplazo directo al mapa del juego), para ejemplificar su uso (en el script aparecen las coordenadas de la textura modificada) Garantía de soporte gratuito sobre cualquier bug/fallo encontrado en el sistema durante 48hrs luego de la compra (esto no incluye bugs creados por modificar el sistema por su cuenta) PRECIO DEL PRODUCTO El precio de dicho sistema, es de 5.00$ (negociable, pero tampoco regalo) METODOS DE PAGO DISPONIBLES Binance (USDT) (sin comisiones) PayPal (USD) +5.4% +0.30$ adicionales por comisiones (5.61$) DISCLAIMER #1: Si eres de VENEZUELA, se pueden ampliar los métodos de pago a los nacionales. El monto sería el mismo, a la tasa del día de compra, del DOLAR PROMEDIO. DISCLAIMER #2: Si deseas hacerle modificaciones al mod para hacerlo mas "personal" a tu servidor, se puede cobrar un EXTRA por dichas modificaciones. DISCLAIMER #3: Si te sales de la garantía, por modificar el recurso por tu cuenta, cualquier arreglo/modificación tendrá un coste adicional. DISCLAIMER #4: Si te sales de la garantía, por pasar el plazo de 48hrs para reportar un bug, cualquier arreglo/modificación PODRÍA TENER un coste adicional (en la mayoría de los casos no cobro) METODOS DE CONTACTO Por mensaje privado (no recomendado, ya que no frecuento este lugar) Discord: !Sergiioks#4818 Mis métodos de contacto también están abiertos a cualquier otra petición de scripts, ya que, aunque no suelo tener una amplia disponibilidad, si la tengo, estaré dispuesto a echarte una mano, por un módico precio. IMAGENES DEL RECURSO Debido a que, reitero, el script es mayormente funcionalidad de código que diseño, mostraré los avisos del debugscript y el texto notificando la descarga de los archivos Sin nada mas que añadir, fue un gusto volver a pasarme por acá. Cualquier duda relacionada con el recurso o demás, puedes dejar un comentario o comunicarte conmigo por las vías de contacto especificadas. ¡Un saludo!
- 1 reply
-
- downloader
- sell
-
(and 1 more)
Tagged with:
-
hello, I would like to ask if it is possible to make a script in mta for infinite skin id and vehicles, I saw it with one person on the server who has several hundred skins for skin cj I will be happy for every message
-
Ola, sou novo no mundo do script de mta, gostaria de algumas dicas para aprender a programar scripts para o game, se puderem me dar dicas e sugestões de como aprender eu agradeço.
-
o mod tava funcionando normalmente ate que uma hr ficou com letras e símbolos aleatórios no painel ja tentei troca , ou substituir e fica no mesmo
- 1 reply
-
- lua
- concessionaria
-
(and 2 more)
Tagged with:
-
hello ive been trying to make a weapon attachment mode for mta sa problems that ive encountred the silencer does not silence (lol) flashlight illuminates the player not infront of him the attachments stay stuck to the player even when switching weapons until i remove them from the menu https://ibb.co/q3CgPG7d and the laser works fine dont worry lol can you help me ? heres the client, server and meta -- Client-side weapon attachments management local screenW, screenH = guiGetScreenSize() local ATTACHMENT_MODELS = { silencer = 348, flashlight = 349, laser = 350 } -- Sound ranges for different weapons when suppressed local SOUND_RANGES = { [22] = { suppressed = 20 }, -- Pistol [23] = { suppressed = 25 }, -- Silenced Pistol [24] = { suppressed = 30 }, -- Desert Eagle [25] = { suppressed = 35 }, -- Shotgun [29] = { suppressed = 40 }, -- MP5 [30] = { suppressed = 45 }, -- AK-47 [31] = { suppressed = 45 } -- M4 } -- Track active attachments and effects local activeAttachments = {} local activeEffects = {} -- GUI elements local gui = { window = nil, buttons = {} } -- Attachment positions and rotations local attachmentConfig = { silencer = { pos = {x = 0.2, y = 0, z = 0.02}, rot = {x = 0, y = 90, z = 0}, scale = {x = 1.0, y = 1.0, z = 1.0} }, flashlight = { pos = {x = 0.15, y = 0.05, z = 0.02}, rot = {x = 0, y = 90, z = 0}, scale = {x = 0.8, y = 0.8, z = 0.8} }, laser = { pos = {x = 0.15, y = -0.05, z = 0.02}, rot = {x = 0, y = 90, z = 0}, scale = {x = 0.8, y = 0.8, z = 0.8} } } -- Create attachment menu function createAttachmentMenu() if gui.window then destroyElement(gui.window) end gui.window = guiCreateWindow(screenW/2-150, screenH/2-200, 300, 400, "Weapon Attachments", false) local y = 30 for _, attachment in ipairs({"silencer", "flashlight", "laser"}) do -- Attach button gui.buttons[attachment.."_attach"] = guiCreateButton(10, y, 135, 30, "Attach "..attachment, false, gui.window) addEventHandler("onClientGUIClick", gui.buttons[attachment.."_attach"], function() triggerServerEvent("onRequestAttachment", localPlayer, attachment) end, false) -- Remove button gui.buttons[attachment.."_remove"] = guiCreateButton(155, y, 135, 30, "Remove "..attachment, false, gui.window) addEventHandler("onClientGUIClick", gui.buttons[attachment.."_remove"], function() triggerServerEvent("onRequestRemoveAttachment", localPlayer, attachment) end, false) y = y + 40 end -- Close button local closeButton = guiCreateButton(10, 360, 280, 30, "Close", false, gui.window) addEventHandler("onClientGUIClick", closeButton, function() destroyElement(gui.window) gui.window = nil end, false) showCursor(true) end -- Handle attachment updates addEvent("onAttachmentUpdate", true) addEventHandler("onAttachmentUpdate", root, function(player, attachmentType, attached) if attached then createAttachment(player, attachmentType) else removeAttachment(player, attachmentType) end end) -- Handle silenced weapon fire addEvent("onSilencedWeaponFire", true) addEventHandler("onSilencedWeaponFire", root, function(x, y, z, weaponId) -- Play suppressed shot sound local sound = playSound3D("files/silenced_shot.wav", x, y, z) if sound then -- Calculate volume based on distance local px, py, pz = getElementPosition(localPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, px, py, pz) local maxRange = SOUND_RANGES[weaponId].suppressed local volume = 1 - (distance / maxRange) setSoundVolume(sound, math.max(0.1, volume)) setSoundMaxDistance(sound, maxRange) end -- Create subtle muzzle flash effect local effect = createEffect("gunflash", x, y, z) if effect then setEffectSpeed(effect, 0.5) -- Reduce the effect intensity setTimer(destroyElement, 50, 1, effect) end end) -- Handle weapon switch for silenced weapons addEventHandler("onClientPlayerWeaponSwitch", root, function(prevSlot, newSlot) if source == localPlayer then local weaponId = getPedWeapon(localPlayer, newSlot) if activeAttachments[localPlayer] and activeAttachments[localPlayer].silencer then -- Update weapon properties for silenced weapon local x, y, z = getElementPosition(localPlayer) triggerServerEvent("onPlayerSilencedWeaponSwitch", localPlayer, weaponId) end end end) -- Create physical attachment function createAttachment(player, attachmentType) if not isElement(player) then return end -- Remove existing attachment removeAttachment(player, attachmentType) -- Create attachment object local obj = createObject(ATTACHMENT_MODELS[attachmentType], 0, 0, 0) if not obj then return end -- Configure attachment local config = attachmentConfig[attachmentType] setObjectScale(obj, config.scale.x, config.scale.y, config.scale.z) -- Attach to weapon exports.bone_attach:attachElementToBone(obj, player, 12, config.pos.x, config.pos.y, config.pos.z, config.rot.x, config.rot.y, config.rot.z ) -- Store attachment if not activeAttachments[player] then activeAttachments[player] = {} end activeAttachments[player][attachmentType] = obj -- Create effects if attachmentType == "flashlight" then createFlashlightEffect(player) elseif attachmentType == "laser" then createLaserEffect(player) end end -- Create flashlight effect function createFlashlightEffect(player) if not activeAttachments[player] or not activeAttachments[player].flashlight then return end local function updateLight() if not isElement(player) or not activeAttachments[player] or not activeAttachments[player].flashlight then removeEventHandler("onClientRender", root, updateLight) return end local weaponSlot = getPedWeaponSlot(player) if weaponSlot < 2 or weaponSlot > 7 then return end local x, y, z = getPedWeaponMuzzlePosition(player) local tx, ty, tz = getPedTargetEnd(player) -- Create light effect local light = createLight(0, x, y, z, 10, 255, 255, 255) setLightDirection(light, tx-x, ty-y, tz-z) -- Clean up previous frame's light setTimer(function() if isElement(light) then destroyElement(light) end end, 50, 1) end addEventHandler("onClientRender", root, updateLight) end -- Create laser effect function createLaserEffect(player) if not activeAttachments[player] or not activeAttachments[player].laser then return end local function updateLaser() if not isElement(player) or not activeAttachments[player] or not activeAttachments[player].laser then removeEventHandler("onClientRender", root, updateLaser) return end local weaponSlot = getPedWeaponSlot(player) if weaponSlot < 2 or weaponSlot > 7 then return end local x, y, z = getPedWeaponMuzzlePosition(player) local tx, ty, tz = getPedTargetEnd(player) -- Draw laser line dxDrawLine3D(x, y, z, tx, ty, tz, tocolor(255, 0, 0, 150), 1) end addEventHandler("onClientRender", root, updateLaser) end -- Remove attachment function removeAttachment(player, attachmentType) if not activeAttachments[player] or not activeAttachments[player][attachmentType] then return end if isElement(activeAttachments[player][attachmentType]) then destroyElement(activeAttachments[player][attachmentType]) end activeAttachments[player][attachmentType] = nil end -- Command to open menu addCommandHandler("attachments", createAttachmentMenu) -- Clean up on player quit addEventHandler("onClientPlayerQuit", root, function() if activeAttachments[source] then for attachmentType, _ in pairs(activeAttachments[source]) do removeAttachment(source, attachmentType) end activeAttachments[source] = nil end end) server code -- Server-side weapon attachments management -- Constants local WEAPON_IDS = { PISTOL_9MM = 22, SILENCED_PISTOL = 23, MP5 = 29, AK47 = 30, M4 = 31, SNIPER = 34 } -- Sound range configurations local SOUND_RANGES = { [WEAPON_IDS.PISTOL_9MM] = { normal = 100, suppressed = 20 }, [WEAPON_IDS.MP5] = { normal = 120, suppressed = 25 }, [WEAPON_IDS.AK47] = { normal = 150, suppressed = 30 }, [WEAPON_IDS.M4] = { normal = 150, suppressed = 30 }, [WEAPON_IDS.SNIPER] = { normal = 200, suppressed = 40 } } -- Track player attachments and weapon states local playerAttachments = {} local silencedWeapons = {} -- Initialize player data addEventHandler("onPlayerJoin", root, function() playerAttachments[source] = {} silencedWeapons[source] = {} end) -- Cleanup on quit addEventHandler("onPlayerQuit", root, function() playerAttachments[source] = nil silencedWeapons[source] = nil end) -- Handle silenced weapon fire addEventHandler("onPlayerWeaponFire", root, function(weapon) if silencedWeapons[source] and silencedWeapons[source][weapon] then local x, y, z = getElementPosition(source) -- Get nearby players local nearbyPlayers = getElementsWithinRange(x, y, z, SOUND_RANGES[weapon].normal, "player") -- Handle silenced shot effects for _, player in ipairs(nearbyPlayers) do if player ~= source then local px, py, pz = getElementPosition(player) local distance = getDistanceBetweenPoints3D(x, y, z, px, py, pz) if distance <= SOUND_RANGES[weapon].suppressed then triggerClientEvent(player, "onSilencedWeaponFire", source, x, y, z, weapon) end end end end end) -- Handle attachment requests addEvent("onRequestAttachment", true) addEventHandler("onRequestAttachment", root, function(attachmentType) local weaponId = getPedWeapon(client) if not isWeaponCompatible(weaponId, attachmentType) then outputChatBox("This attachment is not compatible with your weapon.", client, 255, 0, 0) return end if not playerAttachments[client] then playerAttachments[client] = {} end -- Remove existing attachment if present if playerAttachments[client][attachmentType] then removeAttachment(client, attachmentType) end -- Apply new attachment playerAttachments[client][attachmentType] = true -- Special handling for silencer if attachmentType == "silencer" then if not silencedWeapons[client] then silencedWeapons[client] = {} end silencedWeapons[client][weaponId] = true -- Apply silencer properties setWeaponProperty(weaponId, "pro", "weapon_range", SOUND_RANGES[weaponId].suppressed) setWeaponProperty(weaponId, "pro", "flags_aim", true) setWeaponProperty(weaponId, "std", "fire_rotation", 0.0) end triggerClientEvent(root, "onAttachmentUpdate", client, client, attachmentType, true, weaponId) end) -- Handle attachment removal addEvent("onRequestRemoveAttachment", true) addEventHandler("onRequestRemoveAttachment", root, function(attachmentType) if removeAttachment(client, attachmentType) then outputChatBox("Attachment removed successfully.", client, 0, 255, 0) end end) -- Remove attachment function function removeAttachment(player, attachmentType) if not playerAttachments[player] or not playerAttachments[player][attachmentType] then return false end local weaponId = getPedWeapon(player) if attachmentType == "silencer" and silencedWeapons[player] then silencedWeapons[player][weaponId] = nil -- Reset weapon properties setWeaponProperty(weaponId, "pro", "weapon_range", SOUND_RANGES[weaponId].normal) setWeaponProperty(weaponId, "pro", "flags_aim", false) setWeaponProperty(weaponId, "pro", "maximum_clip_ammo", 17) setWeaponProperty(weaponId, "std", "fire_rotation", 1.0) end playerAttachments[player][attachmentType] = nil triggerClientEvent(root, "onAttachmentUpdate", player, player, attachmentType, false, weaponId) return true end -- Utility function for weapon compatibility function isWeaponCompatible(weaponId, attachmentType) local compatibleWeapons = { silencer = { [WEAPON_IDS.PISTOL_9MM] = true, [WEAPON_IDS.MP5] = true, [WEAPON_IDS.M4] = true }, flashlight = { [WEAPON_IDS.PISTOL_9MM] = true, [WEAPON_IDS.MP5] = true, [WEAPON_IDS.AK47] = true, [WEAPON_IDS.M4] = true, [WEAPON_IDS.SNIPER] = true }, laser = { [WEAPON_IDS.PISTOL_9MM] = true, [WEAPON_IDS.MP5] = true, [WEAPON_IDS.AK47] = true, [WEAPON_IDS.M4] = true, [WEAPON_IDS.SNIPER] = true } } return compatibleWeapons[attachmentType] and compatibleWeapons[attachmentType][weaponId] end heres the meta <meta> <info author="Weapon Attachments System" version="1.0.0" type="script"/> <!-- Client Scripts --> <script src="attachmentc.lua" type="client" cache="false"/> <!-- Server Scripts --> <script src="attachments.lua" type="server"/> <!-- Files --> <file src="files/silenced_shot.wav"/> <file src="files/flashlight.png"/> <file src="files/laser.png"/> <!-- Required Resources --> <include resource="bone_attach"/> <!-- Exports --> <export function="attachWeaponMod" type="server"/> <export function="removeWeaponMod" type="server"/> </meta>
-
- weapon system
- script
-
(and 1 more)
Tagged with:
-
Olá alguém pode me ajudar a colocar essa função para se ativa por bindkey elseif getElementModel(source) == 523 then --ID DO CARRO/VTR - addVehicleSirens(source,15,5, true, false, true, true) - setVehicleSirens(source, 1, 0.45, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 2, 0.45, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 3, 0.3, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 4, 0.1, 0.05, 2.2, 255, 165, 250, 250, 250.0) - setVehicleSirens(source, 5, -0.3, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 6, -0.45, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 7, -0.6, 0.05, 2.2, 255, 165, 0, 255, 255.0) - setVehicleSirens(source, 16, -0.1, 0.05, 1.2, 255, 165, 0, 255, 255.0)
-
como faço para colocar esse script de portão automático dentro de um interior/dimensão local gate = createObject(16775, 246, 72.599609375, 1004.799987793, 0, 0, 0) local marker = createMarker(246, 72.599609375, 1004.799987793, "cylinder", 8, 0, 0, 0, 0) function moveGate(thePlayer) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then moveObject(gate, 3000, 246, 72.599609375, 1004.799987793) end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 3000, 246, 72.599609375, 1007.2) end addEventHandler("onMarkerLeave", marker, move_back_gate)
-
Let's talk script security. It might be a taboo topic for some but it shouldn't, at all. In fact, the more people talk about this and unite to discuss and create robust, safe and well-coded scripts, the better the MTA resource development community will be. Rules: Main article: https://wiki.multitheftauto.com/wiki/Script_security The key points are there, but the code examples don't suffice, and the implementations will vary depending on the gamemode and resources. Pinned information: Coming soon Notes: - I'm not perfect and everyone makes mistakes. Please correct me when I'm wrong. - Eventually if this becomes a popular topic, I am willing to incorporate translations of certain explanations into other languages in this OP, as I know a majority of the MTA community doesn't master the English language and prefers to communicate and read in other languages.
-
I have designed a Snake game in my Multi Theft Auto project using the Lua programming language, implementing all functionalities and dynamics. Additionally, I have designed the controls to be very functional, allowing gameplay with either a keyboard or Xbox/PlayStation controllers. Here’s a link for you to watch.
-
Hello dear forum members, I am deeply interested in a persistent question regarding my shader for the effect of raindrops flowing down the sides of the car, as well as the effect of raindrops (spots) on the surface of the car (roof, bumper). I’ve been struggling with these issues for a long time and still can’t figure out how to solve my two problems. I hope someone can help me and explain to a beginner in HLSL how to properly implement the shader. The first problem is that I don’t understand how to make the raindrops flow down the different sides of the car. Essentially, I have a single texture applied to the car, and I can't figure out how to split it into multiple segments and adapt it to flow around the sides of the car. (I also need to account for the unique features of each car model so that the flow looks realistic on each vehicle.) The second problem is the effect of tiny raindrops on the roof, hood, and bumper of the car (the generation of small droplets that gradually appear and disappear). The issue is that I’m trying to apply both effects in one shader, but the problem is that either only one of them works under certain settings, or nothing works at all. I can't get both effects to work harmoniously together. I’ll also provide an example of the Lua script and the textures used for the shader. I really hope for your help. I've been spending too much time on this, and I can't seem to find a solution. float4x4 gWorld : WORLD; float4x4 gView : VIEW; float4x4 gProjection : PROJECTION; float gTime : TIME; // Rain parameters float gDropSpeed = 0.03; // Speed of droplet flow float2 noiseScale = float2(0.2, 0.8); // Noise texture scale float3 lightDirection = float3(1.0, 1.0, -1.0); // Light direction float gDropSpread = 0.3; // Droplet spread float gDropDepth = 0.3; // Droplet depth texture gTexture; // Main car texture texture texRain; // Raindrop texture texture texNormalRain; // Raindrop normals texture texNoise; // Noise texture // Variables for controlling the effect float gAlpha = 0.01; // Alpha channel for the car float rainAlpha = 1.8; // Alpha channel for raindrops sampler2D gTextureSampler = sampler_state { Texture = ( gTexture ); MinFilter = Linear; MagFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; sampler2D texRainSampler = sampler_state { Texture = ( texRain ); MinFilter = Linear; MagFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; sampler2D texNormalRainSampler = sampler_state { Texture = ( texNormalRain ); MinFilter = Linear; MagFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; sampler2D texNoiseSampler = sampler_state { Texture = ( texNoise ); MinFilter = Linear; MagFilter = Linear; AddressU = Wrap; AddressV = Wrap; }; struct VertexShaderInput { float4 Position : POSITION; // Using standard POSITION semantics for the vertex shader float2 TextureCoordinate : TEXCOORD0; // Passing texture coordinates }; struct PixelShaderInput { float4 Position : POSITION; // Passing position as float4 for proper operation float3 WorldPos : TEXCOORD1; // Passing world coordinates for calculations float2 TextureCoordinate : TEXCOORD0; // Passing texture coordinates }; PixelShaderInput VertexShaderFunction(VertexShaderInput input) { PixelShaderInput output; // Position in world coordinates float4 worldPos = mul(input.Position, gWorld); // Storing position for further projection output.Position = mul(mul(input.Position, gWorld), gView); output.Position = mul(output.Position, gProjection); // Applying projection // Storing world coordinates (for droplet flow) output.WorldPos = worldPos.xyz; // Passing texture coordinates output.TextureCoordinate = input.TextureCoordinate; return output; } float4 PixelShaderFunction(PixelShaderInput output) : COLOR0 { float2 textureCoordinate = output.TextureCoordinate; // Main car texture float4 baseColor = tex2D(gTextureSampler, textureCoordinate); baseColor.rgb = max(baseColor.rgb, 0.1); // Brightening dark areas // Getting noise for random movement float noise = tex2D(texNoiseSampler, textureCoordinate * noiseScale).r; // World coordinates to determine droplet direction float3 worldPos = output.WorldPos; // Using world coordinates // Determining droplet direction based on normals and world position float3 normal = normalize(output.WorldPos); // Normal to the surface // Checking direction by normals to determine which side of the car we're on if (abs(normal.x) > abs(normal.y) && abs(normal.x) > abs(normal.z)) { // Side surfaces textureCoordinate.y += gDropSpeed * gTime; // Flowing down the sides } else if (normal.y > 0.5) { // Top surface (roof) textureCoordinate.y -= gDropSpeed * gTime; // Droplets flow down } else { // Other sides (front and back) textureCoordinate.x -= gDropSpeed * gTime; // Optionally add droplet flow forward/backward } // Reducing random offset for more precise flow float2 offset = gDropSpread * (noise * 4.0 - 0.5) * float2(1.0, 2.5); // Using float2 for offset textureCoordinate -= offset; // Applying deviation in both axes // Raindrop texture float4 rainColor = tex2D(texRainSampler, textureCoordinate); // Adjusting droplets to the car color rainColor.rgb = baseColor.rgb * 0.8 + float3(0.1, 0.1, 0.1); // Adding body tint to droplets rainColor.a = rainAlpha; // Alpha channel of droplets // Normals for droplets float4 tempRainNormal = tex2D(texNormalRainSampler, textureCoordinate); // Explicitly using float4 float3 rainNormal = normalize(tempRainNormal.rgb * 2.5 - 0.75); // Normalizing normals // Lighting on droplets float diffuse = saturate(dot(normalize(rainNormal), normalize(lightDirection))); // Correct lighting // Combining colors float4 finalColor = lerp(baseColor, rainColor, rainAlpha * diffuse); finalColor.a = lerp(gAlpha, rainAlpha, diffuse * 0.9); // Adding droplet depth finalColor.rgb += gDropDepth * 0.9; // Depth effect of droplets float3 v = float3(0.0, 0.0, 0.0); float Tr2 = gTime * 11000.0; float2 n = tex2D(texNoiseSampler, textureCoordinate * 0.5).rg; for (float r = 4.0; r > 0.0; r--) // Reducing the number of iterations { float2 x = 2100.0 * r * 0.015; float2 p = 6.28 * textureCoordinate * x + (n - 0.5) * 2.0; float4 d = tex2D(texNoiseSampler, round(textureCoordinate * x - 0.25) / x); float t = (sin(p.x) + sin(p.y)) * max(0.0, 1.0 - frac(Tr2 * (d.b + 0.1) + d.g) * 2.0); if (d.r < (2.0 - r) * 0.08 && t > 0.5) { v += normalize(float3(-cos(p.x), lerp(1.2, 2.0, t - 0.5), 0.0)); } } finalColor.rgb += v * rainAlpha; return finalColor; } technique Replace { pass P0 { DepthBias = -0.0001; AlphaBlendEnable = TRUE; SrcBlend = SRCALPHA; DestBlend = INVSRCALPHA; VertexShader = compile vs_1_1 VertexShaderFunction(); PixelShader = compile ps_3_0 PixelShaderFunction(); } } LUA CODE: local shader = dxCreateShader("fx/shader.fx", 2, 300, true, "vehicle"); local zapylyayushiesyaDetali = { "remap_body", }; local rainTexture = dxCreateTexture("assets/RainCar.png") local normalRainTexture = dxCreateTexture("assets/RainNormal.png") local noiseTexture = dxCreateTexture("assets/enbnoise.png") dxSetShaderValue(shader, "texRain", rainTexture) dxSetShaderValue(shader, "texNormalRain", normalRainTexture) dxSetShaderValue(shader, "texNoise", noiseTexture) -- Применение шейдера к машине local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then --engineApplyShaderToWorldTexture(shader, "vehiclegrunge256", vehicle) for _, name in ipairs(zapylyayushiesyaDetali) do engineRemoveShaderFromWorldTexture(shader, name, localPlayer.vehicle) engineApplyShaderToWorldTexture(shader, name, localPlayer.vehicle) end end renderTarget = dxCreateRenderTarget(512, 512, true) addEventHandler("onClientRender", root, function() iprint(shader) if shader then if renderTarget then dxSetRenderTarget(renderTarget, true) dxDrawImage(0, 0, 512, 512, shader) dxSetRenderTarget() dxDrawImage(50, 50, 256, 256, renderTarget) end end end)
-
- shader mta
- shader hlsl
-
(and 6 more)
Tagged with:
-
Timer not canceled after player dies. The player dies but does not appear to have left the area. That's why the rockets keep firing. sorry my english bad server g_base_col = createColCuboid(-381.27297973633, 1517.2098388672, -5.718826293945, 1600, 1600, 200.25) g_root = getRootElement () function hit ( pla, dim, hitElement ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or vehicle then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(pla)), aclGetGroup("roket")) then outputChatBox ( "Hoş Geldin Asker!, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "Askeri Bölge Derhal Uzaklaş!", pla, 255, 0, 0 ) outputChatBox ( "[Uyarı] Roket Saldırısı!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function leave ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or vehicle then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(pla)), aclGetGroup("roket")) then outputChatBox ( "İyi Devriyeler Asker!", pla, 0, 100, 0 ) else setElementData ( pla, "inRestrictedArea", "false" ) triggerClientEvent ( pla, "destroyTimers", g_root, pla ) outputChatBox ( "[Uyarı] Roket Saldırısı Durdu!", g_root, 255, 0, 0 ) outputDebugString ( "*"..getPlayerName(pla).." has left col shape" ) end end end end addEventHandler ( "onColShapeLeave", g_base_col, leave ) client g_loc_pla = getLocalPlayer () g_loc_root = getRootElement () addEvent ( "destroyTrepassor", true ) addEventHandler ( "destroyTrepassor", g_loc_root, function () posX = -147.10989379883 posY = 2001.6342773438 posZ = 97.30118560791 posX2 = -135.48461914062 posY2 = 1652.8358154297 posZ2 = 97.30118560791 posX3 = 99.344902038574 posY3 = 2233.484375 posZ3 = 130.27871704102 posX4 = 478.35934448242 posY4 = 2160.7651367188 posZ4 = 97.30118560791 posX5 = 523.74835205078 posY5 = 1976.8087158203 posZ5 = 97.30118560791 posX6 = 448.73950195312 posY6 = 1715.9664306641 posZ6 = 97.30118560791 posX7 = 219.20726013184 posY7 = 1836.5458984375 posZ7 = 97.30118560791 posX8 = 188.45198059082 posY8 = 2081.4970703125 posZ8 = 97.30118560791 local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) rotZ = getPedRotation ( g_loc_pla ) if isInResArea == "true" then timer1 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX, posY, posZ, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer2 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX2, posY2, posZ2, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer3 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX3, posY3, posZ3, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer4 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX4, posY4, posZ4, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer5 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX5, posY5, posZ5, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer6 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX6, posY6, posZ6, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer7 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX7, posY7, posZ7, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) timer8 = setTimer ( createProjectile, 3000, 0, g_loc_pla, 20, posX8, posY8, posZ8, 1.0, g_loc_pla, 0, 0, rotZ, 0.1, 0.1, 0.1 ) end end ) addEvent ( "destroyTimers", true ) addEventHandler ( "destroyTimers", g_loc_root, function () local isInResArea = getElementData ( g_loc_pla, "inRestrictedArea" ) if isInResArea == "false" then killTimer ( timer1 ) killTimer ( timer2 ) killTimer ( timer3 ) killTimer ( timer4 ) killTimer ( timer5 ) killTimer ( timer6 ) killTimer ( timer7 ) killTimer ( timer8 ) end end )
-
Hello, I have a problem when logging in. I try to see if the hashed password in the database is the same as the one entered by the player for the password, so I check if the password is correct. But even if you enter a good password and the two passwords are the same, the system always says that the password is incorrect. Can you help? addEvent("login", true) addEventHandler("login", root, function (user, pass) local serial = getPlayerSerial(client) local dq = dbQuery(db, "SELECT * FROM accounts WHERE serial=?", serial) local result = dbPoll(dq, 250) if (#result > 0) then outputChatBox(pass) local Pass = hash("sha512", pass) outputChatBox(Pass) if user == result[1]["username"] then if Pass == result[1]["password"] then print("Sikeres bejelentkezés!") else print("Hibás jelszó!") end else print("Felhasználónév nem található!") end else print("Sikertelen bejelentkezés!") end end )
- 15 replies
-
Hello everyone, i was wondering if there's a way to make some models exceptions on this code, that is supposed to delete all GTA default models but i need the ints to not be deleted so i want to know how can i make exceptions for some interior models.. addEventHandler("onResourceStart", resourceRoot, function() for i=550, 20000 do removeWorldModel(i, 10000, 0, 0, 0) setOcclusionsEnabled(false) end end)
-
Olá, alguém sabe como posso adicionar um hitmarker que mostra o dano causado e a área atingida, como colete e capacete, igual ao do "Top GTA" no meu servidor de DayZ
-
Hello dear Community. In this post i wanna release my Cops 'n' Robbers Gamemode which is complete Selfmade. Enjoy! Previews -> Click Download -> Click
-
Recentemente abaixei um mod da internet cujo a funçao dele e interação policial na hora de algemar prender esses trem porem nao e possivel ver a CNH pelo painel ja mudei o SetElementData O GetElementData Modifiquei acl coloquei na acl adm mas sem sucesso ja tentei contatar o dono do mod peço facebook porem sem exito --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] Comando = "policial" ACL = "Policial" CorPainel = tocolor(225, 0, 0, 252) NomeDoServidor = "Brasil Mundo Avançado" ------------- Nome que você quer que apareça no painel ElementDataBanco = "TS:Banco" -------------- Element Data Do Banco, o mesmo da HUD ElementDataPorteDeArmas = "TS:PorteDeArmas" -------------- Element Data Do Porte de armas ElementHab1 = "DNL:Categoria(B)" ------------------- Element Data Habilitação Carro CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab1 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab2 = "DNL:Categoria(A" ------------------- Element Data Habilitação Moto CaractereHab2 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(C)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(D)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab4 = "DNL:Categoria(E)" ------------------- Element Data Habilitação Caminhao CaractereHab4 = "Sim" -------------- Se é "Sim" ou true ElementHab5 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab5 = "Sim" -------------- Se é "Sim" ou true ElementRG = "ID" ------------------- Element Data RG ElementDataNascimento = "TS:DataDeNascimento" ------------------- Element Data de nascimento TiposDeMulta = { {"Infração Gravíssima", 5000}, ------------- Motivo da multa, Valor da multa {"Infração Grave", 4000}, ------------- Motivo da multa, Valor da multa {"Infração Média", 3000}, ------------- Motivo da multa, Valor da multa {"Infração Leve", 2000}, ------------- Motivo da multa, Valor da multa } e aki A CNH Entrar = createMarker(1111.70715, -1796.76624, 16.59375 -1, "cylinder", 1.2, 0, 255, 0, 90) Blip = createBlipAttachedTo ( Entrar, 36 ) setBlipVisibleDistance(Blip, 150) Sair = createMarker(-2026.97485, -104.28124, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Sair, 3) Marker_Categoria = createMarker(-2033.13196, -117.45327, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Categoria, 3) Marker_Multas = createMarker(-2031.19666, -115.17245, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Multas, 3) function Entrar_Detran (source) setElementInterior(source, 3) setElementPosition(source, -2029.55017, -105.98931, 1035.17188) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Entrar, Entrar_Detran) function Sair_Detran (source) setElementInterior(source, 0) setElementPosition(source, 1109.35291, -1796.64258, 16.59375) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Sair, Sair_Detran) function Abrir_Prova(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Fazer Prova Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Categoria) then triggerClientEvent(source,"DNL:AbrirCategorias",source) end end addEventHandler( "onMarkerHit", Marker_Categoria, Abrir_Prova ) function PagarMultas(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Pagar Multas Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Multas) then triggerClientEvent(source,"DNL:Abrir_Multas",source) end end addEventHandler( "onMarkerHit", Marker_Multas, PagarMultas ) -------- Carregar_Dados -------- function Carregar_Dados () local Account = getPlayerAccount(source) local HabilitacaoA = getAccountData (Account, "DNL:Categoria(A)") local HabilitacaoB = getAccountData (Account, "DNL:Categoria(B)") local HabilitacaoC = getAccountData (Account, "DNL:Categoria(C)") local HabilitacaoD = getAccountData (Account, "DNL:Categoria(D)") local HabilitacaoE = getAccountData (Account, "DNL:Categoria(E)") setElementData(source, "DNL:Categoria(A)", HabilitacaoA) setElementData(source, "DNL:Categoria(B)", HabilitacaoB) setElementData(source, "DNL:Categoria(C)", HabilitacaoC) setElementData(source, "DNL:Categoria(D)", HabilitacaoD) setElementData(source, "DNL:Categoria(E)", HabilitacaoE) end addEventHandler("onPlayerLogin", root, Carregar_Dados) function carteira (source, cmd, pname) local accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accountname, aclGetGroup("Everyone")) then -- Grupo permitido a usar o comando local Player_2 = getPlayerFromPartialName(pname) if isElement(Player_2) then local Account = getPlayerAccount(Player_2) setElementData(Player_2, "DNL:Categoria(A)", true) setAccountData ( Account, "DNL:Categoria(A)", true) setElementData(Player_2, "DNL:Categoria(B)", true) setAccountData ( Account, "DNL:Categoria(B)", true) setElementData(Player_2, "DNL:Categoria(C)", true) setAccountData ( Account, "DNL:Categoria(C)", true) setElementData(Player_2, "DNL:Categoria(D)", true) setAccountData ( Account, "DNL:Categoria(D)", true) setElementData(Player_2, "DNL:Categoria(E)", true) setAccountData ( Account, "DNL:Categoria(E)", true) else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #ffffff O Jogador(a) Não Foi Encontrado!", source, 255,255,255,true) end else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #FFFFFFVocê não tem permissão para utilizar este comando!", source, 255,255,255,true) end end addCommandHandler("carteira", carteira) -------------------------------------------------------------------- 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 end end -------------------------------------------------------------------- Outra parte do Script --[[ ===================================== --]] -- = CATEGORIA A = -- --[[ ===================================== --]] function CNHMoto (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(A)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 581) or (getElementModel (temp) == 462) or (getElementModel (temp) == 521) or (getElementModel (temp) == 463) or (getElementModel (temp) == 522) or (getElementModel (temp) == 461) or (getElementModel (temp) == 448) or (getElementModel (temp) == 468) or (getElementModel (temp) == 586) or (getElementModel (temp) == 523) then -- if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto",source) end end end addEventHandler ( "onVehicleEnter", root, CNHMoto ) --[[ ===================================== --]] -- = CATEGORIA B = -- --[[ ===================================== --]] function CNHCarro (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(B)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 602) or (getElementModel (temp) == 496) or (getElementModel (temp) == 525) or (getElementModel (temp) == 401) or (getElementModel (temp) == 518) or (getElementModel (temp) == 527) or (getElementModel (temp) == 589) or (getElementModel (temp) == 419) or (getElementModel (temp) == 587) or (getElementModel (temp) == 533) or (getElementModel (temp) == 526) or (getElementModel (temp) == 474) or (getElementModel (temp) == 545) or (getElementModel (temp) == 517) or (getElementModel (temp) == 410) or (getElementModel (temp) == 600) or (getElementModel (temp) == 436) or (getElementModel (temp) == 439) or (getElementModel (temp) == 549) or (getElementModel (temp) == 491) or (getElementModel (temp) == 445) or (getElementModel (temp) == 604) or (getElementModel (temp) == 507) or (getElementModel (temp) == 585) or (getElementModel (temp) == 466) or (getElementModel (temp) == 492) or (getElementModel (temp) == 546) or (getElementModel (temp) == 551) or (getElementModel (temp) == 516) or (getElementModel (temp) == 467) or (getElementModel (temp) == 426) or (getElementModel (temp) == 547) or (getElementModel (temp) == 405) or (getElementModel (temp) == 580) or (getElementModel (temp) == 409) or (getElementModel (temp) == 550) or (getElementModel (temp) == 566) or (getElementModel (temp) == 540) or (getElementModel (temp) == 421) or (getElementModel (temp) == 529) or (getElementModel (temp) == 485) or (getElementModel (temp) == 438) or (getElementModel (temp) == 574) or (getElementModel (temp) == 420) or (getElementModel (temp) == 490) or (getElementModel (temp) == 470) or (getElementModel (temp) == 596) or (getElementModel (temp) == 598) or (getElementModel (temp) == 599) or (getElementModel (temp) == 597) or (getElementModel (temp) == 531) or (getElementModel (temp) == 536) or (getElementModel (temp) == 575) or (getElementModel (temp) == 534) or (getElementModel (temp) == 567) or (getElementModel (temp) == 535) or (getElementModel (temp) == 576) or (getElementModel (temp) == 429) or (getElementModel (temp) == 541) or (getElementModel (temp) == 415) or (getElementModel (temp) == 480) or (getElementModel (temp) == 562) or (getElementModel (temp) == 565) or (getElementModel (temp) == 434) or (getElementModel (temp) == 494) or (getElementModel (temp) == 502) or (getElementModel (temp) == 503) or (getElementModel (temp) == 411) or (getElementModel (temp) == 559) or (getElementModel (temp) == 561) or (getElementModel (temp) == 560) or (getElementModel (temp) == 506) or (getElementModel (temp) == 451) or (getElementModel (temp) == 558) or (getElementModel (temp) == 555) or (getElementModel (temp) == 477) or (getElementModel (temp) == 568) or (getElementModel (temp) == 424) or (getElementModel (temp) == 504) or (getElementModel (temp) == 457) or (getElementModel (temp) == 483) or (getElementModel (temp) == 571) or (getElementModel (temp) == 500) or (getElementModel (temp) == 444) or (getElementModel (temp) == 556) or (getElementModel (temp) == 557) or (getElementModel (temp) == 471) or (getElementModel (temp) == 495) or (getElementModel (temp) == 539) or (getElementModel (temp) == 459) or (getElementModel (temp) == 422) or (getElementModel (temp) == 482) or (getElementModel (temp) == 605) or (getElementModel (temp) == 530) or (getElementModel (temp) == 418) or (getElementModel (temp) == 572) or (getElementModel (temp) == 582) or (getElementModel (temp) == 413) or (getElementModel (temp) == 440) or (getElementModel (temp) == 543) or (getElementModel (temp) == 583) or (getElementModel (temp) == 554) or (getElementModel (temp) == 579) or (getElementModel (temp) == 400) or (getElementModel (temp) == 404) or (getElementModel (temp) == 489) or (getElementModel (temp) == 505) or (getElementModel (temp) == 479) or (getElementModel (temp) == 422) or (getElementModel (temp) == 458) or (getElementModel (temp) == 402) then --if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCar",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarro ) --[[ ===================================== --]] -- = CATEGORIA C = -- --[[ ===================================== --]] function CNHCaminhao (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(C)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 408) or (getElementModel (temp) == 552) or (getElementModel (temp) == 416) or (getElementModel (temp) == 433) or (getElementModel (temp) == 427) or (getElementModel (temp) == 528) or (getElementModel (temp) == 407) or (getElementModel (temp) == 544) or (getElementModel (temp) == 601) or (getElementModel (temp) == 428) or (getElementModel (temp) == 499) or (getElementModel (temp) == 609) or (getElementModel (temp) == 498) or (getElementModel (temp) == 524) or (getElementModel (temp) == 532) or (getElementModel (temp) == 578) or (getElementModel (temp) == 486) or (getElementModel (temp) == 406) or (getElementModel (temp) == 573) or (getElementModel (temp) == 455) or (getElementModel (temp) == 588) or (getElementModel (temp) == 423) or (getElementModel (temp) == 414) or (getElementModel (temp) == 443) or (getElementModel (temp) == 456) or (getElementModel (temp) == 478) or (getElementModel (temp) == 508) or (getElementModel (temp) == 431) or (getElementModel (temp) == 437) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCAM",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCaminhao ) --[[ ===================================== --]] -- = CATEGORIA D = -- --[[ ===================================== --]] function CNHCarreta (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(D)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 403) or (getElementModel (temp) == 515) or (getElementModel (temp) == 514) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCARRETA",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarreta ) --[[ ===================================== --]] -- = CATEGORIA E = -- --[[ ===================================== --]] function CNHHeli (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(E)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 548) or (getElementModel (temp) == 425) or (getElementModel (temp) == 417) or (getElementModel (temp) == 487) or (getElementModel (temp) == 488) or (getElementModel (temp) == 497) or (getElementModel (temp) == 563) or (getElementModel (temp) == 447) or (getElementModel (temp) == 469) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaHeli",source) end end end addEventHandler ( "onVehicleEnter", root, CNHHeli ) --[[ ===================================== --]] -- = REMOVER CNH = -- --[[ ===================================== --]] function RemCNH (source, seat) if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto_Off",source) triggerClientEvent(source,"CNH:AlertaCar_Off",source) triggerClientEvent(source,"CNH:AlertaCAM_Off",source) triggerClientEvent(source,"CNH:AlertaCARRETA_Off",source) triggerClientEvent(source,"CNH:AlertaHeli_Off",source) end end addEventHandler ( "onVehicleExit", root, RemCNH )