EW1611

Members
  • Content Count

    81
  • Joined

  • Last visited

Everything posted by EW1611

  1. Já resolvi com o guiGridListClear quando fechar o painel
  2. Já tentei adicionar os players quando abrir o painel, mas ele adiciona de novo todos os players onlines
  3. Criei uma gridlist no lado client, quero que ela mostre todos os players com uma data especifica, porém, ou ele não atualiza quando o player entra, ou adiciona dnv todos os players onlines, local players = getElementsByType("player") for k,v in ipairs(players) do local row = guiGridListAddRow(grid1) --grid1 is your grid... guiGridListSetItemText(grid1, row, 1,getPlayerName(v), false, false) end
  4. Gostaria de cria uma table para cada player, para salvar vários dados, isso seria possível? Se sim, teria q fazer um banco de dados, pensei em MySql
  5. Fiz o seguinte script: function pegarArma(player, commandName, arma) if arma then if arma == "ak" or "mp5" or "colt" then iprint("Comando certo") end else outputChatBox("Arma invalída! Use: 'ak' ou 'mp5' ou 'colt' ") end end addCommandHandler("retirar",pegarArma) Porem, mesmo se eu usar /retirar e um parametro diferente, ele ainda da como "comando certo" no debugscript, alguem sabe dizer o que eu fiz de errado?
  6. Tinha visto em um script, foi usado algo tipo isso: data[1]["Valor"], eu teria que fazer algo assim ou diferente
  7. Olá, modifiquei um script pra q ele salvasse um valor em um arquivo .db, queria saber como poderia fazer para pegar esse valor, e atualiza-lo, ja vi alguns tutoriais mas não entendi certinho como faz isso estaria certo para pegar esse valor? local data2 = dbPoll(dbQuery(db, "SELECT * FROM MoneySF WHERE BancoSF = ?", -1) db2 = dbConnect("sqlite", "SF.db") dbExec(db2,"CREATE TABLE IF NOT EXISTS MoneySF (BancoSF)")
  8. da o seguinte erro, nos dois: Bad argument @ 'removeEventHandler' [Expected element at argument 2]
  9. a parte do getPedOccupiedVehicle e getElementData funcionou, obrigado, porém continua com o mesmo erro no removeEventHandler
  10. fiz o seguinte script, porém da erro no getPedOccupiedVehicle, no getElementData e no removeEventHandler. Alguém sabe dizer qual o erro? function entrega2(hitElement, matchingDimension ) local v = getPedOccupiedVehicle(hitElement) if getElementData(v,"Carregado") == true then setElementFrozen(v,true) outputChatBox("Espere o veículo ser descarregado!",hitElement,0,0,150) setElementData(v,"Carregado",false) destroyElement(finalm2) destroyElement(blip2) setTimer(function (hitElement, matchingDimension ) if isElementFrozen(hitElement) == true then setElementFrozen(hitElement,false) givePlayerMoney(hitElement,math.random(1500,3500)) removeEventHandler("onVehicleExit",source,remove2) end end,3500,1,hitElement) removeEventHandler("onMarkerHit",source,entrega2) end end
  11. Coloquei a função do timer dentro da entrega3, porem agora da um erro no givePlayerMoney, de elemento inválido
  12. Agora, adicionei um timer com outra função, porem da erro que ele não acha os elementos function entrega3(hitElement, matchingDimension) local v = getPedOccupiedVehicle (hitElement) setElementFrozen(v,true) setTimer(descongelar,3500,1) removeEventHandler("onMarkerHit",source,entrega3) end function descongelar(thePlayer) local v = getPedOccupiedVehicle(thePlayer) if isElementFrozen(v) == true then setElementFrozen(v,false) givePlayerMoney(thePlayer,math.random(1500,3500)) end end
  13. olá, criei um marker em uma função, que adicionei um addEventHandler para esse marker em outra função, e nessa outra função, queria destruí-lo como está no script abaixo function pegarcarrocar(thePlayer) local finalm = createMarker(1323.237, 207.215, 18.55,"cylinder",3.5,100,0,0,255,thePlayer) --DIllimore createBlipAttachedTo(finalm,0,2,255,0,0,255,0,99999,thePlayer) addEventHandler("onMarkerHit",finalm,entrega1) outputChatBox("Leve o veículo até o lugar marcado no mapa!", thePlayer, 0, 0, 150, true ) end function entrega1(player) destroyElement(finalm) removeEventHandler("onMarkerHit",finalm,entrega1) end
  14. Alguém consegue me dar uma luz? os resources que davam o erro agora não dão mais, porém os novos que são adicionados dão o erro, já fui no endereço pelo navegador e pelo navegador baixa certinho mas ingame não
  15. Olá, to ajudando em um servidor, dps de um tempo começou a dar alguns erros: "Download error: HTTP server file mismatch" e "External HTTP file mismatch (Retrying this file with internal HTTP)" o servidor é de host, como poderia fazer para arrumar isso?
  16. Essa é uma parte do código da hud que estou usando, o código inteiro é esse: local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = math.floor(getElementHealth(localPlayer)) local level = getElementData(getLocalPlayer(), "Level") or 0 local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") exports["blur"]:dxDrawBluredRectangle(x*1180, y*50-25, x*180, y*35, tocolor(255, 255, 255, 255)) exports["blur"]:dxDrawBluredRectangle(x*1180, y*100-25, x*180, y*35, tocolor(255, 255, 255, 255)) exports["blur"]:dxDrawBluredRectangle(x*1180, y*150-25, x*180, y*35, tocolor(255, 255, 255, 255)) exports["blur"]:dxDrawBluredRectangle(x*1180, y*200-25, x*180, y*35, tocolor(255, 255, 255, 255)) exports["blur"]:dxDrawBluredRectangle(x*1000, y*50-25, x*160, y*35, tocolor(255, 255, 255, 255)) exports["blur"]:dxDrawBluredRectangle(x*1040, y*100-25, x*120, y*35, tocolor(255, 255, 255, 255)) dxDrawRectangle(x*1180, y*50-25, x*180, y*35, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*1180, y*100-25, x*180, y*35, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*1180, y*150-25, x*180, y*35, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*1180, y*200-25, x*180, y*35, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*1000, y*50-25, x*160, y*35, tocolor(0, 0, 0, 150), false) dxDrawRectangle(x*1040, y*100-25, x*120, y*35, tocolor(0, 0, 0, 150), false) dxDrawText(" "..(getElementData(localPlayer,"fome") or 0),x*1015+5, y*60-25, x*1470+5, y*30, tocolor(255, 255, 255, 230), 1.05, font, "left", "top", false, false, false, true, false) dxDrawText(" "..(getElementData(localPlayer,"sede") or 0),x*1085+10, y*60-25, x*1540+10, y*30, tocolor(255, 255, 255, 230), 1.05, font, "left", "top", false, false, false, true, false) dxDrawLine(x*1360, y*85-25, x*1180, y*85-25, tocolor(255, 0, 0, 150), 3, false) dxDrawLine(x*1360, y*135-25, x*1180, y*135-25, tocolor(255, 0, 0, 150), 3, false) dxDrawLine(x*1360, y*185-25, x*1180, y*185-25, tocolor(255, 0, 0, 150), 3, false) dxDrawLine(x*1360, y*235-25, x*1180, y*235-25, tocolor(255, 0, 0, 150), 3, false) dxDrawLine(x*1000, y*85-25, x*1160, y*85-25, tocolor(255, 0, 0, 150), 3, false) dxDrawLine(x*1040, y*135-25, x*1160, y*135-25, tocolor(255, 0, 0, 150), 3, false) dxDrawImage(x*1185+20, y*57-25, x*22, y*22, "files/img/name.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185+90, y*57-25, x*22, y*22, "files/img/colete.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*108-25, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1184, y*155-25, x*25, y*25, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*205-25, x*25, y*25, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1005+5, y*55-25, x*27, y*27, "files/img/exp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1015+70, y*55-25, x*27, y*27, "files/img/sede.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1042, y*105-25, x*27, y*27, "files/img/level.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1210, y*160-25, x*1132, y*37, tocolor(255, 255, 255, 230), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1215, y*210-25, x*150, y*23, tocolor(255, 255, 255, 230), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText(" Nivel: " ..(getElementData(getLocalPlayer(), "Level") or 0), x*1050, y*110-25, x*150, y*37, tocolor(255, 255, 255, 255), 0.9, font, "left", "top", false, false, false, true, false) dxDrawText(realName, x*1215+20, y*62-28, x*1220+40, y*30, tocolor(255, 255, 255, 255), 1.05, font, "left", "top", false, false, false, true, false) dxDrawText(getPedArmor(localPlayer), x*1215+90, y*62-28, x*1220+40, y*30, tocolor(255, 255, 255, 255), 1.05, font, "left", "top", false, false, false, true, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(""..(getElementData ( localPlayer, "Emprego") or "Desempregado"), x*1215, y*112-25, x*1132, y*37, tocolor(255, 255, 255, 230), x*0.9, font, "left", "top", false, false, false, false, false) end end function toggleF11() if isVisible then addEventHandler("onClientRender", root, f_hud) else removeEventHandler("onClientRender", root, f_hud) end isVisible = not isVisible end bindKey ("F11", "down", toggleF11) function setHud() addEventHandler("onClientRender", getRootElement(), f_hud) setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) setPlayerHudComponentVisible("radar", false) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), setHud) addEventHandler("onPlayerJoin", getResourceRootElement(getThisResource()), setHud) addEventHandler("onPlayerSpawn", getResourceRootElement(getThisResource()), setHud) addEventHandler("onPlayerWasted", getResourceRootElement(getThisResource()), setHud) addEventHandler("onPlayerJoin", 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) setPlayerHudComponentVisible("radar", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), removeHud) 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 function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end ------------------------------------------------------------------------ [[ RETIRAR HUD ORIGINAL ]] ------------------------------------------------------------------------ --[[function hideall(player) showPlayerHudComponent ( "ammo", false ) showPlayerHudComponent ( "area_name", false ) showPlayerHudComponent ( "armour", false ) showPlayerHudComponent ( "breath", false ) showPlayerHudComponent ( "clock", false ) showPlayerHudComponent ( "health", false ) showPlayerHudComponent ( "money", false ) showPlayerHudComponent ( "vehicle_name", false ) showPlayerHudComponent ( "weapon", false ) showPlayerHudComponent ( "radio", false ) showPlayerHudComponent ( "radar", false ) showPlayerHudComponent ( "wanted", false ) end addEventHandler ( "onClientResourceStart", getRootElement(), hideall ) function showall(player) showPlayerHudComponent ( "ammo", true ) showPlayerHudComponent ( "area_name", true ) showPlayerHudComponent ( "armour", true ) showPlayerHudComponent ( "breath", true ) showPlayerHudComponent ( "clock", true ) showPlayerHudComponent ( "health", true ) showPlayerHudComponent ( "money", true ) showPlayerHudComponent ( "vehicle_name", true ) showPlayerHudComponent ( "weapon", true ) showPlayerHudComponent ( "radio", true ) showPlayerHudComponent ( "radar", true ) showPlayerHudComponent ( "wanted", false ) end addEventHandler ( "onClientResourceStop", resourceRoot, showall ) ]]--
  17. Olá, quando o resource inicia ele esconde a hud original do gta, mas quando o player loga a hud do gta continua sendo mostrada, esse é o codigo local components = { "area_name", "radio", "vehicle_name" } function setHud() addEventHandler("onClientRender", getRootElement(), f_hud) setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) setPlayerHudComponentVisible("radar", false) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), setHud) addEventHandler("onPlayerJoin", getRootElement(), setHud) addEventHandler("onPlayerSpawn", getRootElement(), setHud) addEventHandler("onPlayerWasted", getRootElement(), setHud) addEventHandler("onPlayerJoin", getRootElement(), 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) setPlayerHudComponentVisible("radar", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), removeHud)
  18. olá, queria q quando abrisse um gui meio q bloqueasse os outros bind, como os de abrir o chat e bloquear veículo, alguem sabe me dizer ql função usar para fazer isso?
  19. Obrigado, funcionou, mas você consegue me explicar melhor como q funciona uma table, ou me recomendar algo para ler?
  20. Fiz algumas mudanças, colocando invés de colCircle, coloquei markers, e por algum motivo não está mais funcionando dff = engineLoadDFF("grassplant01.dff") engineReplaceModel(dff, 3409) addCommandHandler("devmode", function() setDevelopmentMode(true) end ) plantas = { {-1014, -1609.2, 75.36}, {-1010, -1609.242, 75.367}, {-1006, -1609.19, 75.36}, {-1002, -1609.104, 75.36}, {-998, -1609.082, 75.36}, {-994, -1609.037, 75.36}, {-990, -1609.037, 75.36}, {-1014, -1613, 75.36}, {-1010, -1613, 75.367}, {-1006, -1613, 75.36}, {-1002, -1613, 75.36}, {-998, -1613, 75.36}, {-994, -1613, 75.36}, {-990, -1613, 75.36}, {-1014, -1617, 75.36}, {-1010, -1617, 75.367}, {-1006, -1617, 75.36}, {-1002, -1617, 75.36}, {-998, -1617, 75.36}, {-994, -1617, 75.36}, {-990, -1617, 75.36}, {-1014, -1621, 75.36}, {-1010, -1621, 75.367}, {-1006, -1621, 75.36}, {-1002, -1621, 75.36}, {-998, -1621, 75.36}, {-994, -1621, 75.36}, {-990, -1621, 75.36}, } for i, v in ipairs ( plantas ) do plantas = createObject(3409, v[1],v[2],v[3]) colP = createMarker(v[1],v[2],v[3],"cylinder",2.5,0,0,0,0) end function fcm1() if isElementWithinMarker(localPlayer, colP) then setPedAnimation(localPlayer,"INT_HOUSE","wash_up",10000,true,false,true,false,10) setTimer(function () setPedAnimation(localPlayer) givePlayerMoney(math.random(500,1000)) end,10000,1) end end addCommandHandler("colher", fcm1) edit:Não há nenhum erro no debugscript, e o script está no lado client
  21. @Furzy Deu certo, obrigado e @Lord Henry nem percebi que o setPlayerWantedLevel era server-side, obrigado por me avisar
  22. Olá, fiz o seguinte script no lado client, porém, da esse erro de que a função, invés de ser localPlayer ele pega a string do comando, "colher" dff = engineLoadDFF("grassplant01.dff") engineReplaceModel(dff, 3409) addCommandHandler("devmode", function() setDevelopmentMode(true) end ) plantas = { {-1014, -1609.2, 75.36}, {-1010, -1609.242, 75.367}, {-1006, -1609.19, 75.36}, {-1002, -1609.104, 75.36}, {-998, -1609.082, 75.36}, {-994, -1609.037, 75.36}, {-990, -1609.037, 75.36}, {-1014, -1613, 75.36}, {-1010, -1613, 75.367}, {-1006, -1613, 75.36}, {-1002, -1613, 75.36}, {-998, -1613, 75.36}, {-994, -1613, 75.36}, {-990, -1613, 75.36}, {-1014, -1617, 75.36}, {-1010, -1617, 75.367}, {-1006, -1617, 75.36}, {-1002, -1617, 75.36}, {-998, -1617, 75.36}, {-994, -1617, 75.36}, {-990, -1617, 75.36}, {-1014, -1621, 75.36}, {-1010, -1621, 75.367}, {-1006, -1621, 75.36}, {-1002, -1621, 75.36}, {-998, -1621, 75.36}, {-994, -1621, 75.36}, {-990, -1621, 75.36}, } for i, v in ipairs ( plantas ) do plantas = createObject(3409, v[1],v[2],v[3]) colP = createColCircle(v[1],v[2],1.5) end function fcm1(localPlayer, commandname) if isElementWithinColShape(localPlayer, colP) then setPedAnimation(localPlayer,"INT_HOUSE","wash_up",10000,false,false,true,false) setTimer(function () star = getPlayerWantedLevel() setPlayerWantedLevel(localPlayer) setPedAnimation(localPlayer) givePlayerMoney(math.random(500,1000)) end,10000,1) end end addCommandHandler("colher", fcm1) erro: Bad argument @ 'isElementWithinColShape' [Expected element at argument 1,got string 'colher']
  23. Fiz assim e agora está funcionando perfeitamente: addEventHandler("onClientVehicleEnter", root, function (key, keystate) bindKey("accelerate", "up", blowoff) end) function blowoff(commandname) p = getPedOccupiedVehicle(localPlayer) id = getElementModel(p) if id == 562 then x,y,z = getElementPosition(localPlayer) playSound3D("BlowOff.mp3", x,y,z) end end
  24. fiz assim, mas da o mesmo erro " [Expected element at argument 1, got string 'accelerate']" function blowoff(source, localPlayer, accelerate, up) local x,y,z = getElementPosition(localPlayer) playSound3D("BlowOff.mp3", x,y,z) end function bnd() bindKey("accelerate","up",blowoff) end addEventHandler("onClientVehicleEnter", root, bnd) function ubnd() unbindKey("accelerate","up",blowoff) end addEventHandler("onClientVehicleExit", root, ubnd)
  25. function blowoff(localPlayer, accelerate, up) local p = getPedOccupiedVehicle(localPlayer) local id = getElementModel(p) if id == 562 then local x,y,z = getElementPosition(localPlayer) s1 = playSound3D("BlowOff.mp3", x,y,z) setSoundVolume(s1, 1.5) end end function bnd() bindKey("accelerate","up",blowoff) end addEventHandler("onClientVehicleEnter", root, bnd) function ubnd() unbindKey("accelerate","up",blowoff) end addEventHandler("onClientVehicleExit", root, ubnd) Fiz assim e continua dando o mesmo erro na linha 2 e 3