Jump to content

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. I wanted to ask if you can access variable x from scrip1.lua in script2.lua. The thing is that I have a special variable in a script that loads an XML file, and I wanted to create another script specifically for commands, and in it I wanted to acces the special variable.
  2. Oi, estou a bastante tempo tentando solucionar um problema em um script e não estou conseguindo. O script é de contagem regressiva, e eu estou tentando por para que somente "X" acl possa utilizar o comando, que até então, o script está permitindo que todos utilizem. este é o script virgem, sem as minhas modificações falhas; countdRunning = false function conteoTick (thePlayer) se restante == 0 then killTimer (conteoTimer) playSoundFrontEnd (root, 45) outputChatBox ("VAI VAI VAI!", root, 0,188,0) countdRunning = false else playSoundFrontEnd (root, 44) local factorGreen = 255 / (countdStart-1) local resultadoGreen = factorGreen * restante-factorGreen local factorSpaces = 12 / (countdStart-1) local resultSpaces = math.floor (factorSpaces * restante-factorSpaces) local permanentStr = "" para i = 0, resultSpaces do restanteStr = restanteStr .. "" end restanteStr = restanteStr .. restante outputChatBox (restanteStr, root, 255, resultadoGreen, 0) restante = restante - 1 end end addCommandHandler ("contar", função (thePlayer, cmd, startArg) --addCommandHandler ("countd", função (thePlayer , cmd, startArg) --addCommandHandler ("contagem regressiva", função (thePlayer, cmd, startArg) --addCommandHandler ("conteo", função (thePlayer, cmd, startArg) se countdRunning then outputChatBox ("Já existe uma contagem regressiva atual" , thePlayer) return else if startArg and tonumber (startArg) then countdStart = tonumber (startArg) else countdStart = 3 end if countdStart ~ = 3 and countdStart ~ = 4 then outputChatBox ("Disponível apenas: 3 e 4", thePlayer, 255,0,0) return end restante = countdStart outputChatBox (getPlayerName (thePlayer) .. "# FF8C00começouçou uma contagem regressiva ", root, 255.255.255 , true) conteoTick (thePlayer) conteoTimer = setTimer (conteoTick, 1000,0, thePlayer) countdRunning = true end end)
  3. Bom dia, Preciso de uma ajuda, eu uso uma função em modo client para quando o player puxa o cabo o PACKT LOSS nao deixa ele transferir, porem mesmo assim os jogadores estão conseguindo burlar. Alguem sabe me dizer como eu posso corrigir? Qual função eu devo usar? Função: if getNetworkStats()["packetlossLastSecond"] > 1 then -- Client elseif source == EnviarButon then local itemName = guiGridListGetItemText(TranssWin,guiGridListGetSelectedItem(TranssWin),1) local row_ = guiGridListGetSelectedItem(TranssWin) local grilistSex = guiGridListGetItemData(TranssWin, row_, players2) local getMoneyToSend = guiGetText(PlayerTavb) if itemName ~= "" and getMoneyToSend ~= "" and grilistSex ~= "" then if getNetworkStats()["packetlossLastSecond"] > 1 then startRollMessage2("Inventory", "Conexão Ruim!",255,22,0) return else triggerServerEvent("MWEnviarMWC",getLocalPlayer(),itemName,grilistSex,getMoneyToSend) end guiSetVisible(TransferirWin,false) end end
  4. Boa Tarde, Queria saber se tem como bloquear IPS de outros paises no meu servidor. Deixando o servidor online, apenas para os paises que eu autorizar. OBRIGADO DESDE JÁ
  5. i get problems when i use a different resolution,when i use 1366x768 its all alright but when i use 1024x768 or others the images and retangles just disappear screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } function HudVictor ( ... ) if (not isPlayerMapVisible()) then local Dinheiro = getPlayerMoney(localPlayer) local Banco = getElementData(localPlayer, "Bank:Caixa") or "Não Sincronizado" local weapon = getPedWeapon(getLocalPlayer()) local weaponClip = getPedAmmoInClip(getLocalPlayer(), getPedWeaponSlot(getLocalPlayer())) local weaponAmmo = getPedTotalAmmo(getLocalPlayer()) - getPedAmmoInClip(getLocalPlayer()) local vida = math.floor(getElementHealth(getLocalPlayer())) local colete = math.floor(getPedArmor(getLocalPlayer())) local fome = getElementData(getLocalPlayer(), "hunger") or 50 local sede = getElementData(getLocalPlayer(), "sede") or 50 dxDrawImage(screenW * 0.6594, screenH * 0.0208, screenW * 0.3328, screenH * 0.1028, "hud/files/Icons/prehud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.7727, screenH * 0.0208, screenW * 0.0547/100*vida, screenH * 0.1028, tocolor(255, 0, 0, 255), false) dxDrawRectangle(screenW * 0.8273, screenH * 0.0208, screenW * 0.0547/100*colete, screenH * 0.1028, tocolor(70, 130, 180, 255), false) dxDrawRectangle(screenW * 0.8820, screenH * 0.0208, screenW * 0.0547/100*fome, screenH * 0.1028, tocolor(244, 164, 96, 255), false) dxDrawLine((screenW * 0.9367) - 1, screenH * 0.1236, screenW * 0.9914, screenH * 0.1236, tocolor(70, 130, 180, 255), 1, false) dxDrawLine(screenW * 0.9914, screenH * 0.1236, screenW * 0.9914, (screenH * 0.0208) - 1, tocolor(70, 130, 180, 255), 1, false) dxDrawRectangle(screenW * 0.9367, screenH * 0.0208, screenW * 0.0547/100*sede, screenH * 0.1028, tocolor(145, 224, 230, 255), false) dxDrawText(""..Dinheiro, screenW * 0.6914, screenH * 0.0319, screenW * 0.7492, screenH * 0.0800, tocolor(255, 255, 255, 255), 1.00, "default-bold", "right", "center", false, false, false, false, false) dxDrawText(""..Banco, screenW * 0.6914, screenH * 0.0847, screenW * 0.7492, screenH * 0.1144, tocolor(255, 255, 255, 255), 1.00, "default-bold", "right", "center", false, false, false, false, false) dxDrawImage(screenW * 0.7727, screenH * 0.0222, screenW * 0.0547, screenH * 0.1014, "hud/files/Icons/health.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.8266, screenH * 0.0222, screenW * 0.0555, screenH * 0.1014, "hud/files/Icons/bulletproof.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.8820, screenH * 0.0208, screenW * 0.0547, screenH * 0.1028, "hud/files/Icons/hunger.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(1204, 18, 60, 61, "hud/files/Icons/water.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(1051, 98, 212, 113, "hud/files/Icons/Armas/"..weapon.. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(""..weaponClip.."/"..weaponAmmo.."", 1173, 141, 1249, 192, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false) end end --/100*fome function setHud() addEventHandler("onClientRender", getRootElement(), HudVictor) setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), setHud) function removeHud() setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), removeHud)
  6. Então Eu passei a madrugada toda tentando resolver um script aq onde que consiste em é um sistema de Garagem e concessionária... Porém eu adcionei um sistema de Detran em meu servidor e estava tentando modificar uma coisa nesse sistema ai de garagem que é... No painel tem " pegar veiculo ", Porém quando pega o veiculo ele spawna em você ( apos deslogar ou se o carro estiver destruido ) porém eu queria alterar isso para " spawnar veiculo " para Spawnar onde o carro foi deixado e colocar um teleport detran em meio a isso... ( caso algum player jogue o carro na água, etc... ) Tirando a função de "trancar/destrancar" alterando para " teleport Pátio " Porém mano, eu tentei a madrugada toda e está muito além de mim o script -------------------------------------------------------------------------------------------------------------------------------------------------------------------- function getFreeID() local result = dbPoll(dbQuery(db, "SELECT ID FROM VehicleList ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end function getFreePlate(vehicle, NewID, source) local str = "ABCDEFGHIJKLMNPQRSTUVXWYZ" local plate = "" for index = 1, 3 do plate = plate .. string.char(str:byte(math.random(1, #str))) end plate = string.upper(plate) plate = plate .. "" for index = 1, 1 do plate = plate .. math.random(1, 9) end for index = 1, 1 do plate = plate .. string.char(str:byte(math.random(1, #str))) end for index = 1, 2 do plate = plate .. math.random(1, 9) end setVehiclePlateText(vehicle, plate) setElementData(vehicle,"Placa",plate) dbExec(db, "UPDATE VehicleList SET Placa=? WHERE Account=? AND ID=?", plate, getAccountName(getPlayerAccount(source)),tonumber(NewID)) end function getVehicleByID(id) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ID") == id then v = veh break end end return v end function updateVehicleInfo(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "VehicleInfo", result) end end end local marcacao = {} local blip = {53} addEventHandler("onResourceStart", resourceRoot, function() if getThisResource() == resource then db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS VehicleList (ID, Placa, Account, Model, X, Y, Z, RotZ, Colors, Upgrades, Paintjob, DETRAN, Cost, HP, new_hydr)") for i, player in ipairs(getElementsByType("player")) do updateVehicleInfo(player) end for _,marker in ipairs(pontosDeGaragem) do marcacao[marker] = createMarker(marker[1], marker[2], marker[3]-1, "cylinder", configPontos.tamanhoMarker, configPontos.corMarker[1], configPontos.corMarker[2], configPontos.corMarker[3], 170) setElementDimension(marcacao[marker], marker[5]) setElementInterior(marcacao[marker], marker[4]) blip[marker] = createBlipAttachedTo(marcacao[marker], configPontos.idBlip) setBlipSize(blip[marker], 5) end end end) addEventHandler("onMarkerHit", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,marker in ipairs(pontosDeGaragem) do if marcacao[marker] == source then if not isGuestAccount(getPlayerAccount(executor)) then triggerClientEvent(executor, "abrirPainelIndConce", executor) break end end end end end) addEventHandler("onMarkerLeave", getRootElement(), function(executor) if executor and isElement(executor) and getElementType(executor) == "player" then for _,marker in ipairs(pontosDeGaragem) do if marcacao[marker] == source then if not isGuestAccount(getPlayerAccount(executor)) then triggerClientEvent(executor, "fecharPainelIndConce", executor) break end end end end end) addEvent("onOpenGui", true) addEventHandler("onOpenGui", root, function() updateVehicleInfo(source) end) function destroyVehicle(theVehicle) if isElement(theVehicle) then local Owner = getElementData(theVehicle, "Owner") if Owner then local x, y, z = getElementPosition(theVehicle) local _, _, rz = getElementRotation(theVehicle) local r1, g1, b1, r2, g2, b2 = getVehicleColor(theVehicle, true) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 upgrade = "" for _, upgradee in ipairs (getVehicleUpgrades(theVehicle)) do if upgrade == "" then upgrade = upgradee else upgrade = upgrade..","..upgradee end end local Paintjob = getVehiclePaintjob(theVehicle) or 3 local id = getElementData(theVehicle, "ID") local DETRAN = getElementData(theVehicle, "Travado") dbExec(db, "UPDATE VehicleList SET X = ?, Y = ?, Z = ?, RotZ = ?, HP = ?, Colors = ?, Upgrades = ?, Paintjob = ?, DETRAN = ? WHERE Account = ? AND ID = ?", x, y, z, rz, getElementHealth(theVehicle), color, upgrade, Paintjob, DETRAN or false, getAccountName(getPlayerAccount(Owner)), id) updateVehicleInfo(Owner) local attached = getAttachedElements(theVehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end end destroyElement(theVehicle) end end addEvent("onBuyNewVehicle", true) addEventHandler("onBuyNewVehicle", root, function(Model, cost, r1, g1, b1, r2, g2, b2) abc = false local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) for i, data in ipairs (data) do if data["Model"] == Model then abc = true break end end if #data >= 10 then outputChatBox("#838B83[#FFFF00BiC#838B83]#FFFF00 Voce Pode Comprar Apenas 10 Veiculos.", source, 38, 122, 216, true) return end if abc == true then return end if getPlayerMoney(source) >= tonumber(cost) then takePlayerMoney ( source, cost ) local x, y, z = getElementPosition(source) local _, _, rz = getElementRotation(source) local shopID = getElementData ( source, "atVehShop") local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 if shopID and shopsVehSpawns[shopID] then vehicle = createVehicle(Model, shopsVehSpawns[shopID][1], shopsVehSpawns[shopID][2], shopsVehSpawns[shopID][3], shopsVehSpawns[shopID][4], shopsVehSpawns[shopID][5], shopsVehSpawns[shopID][6]) else vehicle = createVehicle(Model, x-5, y+5, z, 0, 0, rz) end setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) setElementData(vehicle, "Owner", source) local NewID = getFreeID() local Placa = getElementData(vehicle,"Placa") if Placa == nil or not Placa then local NewPlate = getFreePlate(vehicle,id, source) end local Placa = getElementData(vehicle,"Placa") setElementData(vehicle, "ID", NewID) dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, Placa, getAccountName(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, false, cost, 1000, 0) updateVehicleInfo(source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) warpPedIntoVehicle ( source, vehicle ) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 150, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) else outputChatBox("#c1c1c1Você não tem dinheiro o suficiente para comprar este veiculo.", source, 38, 122, 216, true) end end) vv = {} function SaveVehicleDataOnQuit() local conta = getAccountName(getPlayerAccount(source)) for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ownercar") == conta then if not veh then return end destroyVehicle(veh) end end end addEventHandler("onPlayerQuit", root,SaveVehicleDataOnQuit) addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1já está spawnado.", source, 38, 122, 216, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 local playerX, playerY, playerZ = getElementPosition(source) if data[1]["DETRAN"] ~= 1 then --vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) vehicle = createVehicle(data[1]["Model"], playerX, playerY, playerZ, 0, 0, data[1]["RotZ"]) warpPedIntoVehicle(source, vehicle) setElementData(vehicle, "ID", id) setElementData(vehicle, "Travado", false) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado.", source, 38, 122, 216, true) else outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi spawnado no DETRAN, pois você deslogou com ele travado lá!.", source, 38, 122, 216, true) vehicle = createVehicle(data[1]["Model"], 1650.327, -1088.778, 23.906, 5, 5, data[1]["RotZ"]) setElementData(vehicle, "ID", id) setElementData(vehicle, "Travado", true) end local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if tonumber(data[1]["HP"]) <= 255.5 then data[1]["HP"] = 255 end if data[1]["new_hydr"] and data[1]["new_hydr"] == 1 then setElementData(vehicle, "NewHydr", true) else setElementData(vehicle, "NewHydr", false) end Placa = data[1]["Placa"] setElementData(vehicle, "Placa",Placa) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) local Placa = getElementData(vehicle,"Placa") if Placa == nil or not Placa then local NewPlate = getFreePlate(vehicle,id, source) end vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) setElementData(vehicle, "Owner", source) end else outputChatBox("#c1c1c1Há um problema com o veiculo, notifique o administrador.", source, 38, 122, 216, true) end end) addEvent("DestroyMyVehicle", true) addEventHandler("DestroyMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local posVehX, posVehY, posVehZ = getElementPosition(vehicle) local posSouX, posSouY, posSouZ = getElementPosition(source) if (getDistanceBetweenPoints3D(posVehX, posVehY, posVehZ, posSouX, posSouY, posSouZ)) <= 10 then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) local DETRAN = getElementData(vehicle, "Travado") local DETRAN = getElementData(vehicle, "Rebocando") if DETRAN ~= true and DETRAN2 ~= true then if type(data) == "table" and #data ~= 0 then destroyVehicle(vehicle) outputChatBox ("#c1c1c1O seu veiculo #FF0000"..(customCarNames[data[1]["Model"]] or getVehicleNameFromModel(data[1]["Model"])).." #c1c1c1foi guardado.", source, 38, 122, 216, true) else outputChatBox("#c1c1c1Selecione um veiculo.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não pode ser guardado, pois está preso no DETRAN!.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não está perto de você o suficiente.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("LockMyVehicle", true) addEventHandler("LockMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local posVehX, posVehY, posVehZ = getElementPosition(vehicle) local posSouX, posSouY, posSouZ = getElementPosition(source) if (getDistanceBetweenPoints3D(posVehX, posVehY, posVehZ, posSouX, posSouY, posSouZ)) <= 15 then if not isVehicleLocked(vehicle) then setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, true) setVehicleDoorState(vehicle, 0, 0) setVehicleDoorState(vehicle, 1, 0) setVehicleDoorState(vehicle, 2, 0) setVehicleDoorState(vehicle, 3, 0) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #FF0000fechado.", source, 38, 122, 216, true) elseif isVehicleLocked(vehicle) then setVehicleLocked(vehicle, false) setVehicleDoorsUndamageable(vehicle, false) outputChatBox("#c1c1c1O seu veiculo #FF0000"..(customCarNames[getElementModel(vehicle)] or getVehicleNameFromModel(getElementModel(vehicle))).." #c1c1c1foi #FF0000aberto.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O controle do alarme do seu veiculo está fora do alcance.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("BlipMyVehicle", true) addEventHandler("BlipMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not getElementData(vehicle, "ABlip") then setElementData(vehicle, "ABlip", true) createBlipAttachedTo(vehicle, 41, 2, 255, 255, 255, 255, 255, 65535, source) outputChatBox("#c1c1c1O localizador do seu veiculo foi ativado, pressione a tecla f11 para encontrá-lo.", source, 38, 122, 216, true) else local attached = getAttachedElements(vehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end setElementData(vehicle, "ABlip", false) outputChatBox("#c1c1c1O localizador do seu veiculo foi desativado.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O seu veiculo não foi spawnado.", source, 38, 122, 216, true) end end) addEvent("SellMyVehicle", true) addEventHandler("SellMyVehicle", root, function(id) local vehicle = getVehicleByID(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then local Money = math.ceil((data[1]["Cost"]*.9)*math.floor(data[1]["HP"])/120/12) givePlayerMoney (source, Money) if isElement(vehicle) then destroyElement(vehicle) end dbExec(db, "DELETE FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) outputChatBox("#c1c1c1Você vendeu o seu veiculo por R$: "..Money, source, 38, 122, 216, true) end end) function getDataOnLogin(_, account) updateVehicleInfo(source) end addEventHandler("onPlayerLogin", root, getDataOnLogin) addEvent("inviteToBuyCarSended", true) addEventHandler("inviteToBuyCarSended", root, function(player, price, veh_name, veh_id) if player and price and veh_name and veh_id then local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "recieveInviteToBuyCar", pl, getPlayerName (source), getAccountName(getPlayerAccount(source)), price, veh_name, veh_id ) else outputChatBox("#c1c1c1O jogador não foi encontrado.", source, 38, 122, 216, true) triggerClientEvent ( source, "cleanCarInvitations", source ) end end end) addEvent("invitationBuyCarNotAccepted", true) addEventHandler("invitationBuyCarNotAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) if pl then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputChatBox("#c1c1c1O jogador recusou a sua oferta.", pl, 38, 122, 216, true) end end) addEvent("invitationBuyCarAccepted", true) addEventHandler("invitationBuyCarAccepted", root, function(player, acc, price, veh_name, veh_id) local pl = getPlayerFromName ( player ) local avail = false if pl and getAccountName ( getPlayerAccount (pl)) == acc then avail = true triggerClientEvent ( pl, "cleanCarInvitations", pl ) else for i, v in ipairs( getElementsByType ( 'player' ) ) do if getAccountName(getPlayerAccount ( v )) == acc then avail = true pl = v break end end end price = tonumber(price) or 0 if avail then if isGuestAccount ( getPlayerAccount ( source ) ) then triggerClientEvent ( pl, "cleanCarInvitations", pl ) outputChatBox("#c1c1c1O jogador não se encontra logado.", pl, 38, 122, 216, true) outputChatBox("#c1c1c1Você não está logado.", source, 38, 122, 216, true) return true end if getPlayerMoney ( source ) >= price then local vehicle = getVehicleByID(tonumber(veh_id)) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(pl)), veh_id), -1) if type(data) == "table" and #data ~= 0 and isElement ( vehicle ) then givePlayerMoney ( pl, price ) takePlayerMoney ( source, price ) dbExec(db, "UPDATE VehicleList SET Account = ? WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), getAccountName(getPlayerAccount(pl)), veh_id) updateVehicleInfo(source) updateVehicleInfo(pl) setElementData(vehicle, "Owner", source) setElementData(vehicle, "ownercar", getAccountName(getPlayerAccount(source))) outputChatBox("#c1c1c1Você vendeu o seu veiculo por "..price.." reais.", pl, 38, 122, 216, true) outputChatBox("#c1c1c1Você comprou um veiculo por "..price.." reais.", source, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) else outputChatBox("#c1c1c1O veiculo não se encontra spawnado.", source, 38, 122, 216, true) outputChatBox("#c1c1c1O veiculo não se encontra spawnado.", pl, 38, 122, 216, true) triggerClientEvent ( pl, "cleanCarInvitations", pl ) end else outputChatBox("#c1c1c1Você não possui dinheiro suficiente.", source, 38, 122, 216, true) end else outputChatBox("#c1c1c1O jogador não foi encontrado.", source, 38, 122, 216, true) end end) function consultarPlaca(source, Command, Placa) local accName = getAccountName(getPlayerAccount(source)) if not isObjectInACLGroup("user."..accName,aclGetGroup("Policial", "DETRAN")) then return outputMessage( "Você não tem permissão para este comando.", source,"info") end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", Placa), -1) if not getVehicleByPlate(Placa) then outputMessage( "Prenda o condutor Imediatamente.#FFFF00 Placa Fria", source,"info") return end if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] local modelo = data[1]["Model"] local queixa = getElementData(getVehicleByPlate(Placa), "Roubado") or "Não" outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) outputChatBox( "#FFFF00*__Banco de Dados DETRAN__*", source, 255,255,255,true) outputChatBox( "Nome Do Veículo:#FFFF00"..customCarNames[data[1]["Model"]], source, 255,255,255,true) outputChatBox( "Conta Proprietário:#FFFF00"..dono, source, 255,255,255,true) outputChatBox( "Placa Consultada:#FFFF00"..Placa, source, 255,255,255,true) outputChatBox( "Queixa de roubo: #FFFF00"..queixa, source, 255,255,255,true) outputChatBox( "#FFFF00*________________________*", source, 255,255,255,true) else outputChatBox( "Veículo não spawnado ou inexistente", source,"info") end end addCommandHandler("consultar",consultarPlaca) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function getVehicleByPlate(Placa) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "Placa") == Placa then v = veh break end end return v end local pedqueixa = createPed ( 281, 1580.2,-1634.6,13.6) local objporta1 = createObject (2959,1577.2,-1637.3,12.9,0,0,0) local objporta2 = createObject (2959,1577.2,-1637.3,12.6,0,0,0) local mkqueixa = createMarker(1580.01733, -1632.14722, 13.38281 -0.9, "cylinder", 1.3, 38, 122, 216) function msgqueixa(hitElement) if getElementType (hitElement) == "player" then outputMessage("Utilize o (/queixa [Placa Do Veiculo]) para prestar queixa de roubo", hitElement) end end addEventHandler("onMarkerHit", mkqueixa, msgqueixa) function prestqueixa(source, cmd, input) local veh = getVehicleByPlate(input) if not veh then outputMessage("Não existe um veículo com esta placa", source, "error") return end local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", input), -1) if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] if isElementWithinMarker ( source, mkqueixa ) then if getAccountName(getPlayerAccount(source)) == dono then setElementData(veh, "Roubado", "Sim") outputMessage("Queixa de roubo prestada para seu veiculo. ", source) else outputMessage("Este veículo, não pertence a você ", source) end else outputMessage("Vá ao marker no DP, para prestar queixa! ", source) end end end addCommandHandler("queixa", prestqueixa) function levarveic(source, cmd, input) local veh = getVehicleByPlate(input) local Conta = getAccountName ( getPlayerAccount ( source ) ) if not veh then outputMessage("Não existe um veículo com esta placa", source) return end local x, y, z = getElementPosition(source) local counter = 0 for seat, player in pairs(getVehicleOccupants(veh)) do counter = counter + 1 end if counter > 0 then return end if isObjectInACLGroup ("user."..Conta, aclGetGroup ( "Console" ) ) then setElementPosition(veh, x + 2.5, y, z) setElementRotation(veh, 0, 0, 0) else outputMessage("Você não tem permissão para usar este comando", source) end end addCommandHandler("trazerveic", levarveic) function entrarcarroqueixa( player, seat, jacked ) local Placa = getElementData(source, "Placa") local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Placa = ?", Placa), -1) if type(data) == "table" and #data ~= 0 then local dono = data[1]["Account"] if getAccountName(getPlayerAccount(player)) == dono then setElementData(source, "Roubado", "Não") end end end addEventHandler ( "onVehicleEnter", getRootElement(), entrarcarroqueixa ) function outputMessage (text, player, r, g, b) return exports["notices"]:addNotification( player, text, "info"); end
  7. boa tarde, queria saber como faço para adicionar 2 botao para executar uma função Ex: alt + c = abre um painel
  8. what is noname player in server?
  9. ja testei a model em diversos servidores e ja converti e arrumei tudo nela desde modelando ate o script geral e quando coloco dentro no servidor ele fica dando esse problema alguém pode ajudar ? https://prnt.sc/12n6118
  10. addCommandHandler("rinventario", function(cmd, name) if getElementData(localPlayer,"Policial") ~= true then return end if(not name)then outputChatBox("#00FF00[use]: #ffffff/"..cmd.." [nome / ID]",0,0,0,true) return end local targetPlayer, targetPlayerName = exports.global:findPlayer(getLocalPlayer(), name) if(not targetPlayer)then return end if targetPlayer == localPlayer then outputChatBox('#ffffffVocê não pode se revistar!', 255, 255, 255, true) return end showInventory = true cursorInSlot = {-1, -1, -1, -1} movedItem = {-1, -1, -1, -1} openInventory(targetPlayer) activeInvState = 'bag' craftTick = 0 setTimer(function() removeEventHandler('onClientRender', root, drawInventory) addEventHandler('onClientRender', root, drawInventory, true, 'low-5') end, 50, 1) toggleControl ("fire", false) playSound("files/sounds/open.mp3", false) bodySearch = false end) Estou tentando fazer quando uma pessoa digite / rinventario e consiga acessar o inventario que estou configurando alguem pode me ajudar
  11. Mas não consigo, algo da errado no 'isElementInRange', alguém poderia me ajudar? addCommandHandler("car", function(thePlayer,veh) local x, y, z = getElementPosition (thePlayer) local veh = getElementsByType('vehicle') if isElementInRange(veh, x, y, z, 25) then outputChatBox("teste",thePlayer,255,255,255,true) end end end ) Print do erro: https://prnt.sc/12bhy03
  12. Então queria saber se tem como e qual seria o script usado para não deixar alguém morrer, Exemplo a pessoa leva um tiro na cabeça e ao invés de morrer ela fica desmaiada, sei que tem vários script na net disso, mais nenhum deles é realmente oque eu preciso, queria um script que independente do que acontecer a pessoa não morrer, mesmo se cair de um lugar alto, alguém pode me ajudar em quanto a isso?
  13. então esse script deixa o id invisível para todo mundo, e queria colocar que somente membros da acl staff consiga ver o id, normalmente, já procurei tutorial e não entendi muito bem como fazer isso, alguém poderia me ajudar nessa questão? local drawDistance = 7 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then if getElementAlpha(player) > 0 then -- se o alpha do player for maior que 0 mostra o ID local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText(""..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, CorTag, 1.20, "default-bold", "left", "top", false, false, false, false, false) CorTag = tocolor(255, 255, 255) if getElementData(player, "Cor", true) then CorTag = tocolor(0, 255, 0) end end end end end else table.remove(g_StreamedInPlayers, k) end end addEventHandler("onClientRender", root, onClientRender) function CorTagid () if getElementData(localPlayer, "Cor", true) then setElementData(localPlayer, "Cor", false) else setElementData(localPlayer, "Cor", true) end end bindKey ( "z", "both", CorTagid ) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart() local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart)
  14. Map = {} Map.__index = Map Map.instances = {} Map.damageEfect = {} local sx,sy = guiGetScreenSize() px,py = 1366,768 x,y = (sx/px), (sy/py) font = dxCreateFont("gfx/myriadproregular.ttf",20,true) function math.map(value, low1, high1, low2, high2) return low2 + (value - low1) * (high2 - low2) / (high1 - low1) end function kozeliGPSPontokTorlese() for i,pont in ipairs(gpsPontok) do local x,y = getElementPosition(getLocalPlayer()) if(getDistanceBetweenPoints2D ( x, y, pont.x, pont.y ) < 10) then table.remove(gpsPontok, i) for k,kpont in ipairs(gpsPontok) do if kpont.id < pont.id then table.remove(gpsPontok, k) end end if(#gpsPontok == 0) then if(utiBlip) then destroyElement(utiBlip) utiBlip = nil end end end end end function Map.new(X,Y,W,H) local self = setmetatable({}, Map) self.x = X self.y = Y self.w = W self.h = H local pos = {getElementPosition(localPlayer)} self.posX = pos[1] self.posY = pos[2] self.posZ = pos[3] self.size = 90 self.color = {255,255,255,255} self.blipSize = x*20 self.drawRange = 550 self.map = dxCreateTexture("gfx/gtasa.png","dxt5") self.renderTarget = dxCreateRenderTarget(W, H, true) self.blips = {} for k=0, 63 do self.blips[k] = dxCreateTexture("gfx/icons/"..k..".png","dxt3") end if(#Map.instances == 0) then addEventHandler("onClientRender", getRootElement(), Map.render) end table.insert(Map.instances, self) return self end function Map.render() for k,v in pairs(Map.instances) do if v.visible then if not v.style then ---outputChatBox("1") --v:draw() elseif v.style == 1 then --outputChatBox("2") v:draw2() end end end end function Map:setVisible(bool) self.visible = bool if bool == true then self:setPosition(getElementPosition(localPlayer)) end return true end function Map:isVisible() return self.visible end function Map:setPosition(x,y,z) self.posX = x self.posY = y self.posZ = z return true end function Map:getPosition() return self.posX, self.posY, self.posZ end function Map:setColor(r,g,b,a) self.color = {r,g,b,a} return true end function Map:getColor() return self.color end function Map:setSize(value) self.size = value return true end function contornoRetangulo(absX, absY, sizeX, sizeY, color, ancho) dxDrawRectangle(absX, absY, sizeX, ancho, color) dxDrawRectangle(absX, absY + ancho, ancho, sizeY - ancho, color) dxDrawRectangle(absX + ancho, absY + sizeY - ancho, sizeX - ancho, ancho, color) dxDrawRectangle(absX + sizeX - ancho, absY + ancho, ancho, sizeY - ancho*2, color) end function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end function Map:draw2() if not getElementData(localPlayer,"logedin") then return end dxSetRenderTarget(self.renderTarget, true) --kozeliGPSPontokTorlese() local player = getLocalPlayer() local centerX = (self.x) + (self.w/2) local centerY = (self.y) + (self.h/2) local pr = getPedRotation(player) local mapSize = 3000 / (self.drawRange/500) local _, _, camRotZ = getElementRotation(getCamera()) self.posX, self.posY, self.posZ = getElementPosition(player) --local playerX, playerY, playerZ = getElementPosition(player) local mapPosX, mapPosY = -(math.map(self.posX+3000,0,6000,0,mapSize)-self.w/2), -(math.map(-self.posY + 3000, 0, 6000, 0, mapSize)-self.h/2) -- draw map local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawRectangle(0,0,self.w,self.h,tocolor(269,120,210,0)) dxDrawImage(mapPosX, mapPosY, mapSize, mapSize, self.map, north, -mapSize/2 - mapPosX + self.w/2, -mapSize/2 - mapPosY + self.h/2, tocolor(255,255,255,255)) for k, v in ipairs(gpsPontok) do local bx, by = v.x, v.y local w, h = 15, 15 local liX = (3000+bx) / 6000 * mapSize local liY = (3000-by) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) liX = liX + mapPosX liY = liY + mapPosY dxSetBlendMode("modulate_add") dxDrawImage (liX, liY, scaledW, scaledH,self.blips[0], north, -scaledW/2 - liX + self.w/2, -scaledH/2 - liY + self.h/2,tocolor(124, 197, 118 )) dxSetBlendMode("blend") end -- draw radar areas --[[ for i, area in ipairs (getElementsByType("radararea")) do local ex, ey = getElementPosition(area) local w, h = getRadarAreaSize(area) local areaX = (3000+ex) / 6000 * mapSize local areaY = (3000-ey) / 6000 * mapSize local scaledW = w / 6000*mapSize local scaledH = -(h / 6000*mapSize) areaX = areaX + mapPosX areaY = areaY + mapPosY local rr, gg, bb, alpha = 255,255,255,255 rr, gg, bb, alpha = getRadarAreaColor(area) if (isRadarAreaFlashing(area)) then alpha = alpha*math.abs(getTickCount()%1000-500)/500 end dxSetBlendMode("modulate_add") dxDrawImage(areaX, areaY, scaledW, scaledH,self.blips[1], north, -scaledW/2 - areaX + self.w/2, -scaledH/2 - areaY + self.h/2,tocolor(rr,gg,bb,alpha)) dxSetBlendMode("blend") end --]] local ux, uy = nil, nil -- draw blips for i, b in ipairs (getElementsByType('blip')) do -- getElementDimension(b) == getElementDimension(player) --getElementInterior(b) == getElementInterior(player) --if and getElementInterior(b) == getElementInterior(player) then local elementAttached = getElementAttachedTo ( b ) if elementAttached ~= player then local ex, ey, ez = getElementPosition(b) local blipIcon = getBlipIcon(b) local rr,gg,bb,aa = 255,255,255,255 local blipSize = self.blipSize local blipX, blipY = getRadarFromWorldPosition(ex,ey,-x*40, -y*40, self.w+x*80, self.h+y*80,mapSize) --[[ if (elementAttached) and (getElementType(elementAttached) == "vehicle") then blipSize = blipSize / 2 aa = 200 end --]] local blipIcon = getBlipIcon(b) local img = self.blips[blipIcon] dxDrawImage(blipX-blipSize/2, blipY-blipSize/2, blipSize, blipSize,img, 0,0,0,tocolor(rr,gg,bb,aa)) if (elementAttached) and (getElementType(elementAttached) == "player") and getPedOccupiedVehicle(elementAttached) and getVehicleType(getPedOccupiedVehicle(elementAttached)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "gfx/H.png",north-getPedRotation(elementAttached)) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "gfx/HR.png",getTickCount()%360) end end --end end -- draw arrow local local b = self.blipSize local ex,ey = getElementPosition(player) local blipX = (3000+ex) / 6000 * mapSize local blipY = (3000-ey) / 6000 * mapSize blipX = blipX + mapPosX blipY = blipY + mapPosY if getPedOccupiedVehicle(player) and getVehicleType(getPedOccupiedVehicle(player)) == "Helicopter" then dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "gfx/H.png",north-pr) dxDrawImage(blipX-x*50/2, blipY-y*50/2, x*50, y*50, "gfx/HR.png",getTickCount()%360) else dxDrawImage(blipX-x*23/3, blipY-y*23/3,x*15,y*15, self.blips[2], north-pr,0,0,tocolor(255,255,255,255)) end dxSetRenderTarget() local interior = getElementInterior(getLocalPlayer()) local dimensao = getElementDimension(getLocalPlayer()) -- draw render target if getElementInterior(player) == 0 then for k, v in ipairs({"radar", "area_name", "vehicle_name"}) do setPlayerHudComponentVisible(v, false) end dxDrawImage(self.x-x*17, self.y-y*9, self.w+x*33, self.h+y*18, "gfx/mapbg.png",0,0,0,tocolor(0, 0, 0, 130)) dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) else dxDrawRectangle(self.x-x*0, self.y-y*-0, self.w+x*0, self.h+y*0,tocolor(0,0,0,130)) end -- draw damage effect --[[ for k, v in ipairs(Map.damageEfect) do v[3] = v[3] - (getTickCount() - v[1]) / 800 if v[3] <= 0 then table.remove(Map.damageEfect, k) else dxDrawImage(self.x, self.y, self.w, self.h, "gfx/mapred.png", 0, 0, 0, tocolor(255, 255, 255, 255)) end end --]] end function findRotation(x1, y1, x2, y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end function getPointAway(x, y, angle, dist) local a = -math.rad(angle) dist = dist / 57.295779513082 return x + (dist * math.deg(math.sin(a))), y + (dist * math.deg(math.cos(a))) end function getRadarFromWorldPosition(bx, by, x, y, w, h, scaledMapSize) local RadarX, RadarY = x + w/2, y + h/2 local RadarD = getDistanceBetweenPoints2D(RadarX, RadarY, x, y) local px, py = getElementPosition(localPlayer) local _, _, crz = getElementRotation(getCamera()) local dist = getDistanceBetweenPoints2D(px, py, bx, by) if dist > RadarD * 6000/scaledMapSize then dist = RadarD * 6000/scaledMapSize end local rot = 180 - findRotation(px, py, bx, by) + crz local ax, ay = getPointAway(RadarX, RadarY, rot, dist * scaledMapSize/6000) return ax, ay end --[[ function onClientPlayerDamage(attacker, weapon, _, bodypart) local part = attacker and getElementType(attacker) == "player" and getPedWeaponSlot(attacker) and getPedWeaponSlot(attacker) or false if attacker and attacker ~= source and not (part == 8 or (part == 7 and weapon ~= 38)) then Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(25.5 * bodypart, 255)} else Map.damageEfect[#Map.damageEfect + 1] = {getTickCount(), 0, math.min(20 * bodypart, 255)} end if #Map.damageEfect > 18 then repeat table.remove(Map.damageEfect, 1) until #Map.damageEfect < 18 end end addEventHandler("onClientPlayerDamage", localPlayer,onClientPlayerDamage) --]] function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end error in 258 dxDrawImage(self.x, self.y, self.w, self.h, self.renderTarget,0,0,0,tocolor(unpack(self.color))) in self.renderTarget argument 5 this image : https://drive.google.com/file/d/1vAhohtOS2HXojuMDvKZjZtRboznPRncu/view?usp=sharing Bad argument @ "dxDrawImage" [Expected] at argument 5, got boolen please help i'm newbie
  15. locais screenW , screenH = guiGetScreenSize () local exibir_painel = função falsa PainelDX () dxDrawLine (( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , false ) dxDrawLine ( telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , ( telaW * 0,3807 ) - 1 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine (( telaW * 0,3807 ) - 1 , tela H * 0,7734 , telaW * 0,6208 , telaH * 0,7734 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawLine ( telaW * 0,6208 , telaH * 0,7734 , telaW * 0,6208 , ( telaH * 0,1615 ) - 1 , tocolor ( 237 , 0 , 0 , 245 ), 1 , falso ) dxDrawRectangle ( telaW * 0,3807 , telaH * 0,1615 , telaW * 0,2401 , telaH * 0,6120 , tocolor ( 3 , 0 , 0 , 153 ), falso ) dxDrawImage ( telaW * 0,4290 , telaH * 0,2227 , screenW * 0,1435 , screenH * 0.2747 , ": guieditor / images / examples / LavarMoney.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false ) dxDrawText ( "Lavagem de Dinheiro" , screenW * 0.4305 , screenH * 0,1693 , tela W * 0,5652 , tela H * 0,2005 , tocolor ( 255 , 255 , 255 , 255 ), 0,70 , "bankgothic" , "center" , "center" , false , false , false , false , false ) dxDrawText ( "O dinheiro sujo pode ser lavado 100 mil por PenDrive com Trojan" , screenW * 0,4173 , tela H * 0,5117 , tela W * 0,5798 , tela H * 0,5638 , tocolor ( 255 , 255 , 255 , 255 ), 0,50 , "bankgothic" , "center" , "center" , false , true , false , false , false ) dxDrawLine (( screenW * 0.4239 ) - 1 , ( screenH * 0.6237 ) - 1 , ( telaW * 0,4239 ) - 1 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , ( telaH * 0,6237 ) - 1 , ( telaW * 0,4239 ) - 1 , ( telaH * 0,6237 ) - 1 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine (( telaW * 0,4239 ) - 1 , telaH * 0,7018 , telaW * 0,5798 , telaH * 0,7018 , tocolor ( 255 , 3 , 3 , 254 ), 1 , falso ) dxDrawLine ( telaW * 0,5798 , telaH * 0,7018 , screenW * 0.5798, (screenH * 0.6237) - 1, tocolor(255, 3, 3, 254), 1, false) dxDrawRectangle(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781, tocolor(11, 0, 0, 203), false) dxDrawText("Lavar", screenW * 0.4231, screenH * 0.6237, screenW * 0.5798, screenH * 0.7018, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6040) - 1, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, (screenH * 0.1693) - 1, (screenW * 0.6040) - 1, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawLine((screenW * 0.6040) - 1, screenH * 0.1953, screenW * 0.6179, screenH * 0.1953, tocolor(240, 254, 3, 254), 1, false) dxDrawLine(screenW * 0.6179, screenH * 0.1953, screenW * 0.6179, (screenH * 0.1693) - 1, tocolor(240, 254, 3, 254), 1, false) dxDrawRectangle(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260, tocolor(0, 0, 0, 131), false) dxDrawText("X", screenW * 0.6032, screenH * 0.1693, screenW * 0.6179, screenH * 0.1953, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "center", "center", false, false, false, false, false) end addEvent("Exibir_Painel_Ao_Hitar_O_Marker", true) addEventHandler("Exibir_Painel_Ao_Hitar_O_Marker", root, function() if exibir_painel == false then addEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = true showCursor(true) else RemoveEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end -- Modified version for DX Text function isCursorOverText(posX, posY, sizeX, sizeY) if ( not isCursorShowing( ) ) then return false end local cX, cY = getCursorPosition() local screenWidth, screenHeight = guiGetScreenSize() local cX, cY = (cX*screenWidth), (cY*screenHeight) return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) ) end addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.6040, screenH * 0.1693, screenW * 0.0139, screenH * 0.0260) then removeEventHandler("onClientRender", getRootElement(), PainelDX) exibir_painel = false showCursor(false) end end end end) local Sujo = getElementData(source, "moneysujo") or 0 addEventHandler("onClientClick", getRootElement(), function(button, state) if button == "left" and state == "down" then if exibir_painel == true then if isMouseInPosition(screenW * 0.4239, screenH * 0.6237, screenW * 0.1559, screenH * 0.0781) then if Sujo >= 100000 and "PenDrive Com Trojan" then setElementData(source, "moneysujo", -100000) givePlayerMoney(source, givePlayerMoney(source)+100000) end end end end end) Estou fazendo um script com Painel DX e estou tendo problema na parte de limpar o dinheiro pois não está funcionando eu clicko no botão de "Lavar" e não tira os 100k de dinheiro sujo para virar 100k limpo além disso para conseguir fazer essa lavagem com o dinheiro precisa está com um PenDrive com Trojan para cada lavagem de dinheiro, ou seja, cada pendrive lava 100k alguem pode me ajudar Imagem do painel: https://uploaddeimagens.com.br/imagens/NXxdneg
  16. Olá pessoal tudo bem? sou script novo em LUA, mas sou antigo em HTML, JS e CSS. gostaria de saber como posso está fazendo uma proteção bem legal para meus scripts. Alguém poderia me ajudar?
  17. Anyone can send me a working yt mp3 converter API? Or how to create one, to play music from youtube on my server?
  18. Hello Guys , I'm ScoomaAli From Morocco , Today i want to show you my new project , FiveM Backup In Mta This is a screen from it
  19. Eu sou novo no fórum e novo em script em lua, queria saber qual o problema que o meu script de limpar chat não funciona, o que eu quero fazer é com que a ACL Staff consiga usar o comando... ( esse é o server side ) function limpar(player) local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Staff")) then outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") triggerClientEvent(root, "limparchat", root, getPlayerName( player ) ) else outputChatBox("Você não tem acessa a este comando !", player, 255, 100, 100, true) end end addCommandHandler("chat", limpar) (EDIT) O Erro do debug é este abaixo
  20. Hello Everyone, Can someone know about how to detect auto keypresses in mtasa, can we kick or something the person who user auto key presser automatically. Hope you give some solution for it.. Thank you.
  21. boa tarde, Gostaria de saber se existe algum sistema que identifica quando o jogador nao esta dentro no MTA, pois os jogadores consegue bugar no servidor quando minimiza o MTA e volta, mais ja usei o onClientMinimize, porem quando o jogador usa em modo janela, ele consegue fica hora do MTA e assim conseguindo usar o xlag ou ate mesmo fazendo algum bug para fazer com que o MTA apareça "O programa não responde". Queria saber se existe alguma função que identifica quando o jogador nao esta usando o MTA.
  22. Boa Tarde, Gostaria de saber qual função eu uso para o player perder vida quando esta pegando fogo em si mesmo. Pois to fazendo um bot que faz ele usa a arma com ID 37 (lança chamas), mais quando acerta no player, nao conta dano. E gostaria de saber como faço para contar dano.
  23. Boa noite, Estou fazendo um sistema de bot que atira na direção do player, esta funcionando tudo certo. Mais ele esta atirando muito para cima, na mesma direção mas, só que para cima, vou enviar uma print mostrando. Qual função posso usar para abaixar o tiro do ped https://ibb.co/s3BMdDX
  24. I want to create a system that could load another player
  25. Welcome to my store If you want to buy from Turkey, please contact me on Discord (Hexon#0388) Contacts Discord: Hexon#0388 E-mail: [email protected] YouTube: https://www.youtube.com/hexondev Facebook: https://www.facebook.com/hexondev If you found a bug please ontat me on Discord (Hexon#0388) [MTA:SA] Fire system 0.2 (UPDATED AT 05/02/2021) [MTA:SA] WhatsApp messenger [MTA:SA] Animation system with custon anim support & anim circle [MTA:SA] Taximeter [MTA:SA] Car trailer [MTA:SA] Scratch card game [MTA:SA] Spinner with new design [MTA:SA] Pointing system [MTA:SA] Spike system (Free) [MTA:SA] Weapon skin panel [MTA:SA] Garbage collector job (Bone attach required!) [MTA:SA] Trucker job [MTA:SA] Container carrier job (FREE) [MTA:SA] Container crane job [MTA:SA] Attachment system [MTA:SA] Drone system [MTA:SA] Lightbar editor with multiple lightbar support and custom siren sound [MTA:SA] Lightbar editor with multiple lightbar support [MTA:SA] Lightbar editor with custom siren sound [MTA:SA] Lightbar editor [MTA:SA] CSGO style spinner
×
×
  • Create New...