Jump to content

Hiuguer

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Hiuguer's Achievements

Member

Member (5/54)

0

Reputation

  1. Can you send me this code you sent me inserted in the middle of my code? I don't know where to insert
  2. I have a tuning system and I wanted to save the upgrades in the Save-System, here is the "s.lua" file of the save system. I tried to do with setAccountData(account, "vehicleupgrade", getVehicleUpgrades(source, 13)) But it did not work function saveAccountData ( account ) if isGuestAccount ( account ) then return false end local x,y,z = getElementPosition (source) setAccountData (account, "money1", tostring (getPlayerMoney (source))) setAccountData (account, "skin", tostring (getPedSkin (source))) setAccountData (account, "health", tostring (getElementHealth (source))) setAccountData (account, "armor", tostring (getPedArmor (source))) setAccountData (account, "x", x) setAccountData (account, "y", y) setAccountData (account, "z", z) setAccountData (account, "int", getElementInterior (source)) setAccountData (account, "dim", getElementDimension (source)) setAccountData (account, "wantedlevel", getPlayerWantedLevel (source)) setAccountData (account, "weaponID0", getPedWeapon (source, 0)) setAccountData (account, "weaponID1", getPedWeapon (source, 1)) setAccountData (account, "weaponID2", getPedWeapon (source, 2)) setAccountData (account, "weaponID3", getPedWeapon (source, 3)) setAccountData (account, "weaponID4", getPedWeapon (source, 4)) setAccountData (account, "weaponID5", getPedWeapon (source, 5)) setAccountData (account, "weaponID6", getPedWeapon (source, 6)) setAccountData (account, "weaponID7", getPedWeapon (source, 7)) setAccountData (account, "weaponID8", getPedWeapon (source, 8)) setAccountData (account, "weaponID9", getPedWeapon (source, 9)) setAccountData (account, "weaponID10", getPedWeapon (source, 10)) setAccountData (account, "weaponID11", getPedWeapon (source, 11)) setAccountData (account, "weaponID12", getPedWeapon (source, 12)) setAccountData (account, "weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "weaponAmmo8", getPedTotalAmmo (source, 8)) setAccountData (account, "weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "weaponAmmo12", getPedTotalAmmo (source, 12)) --setAccountData (account, "vehicleupgrade", getVehicleUpgrades (source, 13)) return true end addEventHandler ( 'onPlayerLogin', root, function ( _,acc ) if isGuestAccount ( acc ) then return end local accountData = getAccountData (acc, "money1") if (accountData) then local playerMoney = getAccountData (acc, "money1") local playerSkin = getAccountData (acc, "skin") local playerHealth = getAccountData (acc, "health") local playerArmor = getAccountData (acc, "armor") local playerX = getAccountData (acc, "x") local playerY = getAccountData (acc, "y") local playerZ = getAccountData (acc, "z") local playerInt = getAccountData (acc, "int") local playerDim = getAccountData (acc, "dim") local playerWanted = getAccountData (acc, "wantedlevel") local playerTeam = getAccountData (acc, "Team") local playerWeaponID0 = getAccountData (acc, "weaponID0") local playerWeaponID1 = getAccountData (acc, "weaponID1") local playerWeaponID2 = getAccountData (acc, "weaponID2") local playerWeaponID3 = getAccountData (acc, "weaponID3") local playerWeaponID4 = getAccountData (acc, "weaponID4") local playerWeaponID5 = getAccountData (acc, "weaponID5") local playerWeaponID6 = getAccountData (acc, "weaponID6") local playerWeaponID7 = getAccountData (acc, "weaponID7") local playerWeaponID8 = getAccountData (acc, "weaponID8") local playerWeaponID9 = getAccountData (acc, "weaponID9") local playerWeaponID10 = getAccountData (acc, "weaponID10") local playerWeaponID11 = getAccountData (acc, "weaponID11") local playerWeaponID12 = getAccountData (acc, "weaponID12") local playerWeaponAmmo0 = getAccountData (acc, "weaponAmmo0") local playerWeaponAmmo1 = getAccountData (acc, "weaponAmmo1") local playerWeaponAmmo2 = getAccountData (acc, "weaponAmmo2") local playerWeaponAmmo3 = getAccountData (acc, "weaponAmmo3") local playerWeaponAmmo4 = getAccountData (acc, "weaponAmmo4") local playerWeaponAmmo5 = getAccountData (acc, "weaponAmmo5") local playerWeaponAmmo6 = getAccountData (acc, "weaponAmmo6") local playerWeaponAmmo7 = getAccountData (acc, "weaponAmmo7") local playerWeaponAmmo8 = getAccountData (acc, "weaponAmmo8") local playerWeaponAmmo9 = getAccountData (acc, "weaponAmmo9") local playerWeaponAmmo10 = getAccountData (acc, "weaponAmmo10") local playerWeaponAmmo11 = getAccountData (acc, "weaponAmmo11") local playerWeaponAmmo12 = getAccountData (acc, "weaponAmmo12") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 50, 1, source, playerHealth) setTimer (setPedArmor, 50, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 50, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) setCameraTarget (source, source) fadeCamera(source, true, 2.0) outputChatBox ( '', source, 255, 255, 255, true ) else local save = saveAccountData ( acc ) if save then outputChatBox ( '', source, 255, 255, 255, true ) outputChatBox ( '', source, 255, 255, 255, true ) setTimer ( function ( ) outputChatBox ( '', source, 255, 255, 255, true ) end, 3500, 1 ) else outputChatBox ( '', source, 255, 255, 255, true ) outputChatBox ( '', source, 255, 255, 255, true ) end end end ) addEventHandler ( 'onPlayerLogout', root, function (accPlr) givePlayerMoney (source,1) setTimer (takePlayerMoney,10000,1,source,1) saveAccountData ( accPlr ) outputChatBox ( '', source, 255, 255, 255, true ) end ) addEventHandler ( 'onPlayerQuit', root, function () local accQuit = getPlayerAccount ( source ) saveAccountData ( accQuit ) end ) function setTeam(_,acc3) local team = getAccountData (acc3, "team") if team and getTeamFromName(team) then setPlayerTeam(source, getTeamFromName(team)) -- outputChatBox ("Team set") end end addEventHandler("onPlayerLogin",getRootElement(),setTeam) function saveTeam() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if (team) and not isGuestAccount(account) then setAccountData(account, "team", getTeamName(team)) end end addEventHandler("onPlayerQuit",getRootElement(),saveTeam) addEventHandler ( 'onPlayerLogout', root,saveTeam) function saveWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local stats = "" for stat=69, 81 do local value = getPedStat(player, stat) stats = stats ..",".. stat ..";".. value end setAccountData(account, "weaponStats", stats) for stat=21, 24 do local value = getPedStat(player, stat) stats = stats ..",".. stat ..";".. value end setAccountData(account, "playerStats", stats) end end addEventHandler("onPlayerQuit",root,function () saveWeaponStats(source) end) function loadWeaponStats(player) if (not player or not isElement(player)) then return end local account = getPlayerAccount(player) if (account and not isGuestAccount(account)) then local statsData = getAccountData(account,"weaponStats") local stats = split(statsData, ",") for k, v in ipairs(stats) do local stat = split(v, ";") setPedStat(player, tonumber(stat[1]), tonumber(stat[2])) end local statsData = getAccountData(account,"playerStats") local stats = split(statsData, ",") for k, v in ipairs(stats) do local stat = split(v, ";") setPedStat(player, tonumber(stat[1]), tonumber(stat[2])) end end end addEventHandler("onPlayerLogin",root,function () loadWeaponStats(source) end) --[[ original script by Justus (GA_Justus) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) addEventHandler ( 'onPlayerLogout', root,saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " or textures[i+1] ~= nil ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("", source, 0, 255, 0) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes)
  3. I have two MarkerCustom mods, the first one changes all markers, the other one has the marker I want but doesn't change them all, I wanted someone to merge these two mods into one --Marker client file that replaces all markers in the city addEventHandler("onClientResourceStart", resourceRoot, function() shwaeki = dxCreateShader( "Arquivos/Castiel.fx" ) texture = dxCreateTexture("Arquivos/marker.png") dxSetShaderValue(shwaeki, "MarkerSkin", texture) engineApplyShaderToWorldTexture(shwaeki, "cj_w_grad") end ) -- Client file of the marker I want anim_tick = getTickCount() local maxDist = 5 local renderCache = {} setTimer( function() renderCache = {} local px,py,pz = getElementPosition(localPlayer) for k, v in pairs(radarMarkers) do local id, img, marker, r, g, b, cicle, rc, gc, bc = unpack(v) if marker and isElement(marker) then local x,y,z = getElementPosition(marker) local dist = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if dist <= maxDist then local x, y, z = getElementPosition(marker) local sx, sy = getScreenFromWorldPosition(x, y, z) if sx and sy then setElementData(marker, "marker:custom", id) if getElementData(marker, "marker:custom") == id then renderCache[k] = v renderCache[k]["id"] = id renderCache[k]["img"] = dxCreateTexture(img) renderCache[k]["imgcicle"] = dxCreateTexture(cicle) renderCache[k]["colorimg"] = {r, g, b} renderCache[k]["colorcicle"] = {rc, gc, bc} end end end end end end, 500, 0) addEventHandler("onClientResourceStart", resourceRoot, function() for k,v in pairs(getElementsByType("marker", _, true)) do if getElementData(v, "marker:custom") then getMarkerCustom() end end end ) function getMarkerCustom() local progress = ((getTickCount() - anim_tick) / 3000) local Op1, Op2 = interpolateBetween(0.4, 1.4, 0, 0.7, 1.7, 0, progress, "SineCurve") local Op3, Op4, Op5 = interpolateBetween(0.8, 0.8, 1.6, 1.0, 1.0, 2.1, progress, "SineCurve") local px, py, pz, l1, l2, l3 local px, py, pz = getCameraMatrix() for _, marker in ipairs(getElementsByType 'marker') do if getElementData(marker, "marker:custom") then setMarkerColor(marker, 0, 0, 0, 0) local l1, l2, l3 = getElementPosition(marker) local dist = math.sqrt((px + l1) ^ 0 + (py + l2) ^ 0 + (pz + l3) ^ 0) local r, g, b = getMarkerColor(marker) if dist < 20 then if isLineOfSightClear(px, py, pz, l1, l2, l3, false, false, false, true, false, false, false, localPlayer) then local x,y = getScreenFromWorldPosition(l1, l2, l3) if x then for name, data in pairs(renderCache) do local id, img, marker2, r, g, b, cicle = unpack(data) if getElementData(marker, "marker:custom") == id then dxDrawMaterialLine3D (l1, l2, l3 + Op1 + 0.4, l1, l2, l3 + Op2 + 0.4, data["img"], 1, tocolor(data["colorimg"][1], data["colorimg"][2], data["colorimg"][3], 255)) dxDrawMaterialLine3D (l1, l2 - Op3 + 0.3, l3 + 0.03, l1, l2 + Op4 - 0.3, l3 + 0.03, data["imgcicle"], Op5 - 0.7, tocolor(data["colorcicle"][1], data["colorcicle"][2], data["colorcicle"][3], 255), 0, 0, -1730900) end end end end end end end end addEventHandler("onClientRender", root, getMarkerCustom) assets/tipos/1.png assets/circulos/1.png (The marker files I want) The marker I want
  4. Players on my server can't crouch or shoot, what could it be?
  5. I need help with my business system not working
  6. Have you already added this in the code? If not, could you add it, upload it and send it to me? I'm very layman about it I have no idea where to add this, or could you tell me which file it is in
  7. I know you're trying to help, I activated this on my server and it keeps running errors, there's no time to print the error, can you do that?
  8. I didn't find it, I'll send the whole file https://mega.nz/folder/oIMDmaJK#9g4MvSdNrP09n2cPj1Utew
  9. Can I send you the whole file?
  10. The script sells the car but the buyer can't pick it up and the owner keeps the car, can anyone help? addCommandHandler(Config["SELL"], function(player, _, id) if getElementType(player) == "player" then local model = getElementModel(getPedOccupiedVehicle(player)) if id then local pID = getPlayerFromID(tonumber(id)) if pID then iprint(pID) local query = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Model = ?", tonumber(model)), -1) if vehicleConces[pID] then return dxMsg(player, "O Jogador já possuí um veículo spawnado na cidade.", "error") end if query and #query > 0 then for i = 1, #query do iprint(query["Chassi"], getElementData(vehicleConces[player])) if query["Chassi"] == getElementData(vehicleConces[player], "Yammy.vehicleBank") then local Chassi = query["Chassi"] local query_02 = dbPoll(dbQuery(database, "SELECT * FROM playersConce WHERE Model = ? AND Chassi = ?", tonumber(model), query["Chassi"]), -1) if query and #query_02 > 0 then iprint("vendido",getVehicleType(vehicleConces[player])) if getVehicleType(vehicleConces[player]) == "Bike" then for i,v in ipairs(Config.VEICULOS.MOTOS) do if Config.VEICULOS.MOTOS.model == model then iprint(Config.VEICULOS.MOTOS.model, model, Chassi) local sucess = dbExec(database, "DELETE FROM playersConce WHERE Model = ? AND Chassi = ?", Config.VEICULOS.MOTOS.model, Chassi) local sucess1 = dbExec(database, "INSERT INTO playersConce (Conta,Model,Veiculo,Chassi) VALUES (?,?,?,?)", getAccountName(getPlayerAccount(pID)), tonumber(model), Config.VEICULOS.MOTOS.nome, Chassi) iprint("DELTADO:",sucess,"ENVIADO:",sucess1) iprint("Jogador que comprou",getAccountName(getPlayerAccount(pID)), tonumber(model), Chassi) if sucess and sucess1 then vehicleConces[pID] = vehicleConces[player] vehicleConces[player] = nil dxMsg(player, "Você vendeu seu veículo com sucesso.", "success") dxMsg(pID, "Você recebeu um veículo.", "success") end end end else for i,v in ipairs(Config.VEICULOS.CARROS) do if Config.VEICULOS.CARROS.model == model then local sucess = dbExec(database, "DELETE FROM playersConce WHERE Model = ? AND Chassi = ?", tonumber(model), qChassi) local sucess1 = dbExec(database, "INSERT INTO playersConce (Conta,Model,Veiculo,Chassi) VALUES (?,?,?,?)", getAccountName(getPlayerAccount(pID)), tonumber(model), Config.VEICULOS.CARROS.nome, Chassi) iprint("DELTADO:",sucess,"ENVIADO:",sucess1) iprint("Jogador que comprou",getAccountName(getPlayerAccount(pID)), tonumber(model), Chassi) if sucess and sucess1 then vehicleConces[pID] = vehicleConces[player] vehicleConces[player] = nil dxMsg(player, "Você vendeu seu veículo com sucesso.", "success") dxMsg(pID, "Você recebeu um veículo.", "success") end end end end end end end end else dxMsg(player, "O(A) ID inserido não foi encontrado!", "warning") end else dxMsg(player, "Você não inseriu o ID do(a) jogador(a) desejado.", "info") end end end ) Anything I can send the whole script
×
×
  • Create New...