Jump to content

Renaz

Members
  • Posts

    224
  • Joined

  • Last visited

Everything posted by Renaz

  1. Ok , tendi local DelegaciaPrender = createMarker (1535.8380126953, -1672.9124755859, 12.3828125, "cylinder", 5, 0, 0, 255, 0) local blipprender = createBlip(1535.8380126953, -1672.9124755859, 12.3828125,30,0,0,0,255) function prenderJogador(thePlayer, cmd, playerid, valTimer) local alvo = exports["[LusoRP](Sistema)ID_System"]:getPlayerID(tonumber(playerid)) if not alvo then return outputChatBox("[AVISO] Falta colocar o ID do jogador!",thePlayer , 255,0,0) end if not valTimer then return outputChatBox("[AVISO] Falta colocar o tempo de prisão!",thePlayer , 255,0,0) end if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("ComandosCorporacoes")) then if isElementWithinMarker (thePlayer, DelegaciaPrender) then setElementData (alvo, "preso", true) setElementData (alvo, "prisao:tempo" ,valTimer) setElementPosition (alvo, 264.42120361328, 77.57405090332, 1001.0390625) setElementInterior (alvo, 6) setElementDimension (alvo, 1) takeAllWeapons (alvo) setPlayerWantedLevel (alvo,0) outputChatBox ("#4682B4*LusoRP* O Policia ' "..getPlayerName(thePlayer).." ' Prendeu o Cidadão ID ' "..playerid.." '!.", root, 100,100, 255, true) outputChatBox ("#4682B4*LusoRP* Pelo tempo de : "..valTimer.." minuto(s)", root, 100, 100, 255, true) setTimer (function () toggleAllControls (alvo, true) removeElementData (alvo, "preso") setPedAnimation (alvo, nil, nil) removeElementData (alvo,"Algemado") removeElementData (alvo, "prisao:tempo") setElementPosition (alvo, 1542.0284423828, -1669.5544433594, 13.553701400757) setElementDimension (alvo, 0) setElementInterior (alvo, 0) outputChatBox ("#4682B4*LusoRP* O Cidadão ID ' "..playerid.." ' Foi solto da Prisão!", root, 0, 0, 255, true) end, (tonumber(valTimer)) * 60000, 1) else outputChatBox ("[AVISO] Você não está na frente da Delegacia para Prender o Sujeito!", thePlayer, 255,0,0) end end end addCommandHandler ("prender", prenderJogador) addCommandHandler ("presos", function (player, cmd) if isPlayerInACL(player, "Admin") ~= true then return end local presos = getPlayersByData ("preso") if not presos then return outputChatBox( "Nenhum jogador preso encontrado!", player, 255, 30, 30) end local jailtime = function (player) return getElementData( player, "prisao:tempo" ) or "N/A" end for i, p in ipairs(presos) do outputChatBox ("[PRESOS] Nick: ".. getPlayerName(p):gsub("#%x%x%x%x%x%x", "") .." - Tempo: ".. tostring(jailtime(p)), player, 230, 230, 230, true) end end) function getPlayersByData (dataName) if dataName and type(dataName) == "string" then local playersTable = {} for _, v in ipairs(getElementsByType("player")) do if getElementData (v, dataName) then table.insert (playersTable, v) end end if #playersTable == 0 then return false end return playersTable end return false end function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end modifiquei o arquivo está correto desta maneira?
  2. setElementData (alvo, "valTimer" ) isso?
  3. pela lógica acho que não né , uma coisa não pode ser verdadeira e falsa penso que seja valTimer
  4. deu a parecer que teria que usar o bool
  5. acho que a data do tempo tem que ser bolean porém não estou entendo (porque)
  6. quero mostrar o tempo de prisão. acho que não.
  7. como assim? sim quando ele sair da prisão todas as datas são removidas.
  8. local DelegaciaPrender = createMarker (1535.8380126953, -1672.9124755859, 12.3828125, "cylinder", 5, 0, 0, 255, 0) local blipprender = createBlip(1535.8380126953, -1672.9124755859, 12.3828125,30,0,0,0,255) function prenderJogador(thePlayer, cmd, playerid, valTimer) local alvo = exports["[LusoRP](Sistema)ID_System"]:getPlayerID(tonumber(playerid)) if not alvo then return outputChatBox("[AVISO] Falta colocar o ID do jogador!",thePlayer , 255,0,0) end if not valTimer then return outputChatBox("[AVISO] Falta colocar o tempo de prisão!",thePlayer , 255,0,0) end if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("ComandosCorporacoes")) then if isElementWithinMarker (thePlayer, DelegaciaPrender) then setElementData (alvo, "preso", true) setElementData (alvo, "prisao:tempo" ,true) setElementPosition (alvo, 264.42120361328, 77.57405090332, 1001.0390625) setElementInterior (alvo, 6) setElementDimension (alvo, 1) takeAllWeapons (alvo) setPlayerWantedLevel (alvo,0) outputChatBox ("#4682B4*LusoRP* O Policia ' "..getPlayerName(thePlayer).." ' Prendeu o Cidadão ID ' "..playerid.." '!.", root, 100,100, 255, true) outputChatBox ("#4682B4*LusoRP* Pelo tempo de : "..valTimer.." minuto(s)", root, 100, 100, 255, true) setTimer (function () toggleAllControls (alvo, true) removeElementData (alvo, "preso") setPedAnimation (alvo, nil, nil) removeElementData (alvo,"Algemado") removeElementData (alvo, "prisao:tempo") setElementPosition (alvo, 1542.0284423828, -1669.5544433594, 13.553701400757) setElementDimension (alvo, 0) setElementInterior (alvo, 0) outputChatBox ("#4682B4*LusoRP* O Cidadão ID ' "..playerid.." ' Foi solto da Prisão!", root, 0, 0, 255, true) end, (tonumber(valTimer)) * 60000, 1) else outputChatBox ("[AVISO] Você não está na frente da Delegacia para Prender o Sujeito!", thePlayer, 255,0,0) end end end addCommandHandler ("prender", prenderJogador) addCommandHandler ("presos", function (player, cmd) if isPlayerInACL(player, "Admin") ~= true then return end local presos = getPlayersByData ("preso") if not presos then return outputChatBox( "Nenhum jogador preso encontrado!", player, 255, 30, 30) end local jailtime = function (player) return getElementData( player, "prisao:tempo" ) or "N/A" end for i, p in ipairs(presos) do outputChatBox ("[PRESOS] Nick: ".. getPlayerName(p):gsub("#%x%x%x%x%x%x", "") .." - Tempo: ".. tostring(jailtime(p)), player, 230, 230, 230, true) end end) function getPlayersByData (dataName) if dataName and type(dataName) == "string" then local playersTable = {} for _, v in ipairs(getElementsByType("player")) do if getElementData (v, dataName) then table.insert (playersTable, v) end end if #playersTable == 0 then return false end return playersTable end return false end function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end não notei , já arrumei
  9. O código de prender está junto com o de ver os presos local DelegaciaPrender = createMarker (1535.8380126953, -1672.9124755859, 12.3828125, "cylinder", 5, 0, 0, 255, 0) local blipprender = createBlip(1535.8380126953, -1672.9124755859, 12.3828125,30,0,0,0,255) function prenderJogador(thePlayer, cmd, playerid, valTimer) local alvo = exports["[LusoRP](Sistema)ID_System"]:getPlayerID(tonumber(playerid)) if not alvo then return outputChatBox("[AVISO] Falta colocar o ID do jogador!",thePlayer , 255,0,0) end if not valTimer then return outputChatBox("[AVISO] Falta colocar o tempo de prisão!",thePlayer , 255,0,0) end if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("ComandosCorporacoes")) then if isElementWithinMarker (thePlayer, DelegaciaPrender) then setElementData (alvo, "preso", true) setElementPosition (alvo, 264.42120361328, 77.57405090332, 1001.0390625) setElementInterior (alvo, 6) setElementDimension (alvo, 1) takeAllWeapons (alvo) setPlayerWantedLevel (alvo,0) outputChatBox ("#4682B4*LusoRP* O Policia ' "..getPlayerName(thePlayer).." ' Prendeu o Cidadão ID ' "..playerid.." '!.", root, 100,100, 255, true) outputChatBox ("#4682B4*LusoRP* Pelo tempo de : "..valTimer.." minuto(s)", root, 100, 100, 255, true) setTimer (function () toggleAllControls (alvo, true) removeElementData (alvo, "preso") setPedAnimation (alvo, nil, nil) removeElementData (alvo,"Algemado") setElementPosition (alvo, 1542.0284423828, -1669.5544433594, 13.553701400757) setElementDimension (alvo, 0) setElementInterior (alvo, 0) outputChatBox ("#4682B4*LusoRP* O Cidadão ID ' "..playerid.." ' Foi solto da Prisão!", root, 0, 0, 255, true) end, (tonumber(valTimer)) * 60000, 1) else outputChatBox ("[AVISO] Você não está na frente da Delegacia para Prender o Sujeito!", thePlayer, 255,0,0) end end end addCommandHandler ("prender", prenderJogador) addCommandHandler ("presos", function (player, cmd) if isPlayerInACL(player, "Admin") ~= true then return end local presos = getPlayersByData ("preso") if not presos then return outputChatBox( "Nenhum jogador preso encontrado!", player, 255, 30, 30) end local jailtime = function (player) return getElementData( player, "prisao:tempo" ) or "N/A" end for i, p in ipairs(presos) do outputChatBox ("[PRESOS] Nick: ".. getPlayerName(p):gsub("#%x%x%x%x%x%x", "") .." - Tempo: ".. tostring(jailtime(p)), player, 230, 230, 230, true) end end) function getPlayersByData (dataName) if dataName and type(dataName) == "string" then local playersTable = {} for _, v in ipairs(getElementsByType("player")) do if getElementData (v, dataName) then table.insert (playersTable, v) end end if #playersTable == 0 then return false end return playersTable end return false end function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end
  10. beleza funcionou e pra mostrar o tempo é so usar ..valTimer..?
  11. não estou entendo como usar o getPlayersByData
  12. no caso quando o player é preso eu usei uma função pra setar a data "preso" na conta, ainda quando o tempo acaba essa data é removida.
  13. Algum tempo atrás eu pedi ajuda aqui no forum sobre um script de prender , eu queria saber agora como eu crio uma tabela (no chat ou painel gui) aparecendo os presos e o tempo eu não faço a minima ideia como
  14. Sinceramente tó meio irritado com esse DX , eu to tentando colocar um logo do meu servidor na tela usando o gui de DX , mas a imagem não aparece. local screenW,screenH = guiGetScreenSize() local resW,resH = 1366,768 local sW,sH = (screenW/resW), (screenH/resH) addEventHandler("onClientRender", root, function() dxDrawImage(screenW * 1186, screenH * 148, screenW * 140, screenH * 106, "luso.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end ) client <meta> <script src="client.lua" type="client" /> <file src="luso.png" /> </meta> meta
  15. Arrumado , foi só tirar o onClientRender https://imgur.com/a/6eW8wmV + uma coisa não to conseguindo colocar quando o player colide com a marker aparecer uma mensagem
  16. https://imgur.com/a/Q4GdBg7 Agora o "Porte de Armas" no painel tá parecendo que não faz mais parte do painel ele aparece quando revisto mas não some nem quando mudo de aba nem quando fecho o painel
  17. tá , eu teria que fazer com o getElementData e depois o setElementData, ai quando o player desloga-se eu usaria o setAccountData para setar "porte" , dai quando ele entra-se eu usaria o OnPlayerJoin para verificar se getAccountData "porte" caso ele tivesse usaria o setElementData"porte" é isso?
  18. local Porte = tonumber(getElementData(Jogador, "porte")) or 0 if Porte > 1 then dxDrawText("Porte de Armas: (#00ff00X#ffffff)", x*748, y*269, x*832, y*284, tocolor(255, 255, 255, 255), x*1.00, Font_5, "left", "top", false, false, false, true, false) else dxDrawText("Porte de Armas: (#ff0000X#ffffff)", x*748, y*269, x*832, y*284, tocolor(255, 255, 255, 255), x*1.00, Font_5, "left", "top", false, false, false, true, false) end local porte = createMarker (252.36033630371,69.68399810791,1002.640625, "cylinder", 1.3, 255, 255, 255, 50) setElementDimension (porte, 1) setElementInterior (porte, 6) addCommandHandler ("comprarporte", function (player, cmd) if (not isGuestAccount (getPlayerAccount (player))) then -- Se o jogador não estiver deslogado, então: if isElementWithinMarker (player, porte) then -- Se o jogador estiver no marker, então: if not getAccountData (getPlayerAccount(player), "porte") then -- Se o jogador não estiver com a account-data "porte", então: if getPlayerMoney (player) >= 30000 then -- Se o jogador tiver menos ou igual a 30k, então: takePlayerMoney (player, 30000) -- Debita 30k da conta do jogador. getElementData (player, "porte", true) -- Seta a account-data na conta do jogador. outputChatBox ("[AVISO] Você comprou o porte de armas!", player, 0, 255, 0) else --Se o jogador não tiver 30k, então: outputChatBox ("[AVISO] Você não tem dinheiro para o porte!", player, 255, 30, 30) end else -- Se o jogador tiver a account-data, então: outputChatBox ("[AVISO] Você já tem o porte de armas!", player, 255, 30, 30) end else -- Se o jogador não estiver no marker, então: outputChatBox ("[AVISO] Você não está na delegacia!", player, 255, 30, 30) end else -- Se o jogador estiver deslogado, então: outputChatBox ("[AVISO] Você não pode comprar o porte estando deslogado.", player, 255, 30, 30) end end) addEventHandler("onPlayerQuit" , player , setAccountData(player,"porte")) desse jeito??
  19. opa , voltando ao assunto o meu script de revistar para pegar se o player tem o porte é neccessário usar o getElementData local Porte = tonumber(getElementData(Jogador , "porte")) or 0 if Porte > 1 then dxDrawText("Porte de Armas: (#00ff00X#ffffff)", x*748, y*269, x*832, y*284, tocolor(255, 255, 255, 255), x*1.00, Font_5, "left", "top", false, false, false, true, false) else dxDrawText("Porte de Armas: (#ff0000X#ffffff)", x*748, y*269, x*832, y*284, tocolor(255, 255, 255, 255), x*1.00, Font_5, "left", "top", false, false, false, true, false) end se eu substituir por getAccountData ele não funciona o script inteiro.
×
×
  • Create New...