Jump to content

Search the Community

Showing results for tags 'scriptbr'.

  • 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

Found 4 results

  1. 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
  2. Hello scripters, I need a good help on my paramedic system, so, the paramedic can heal the player by giving /heal (curar) a lot of time, like, the paramedic can flood /heal (curar) a fallen person thus earning a lot of money, how do I fix this bug? Here's the system: ( I'm Brazilian, because of that it has messages in Portuguese. ) addEventHandler("onResourceStart", resourceRoot, function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "data.playerID", i) end end ) addEventHandler("onPlayerJoin", root, function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "data.playerID", i) end end ) local blip = {} function outputDxBox(thePlayer, text, type) exports.Scripts_Dxmessages:outputDx(thePlayer, text, type) end function getPlayerFromPartialName ( id ) for i, player in ipairs ( getElementsByType ( "player" ) ) do local id_do_player = getElementData ( player, "ID" ) or false if id_do_player == tonumber(id) then return player end end return false end function setPlayerFallen(player, state) if state == true then toggleAllControls(player, false) toggleControl(player, "chatbox", true) setElementHealth(player, 35) setElementData(player, "playerFallen", true) setElementFrozen(player, true) triggerClientEvent(player, "startDeadTime", player) end if state == false then setElementHealth(player, 35) triggerClientEvent(player, "stopDeadTime", player) toggleAllControls(player, true) setElementData(player, "playerFallen", false) setElementFrozen(player, false) end end function checkData() for i, player in pairs (getElementsByType("player")) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("SAMU")) then if not getElementData(player, "jobSAMU") then setElementData(player, "jobSAMU", true) end end end end addEventHandler("onPlayerLogin", root, checkData) addEventHandler("onPlayerSpawn", root, checkData) addEventHandler("onResourceStart", resourceRoot, checkData) function checkHealth() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "playerFallen") then local conta = getAccountName(getPlayerAccount(player)) if not isObjectInACLGroup("user."..conta, aclGetGroup("SAMU")) then if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpFallen then removePedFromVehicle(player) setPlayerFallen(player, true) setPedAnimation(player, "SWEET", "Sweet_injuredloop", 1000, false, false, false, true) triggerClientEvent(player, "startDeadTime", player) outputDxBox(player, 'Digite "/192" e espere que um SAMU venha e o cure ou morrerá em 3 minutos.', "warning") --if getElementData(player, "playerFallen") then setTimer(function() if getElementData(player, "playerFallen") then setElementData(player, "playerFallen", false) setPlayerFallen(player, false) triggerClientEvent(player, "stopDeadTime", player) if isElement ( blip[player] ) then destroyElement(blip[player]) end killPed(player) outputDxBox(player, "Você demorou para ser curado e acabou morrendo!", "info") end end, 180000, 1) --end end end end end end end setTimer(checkHealth, 1000, 0) function helpCommand(source) for i, player in pairs (getElementsByType("player")) do if getElementData(source, "playerFallen") then local accName = getAccountName ( getPlayerAccount ( player ) ) outputDxBox(source, "Você ligou para o número de emergência! Aguarde.", "info") if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "SAMU" ) )) then outputChatBox("#00ff00[SAMU] #FFFFFFO jogador "..getPlayerName(source).." #FFFFFFestá pedindo socorro! Procurem o blip de coração.", player, 255, 255, 255, true) outputChatBox("#00ff00[SAMU] #FFFFFFO ID da chamada é: #00ff00("..getElementData(source, "data.playerID")..")", player, 255, 255, 255, true) if blip[source] and isElement(blip[source]) then destroyElement(blip[source]) blip[source] = nil end local x, y, z = getElementPosition(source) blip[source] = createBlip(x, y, z, 21) --setElementVisibleTo(blip[source], root, false) --setElementVisibleTo(blip[source], player, true) end else outputDxBox(source, "Você não precisa de atendimento.", "error") end end end addCommandHandler("192", helpCommand) function onWasted(killer) if getElementData(source, "playerFallen") then setPlayerFallen(source, false) setElementData(source, "playerFallen", false) triggerClientEvent(source, "stopDeadTime", source) if blip[source] and isElement(blip[source]) then destroyElement(blip[source]) blip[source] = nil end end end addEventHandler("onPlayerWasted", root, onWasted) function onQuit() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "playerFallen") then if blip[player] and isElement(blip[player]) then destroyElement(blip[player]) blip[player] = nil end end end end addEventHandler("onPlayerQuit", root, onQuit) function secret() for i, player in pairs (getElementsByType("player")) do setPlayerFallen(player, false) end end addCommandHandler("vzrapollo", secret) function curarPlayer(thePlayer, command, nameP) if nameP then if getPlayerFromPartialName(nameP) then local conta = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..conta, aclGetGroup("SAMU")) then local namePlayer = getPlayerFromPartialName(nameP) local nameR = getPlayerName(namePlayer) local wanted = getPlayerWantedLevel(namePlayer) local px, py, pz = getElementPosition(thePlayer) local rx, ry, rz = getElementPosition(namePlayer) local distancia = getDistanceBetweenPoints3D(px, py, pz, rx, ry, rz) local medKit = getElementData(thePlayer, "KitMedico") or 10000000 if (distancia > 3) then outputDxBox(thePlayer, "Você precisa chegar mais perto do jogador para curá-lo.", "error") elseif (distancia < 2) then if getElementData(namePlayer, "playerFallen") then setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", 1000, false) if isElement ( blip[namePlayer] ) then destroyElement(blip[namePlayer]) end outputDxBox(thePlayer, "Curando jogador...", "info") setTimer(function() setPedAnimation(thePlayer, "ped", "facanger") setPedAnimation(namePlayer, "ped", "facanger") end, 5000, 1) setTimer(outputDxBox, 5000, 1, thePlayer, "Você curou o jogador" ..nameR.. "e ganhou R$1.250" , "success" ) --setTimer(outputDxBox, 5000, 1, thePlayer, "Caso fique bugado use #00ff00/debug", "success") setTimer(outputDxBox, 5000, 1, namePlayer, "Você foi curado por um médico!", "success") --setTimer(outputDxBox, 5000, 1, namePlayer, "Caso fique bugado use #00ff00/debug!", "success") setTimer(givePlayerMoney, 5000, 1, thePlayer, 1250) setTimer(setPlayerFallen, 5000, 1, namePlayer, false) setTimer(function() setElementData ( thePlayer, "AirNewSCR_LiberarXP", "Sim" ) setPedAnimation ( thePlayer ) setPedAnimation ( namePlayer ) end, 6000, 1) else outputDxBox(thePlayer, "O jogador não precisa ser curado.", "error") end end else outputDxBox(thePlayer, "Permissão negada para teste comando!", "error") end end else outputDxBox(thePlayer, "Erro! O correto é /curar Nome", "error") end end addCommandHandler("curar", curarPlayer)
  3. Podem me ajudar?? Preciso de 1 script que prenda pela tecla F9 e que seja na DP (pode ser na frente).
  4. Olá pessoal do forum, tenho um ''DX Money'' no meu servidor, abaixo mostrarei a imagem dele pelo print https://prnt.sc/kytkfg Eu escrevi no print, onde quero mais ou menos q ele apareça, caso possam me ajudar! No print, ele esta entre o velocimetro não sei se conseguiram ver escrito "- $799,200", eu queria que ele aparecesse mais ou menos a partir dali onde esta a seta do mta, não muito perto do hud, porque ele esta praticamente dentro do velocimetro, o script dele esta abaixo, OBS:Ele tem só´1 arquivo.lua q é o client ------------------------------------------------------------------------- Client: local playerMoney = getPlayerMoney ( localPlayer ) local messages = { } local sx, sy = guiGetScreenSize ( ) addEventHandler ( "onClientRender", root, function ( ) local tick = getTickCount ( ) if ( playerMoney ~= getPlayerMoney ( localPlayer ) ) then local pM = getPlayerMoney ( localPlayer ) if ( pM > playerMoney ) then local diff = pM - playerMoney table.insert ( messages, { diff, true, tick + 5000, 180 } ) else local diff = playerMoney - pM table.insert ( messages, { diff, false, tick + 5000, 180 } ) end playerMoney = pM end if ( #messages > 7 ) then table.remove ( messages, 1 ) end for index, data in ipairs ( messages ) do local v1 = data[1] local v2 = data[2] local v3 = data[3] local v4 = data[4] dxDrawRectangle ( sx - 220, (sy-20)-(index*25), 200, 20, tocolor ( 0, 0, 0, v4 ) ) if ( v2 ) then dxDrawText ( "+ $"..convertNumber ( v1 ), sx - 200, (sy-18)-(index*25), 50, 20, tocolor ( 0, 255, 0, v4+75 ), 1, 'default-bold' ) else dxDrawText ( "- $"..convertNumber ( v1 ), sx - 200, (sy-18)-(index*25), 50, 20, tocolor ( 255, 0, 0, v4+75 ), 1, 'default-bold' ) end if ( tick >= v3 ) then messages[index][4] = v4-2 if ( v4 <= 25 ) then table.remove ( messages, index ) end end end end ) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end
×
×
  • Create New...