Jump to content

HitmanLM

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by HitmanLM

  1. I made a script to be able to call the image from the client to the server, but I don't know how to call it, I did a test with "outputChatBox" it works perfectly, it doesn't give any errors everything great but I don't know how to call the image if someone can help me please . server: function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup('user.'.. accountname, aclGetGroup("BOPE")) then outputChatBox ('1',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("EB")) then outputChatBox ('2',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("PCRJ")) then outputChatBox ('3',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("semgrupo")) then end triggerClientEvent(thePlayer, "painelrota", getRootElement()) end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) client: local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) function Pdx () dxDrawText("Test", 332, 361, 497, 374, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false) end local img_names = { [1] = "img/gfx/BOPE.png", [2] = "img/gfx/EB.png", [3] = "img/gfx/PCRJ.png", [4] = "img/gfx/semequipe.png", } local function draw_img(x, y, des1, n) dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelrota", true) addEventHandler("painelrota", root , abrir)
  2. I made a script to be able to call the image from the client to the server, but I don't know how to call it, I did a test with "outputChatBox" it works perfectly, it doesn't give any errors everything great but I don't know how to call the image if someone can help me please . server: function showPanellr(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup('user.'.. accountname, aclGetGroup("BOPE")) then outputChatBox ('1',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("EB")) then outputChatBox ('2',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("PCRJ")) then outputChatBox ('3',source,255,255,255,true) elseif isObjectInACLGroup('user.'.. accountname, aclGetGroup("semgrupo")) then end triggerClientEvent(thePlayer, "painelrota", getRootElement()) end function onResStartlr() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStartlr) function onPlayerJoinlr() bindKey(source, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoinlr) function cleanAlllr(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "k", "down", showPanellr)------"K" Botao Para Abrir O Painel end end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), cleanAlllr) client: local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) function Pdx () dxDrawText("Test", 332, 361, 497, 374, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false) end local img_names = { [1] = "img/gfx/BOPE.png", [2] = "img/gfx/EB.png", [3] = "img/gfx/PCRJ.png", [4] = "img/gfx/semequipe.png", } local function draw_img(x, y, des1, n) dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false) end function abrir (_,state) if painel == false then showCursor(true) addEventHandler("onClientRender", root, Pdx) painel = true else showCursor(false) removeEventHandler("onClientRender", root, Pdx) painel = false end end addEvent("painelrota", true) addEventHandler("painelrota", root , abrir)
  3. não consigo fazer a imagem aparecer, estou perdido no código, consegue ajudar? @Lord Henry --client local img_names = { [1] = "img/gfx/BOPE.png", [2] = "img/gfx/EB.png", [3] = "img/gfx/PCRJ.png", [4] = "img/gfx/semequipe.png", } local function draw_img(x, y, des1, n) dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false) end local img_idx = false; addEventHandler("onClientRender", root, function() if (img_idx) then dxDrawText("test: " .. img_idx, 100, 300); end end ); local imagens = { [1] = true, [2] = false, } triggerServerEvent("chamarimagem", localPlayer, imagens) addEvent("onClientSelectPlayerGroup", true); addEventHandler("onClientSelectPlayerGroup", root, function(idx) if not (source == localPlayer) then return; end; outputChatBox("selected group: " .. idx); img_idx = idx; end ); --server: addEvent("chamarimagem", true) addEventHandler("chamarimagem", root, function (theImages) local theGroup if isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup("BOPE")) then theGroup = 1 elseif isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup("EB")) then theGroup = 2 elseif isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup("PCRJ")) then theGroup = 3 elseif isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(player)), aclGetGroup("semgrupo")) then theGroup = 4 end triggerClientEvent(client, "onClientSelectPlayerGroup", client, theGroup); end )
  4. sets the ACL all right, however I don't quite understand how the ''-- TODO part works: use draw_img to draw the image, with n = img_idx'' it also gave 2 errors that I didn't understand well. -- client local img_names = { [1] = "img/gfx/BOPE.png", [2] = "img/gfx/EB.png", [3] = "img/gfx/PCRJ.png", [4] = "img/gfx/semequipe.png", } local function draw_img(x, y, des1, n) dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false) end local img_idx = false; addEventHandler("onClientRender", root, function() if (img_idx) then -- TODO: use draw_img to draw the image, with n = img_idx dxDrawText("test: " .. img_idx, 100, 300); end end ); local imagens = { [1] = true, [2] = false, } triggerServerEvent("chamarimagem", localPlayer, imagens) addEvent("onClientSelectPlayerGroup", true); addEventHandler("onClientSelectPlayerGroup", root, function(idx) if not (source == localPlayer) then return; end; outputChatBox("selected group: " .. idx); img_idx = idx; end ); -- server addEvent("chamarimagem", true) addEventHandler("chamarimagem", root) function (theImages) local theGroup local ACL = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup('user.'..ACL, aclGetGroup("BOPE")) then theGroup = 1 elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("EB")) then theGroup = 2 elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("PCRJ")) then theGroup = 3 elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("semgrupo")) then theGroup = 4 end triggerClientEvent(client, "onClientSelectPlayerGroup", client, theGroup); end
  5. "triggerServerEvent("chamarimagem", hitPlayer, imagens)" "Where did you copy it from and what were you thinking when you did?" this function is not used to join the server script with the client? at least I thought that this function would do that would call the client images that this function '' dxDrawImage " as I understand it doesn't work on the server as it is a correct client function?
  6. https://ibb.co/P1sRzq9 @The_GTA I asked myself in the code, I don't know what to do, the problem is not the errors, but that I'm confused with the code :( I don't know how to adjust my images to work, and I know it doesn't and the errors are preventing them from showing. https://www.mediafire.com/file/r4kfn5w1nflu2v6/test.rar/file - I made a file to better understand what I'm trying to do I set the group on the panel but the group doesn't activate at all, and I wanted that to happen when I set the group, the image automatically appears without the player needing to do anything
  7. @The_GTA " You are using a variable called "ACL" inside of the "chmarimagem" server-side event handler. Please adjust it to a proper value or explain what it is meant to do. Right now it looks like that the variable is not hooked up to any logic. The client-side "onClientRender" event handler has been left for you to complete. " forgive me for not explaining i forgot, what I'm trying to do and what's next, when a player is set to group 1, 2 or 3 it activates the respective screen image of the group he was set to
  8. HitmanLM

    help script

    I'm having trouble getting this to work, I don't know how to activate this data I made -- Client-side table{ [1] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo1.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [2] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo2.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [3] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo3.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [4] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/semgrupo.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), } local imagens = { [1] = true, [2] = false, } triggerServerEvent("chamarimagem", hitPlayer, imagens) -- Server-side addEvent("chamarimagem", true) addEventHandler("chamarimagem", root, function (theImages) function chamarimagem(thePlayer) if isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo1")) then chamarimagem [1] elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo2")) then chamarimagem [2] elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo3")) then chamarimagem [3] else isObjectInACLGroup('user.'..ACL, aclGetGroup("semgrupo")) then chamarimagem [4] end end end end end
  9. tentei mais esta difícil não sei onde estou errado consegue auxiliar? entro no grupo e não acontece nada -- Client-side table{ [1] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo1.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [2] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo2.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [3] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/grupo3.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), [4] = dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/semgrupo.png", 0, 0, 0, tocolor(255, 255, 255, des1), false), } local imagens = { [1] = true, [2] = false, } triggerServerEvent("chamarimagem", hitPlayer, imagens) -- Server-side addEvent("chamarimagem", true) addEventHandler("chamarimagem", root, function (theImages) function chamarimagem(thePlayer) if isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo1")) then chamarimagem [1] elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo2")) then chamarimagem [2] elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo3")) then chamarimagem [3] else isObjectInACLGroup('user.'..ACL, aclGetGroup("semgrupo")) then chamarimagem [4] end end end end end
  10. darei exemplo pratico para explicar melhor: client: local x, y, z = getElementPosition(localPlayer) local marker = createMarker ( x, y, z ) function trigger ( hitPlayer ) if source == marker then triggerServerEvent ( "givePlayerWeapon", hitPlayer ) dxDrawImage(x*290, y*475, x*150, y*110, "img/gfx/1.png", 0, 0, 0, tocolor(255, 255, 255), true) end end addEventHandler ("onClientMarkerHit", root, trigger) server: function weapon () giveWeapon (source, 31, 30, true) end addEvent ("givePlayerWeapon", true) addEventHandler ("givePlayerWeapon", root, weapon) e só um exemplo que fiz para testar porem ele não chama a imagem (não tera nada a ver com a arma e sim com a imagem fiz via arma para testar o recebimento)
  11. ótimo, ultima pergunta, aparentemente estou tentando juntar 2 coisas que não tem como eu usar no mesmo script exemplo: eu usando o server eu consigo acesso a essa função: isObjectInACLGroup usando o cliente consigo acesso a essa: dxDrawImage o problema e o seguinte como pode ver as 2 estão interligadas no script como eu faço para usar isObjectInACLGroup no server porem utilizando as imagens que estaram no cliente pela função dxDrawImage ?? espero que tenha entendido kk sei que ta um pouco embolado desculpe.
  12. entendi irmão, tem alguma função que substitua o isObjectinACLGroup no client, ou tenho que fazer um script serve para vincular ao Client?
  13. fiz um script para que dependendo do grupo uma imagem aparecesse sem a nescessidade de fazer nada, somente o player estando no grupo ja aparecer essa imagem porem não esta aparecendo a imagem if isObjectInACLGroup ("user."..equipe, aclGetGroup("1")) then dxDrawImage(x*587, y*360, x*45, y*97/100, "img/gfx/1.png", 0, 0, 0, tocolor(255, 255, 255, des1), false) elseif isObjectInACLGroup ("user."..equipe, aclGetGroup("2")) then dxDrawImage(x*587, y*360, x*45, y*97/100, "img/gfx/2.png", 0, 0, 0, tocolor(255, 255, 255, des1), false) elseif isObjectInACLGroup ("user."..equipe, aclGetGroup("3")) then dxDrawImage(x*587, y*360, x*45, y*97/100, "img/gfx/3.png", 0, 0, 0, tocolor(255, 255, 255, des1), false) end
  14. alguém consegue me ajudar, eu gostaria de aumentar o nível de servidor procurado no caso padrão e 6, gostaria de ficar mais no caso sem limites já tentar alterar não o erro porem não ultrapassa 6. já tentei mudar o if para ´´if wl += 1 then´´ também para ´´if wl <1000 then´´ no caso entendo que ali esta dizendo que so seta se o player tiver menos de 6 no caso limitando porem acredito que tenho que ter um script que mude isso na raiz. if wl < 6 then setPlayerWantedLevel ( thePlayer, wl+1 ) -- Setar +1 Level de Procurado ( Jogador ) end
  15. já existe, oque acontece não sei porque fizeram o sistema de tocar musica individual fora dos outros sistemas, e um sistema de login, aqui o server: local badChars = {"!","\"","§","&","/","=","?","`","´","\\","{","}","³","²","@","€","*","+","#","'","~","|","<",">",".",":",",",";","%","(",")","$","[","]"} addEventHandler("onResourceStart", resourceRoot, function() for _, player in ipairs(getElementsByType"player") do logOut(player) end end) local function containsBadChars(n) for _, theChar in ipairs(badChars) do if string.find(n, tostring(theChar), 1, true) then return true end end return false end local function isPlayerRegistered(player) if #getAccountsBySerial(getPlayerSerial(player)) ~= 0 then return true else return false end end local function getPlayersFirstAccount(player) if #getAccountsBySerial(getPlayerSerial(player)) ~= 0 then return getAccountsBySerial(getPlayerSerial(player))[1] else return false end end addEvent("onClientFinishedLoading", true) addEventHandler("onClientFinishedLoading", root, function() local firstAccount = getPlayersFirstAccount(client) triggerClientEvent(client, "onServerRequestLoginRegister", getRootElement(), firstAccount and getAccountName(firstAccount) or false) end ) local function isAccountRegistered(n) local account = getAccount(n) if account then return true else return false end end addEvent("onClientExecute", true) addEventHandler("onClientExecute", root, function(s, inputs) if source ~= client then return end if s == 1 then local pA = getAccount(inputs[1]) if pA then local pL = logIn(client, pA, inputs[2]) if pL then triggerClientEvent(client, "onClientSuccess", client) triggerEvent("onClientLoggedIn", resourceRoot, client) triggerClientEvent(client, "addClientMessage", client, "|Info| #ff8000Type /report [text] for super very fast support :)", 255, 255, 255) return else triggerClientEvent(client, "showErrorMessage", client, "Senha incorreta") end else triggerClientEvent(client, "showErrorMessage", client, "Não foi possível encontrar essa conta!") end elseif s == 2 then for _, t in ipairs(inputs) do if t == nil or t == "" then triggerClientEvent(client, "showErrorMessage", client, "Nome de usuário ou senha incorreta") return end end if containsBadChars(inputs[1]) then triggerClientEvent(client, "showErrorMessage", client, "O nome da conta tem carateres inválidos") return elseif #inputs[2] < 6 then triggerClientEvent(client, "showErrorMessage", client,"Sua senha deve ter mais de 6 caracteres.") return elseif inputs[2] ~= inputs[3] then triggerClientEvent(client, "showErrorMessage", client,"Senhas não coincidem.") return elseif isAccountRegistered(inputs[1]) then triggerClientEvent(client, "showErrorMessage", client,"Esta conta já está registrada.") return elseif isPlayerRegistered(client) then triggerClientEvent(client, "showErrorMessage", client, "Você já está registrado.") return end local nA = addAccount(inputs[1], inputs[2]) if nA then logIn(client, nA, inputs[2]) triggerClientEvent(client, "onClientSuccess", client) setPlayerTeam(client, getTeamFromName("User")) --setAccountData(nA, "cash", 250000) triggerClientEvent(client, "onClientSuccess", client) else triggerClientEvent(client, "showErrorMessage", client, "Um erro ocorreu durante a criação da conta.") end end end) addEventHandler("onPlayerCommand", root, function(cmd) if cmd == "login" or cmd == "register" or cmd == "logout" then cancelEvent() end end)
  16. alguém sabe me dizer como faço music aparar depois que o login e feito? addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setTimer(function() playSound("joinsound.mp3") end, 2000, 1) end )
  17. and not asking too much how to pause this song after the player enters the game? addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() -- little interval, music is getting laggy when all resources are starting.. setTimer(function() playSound("joinsound.mp3") end, 2000, 1) end )
  18. Need help changing the onClientResource function to onClientKey, in case when the login is already appearing, which appears to be displayed only if the player clicks on a specified key function OnStop () 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()), OnStop) function OnStart () setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), OnStart ) local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end )
×
×
  • Create New...