Jump to content

Blaack

Members
  • Posts

    194
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Blaack

  1. Nesse evento é sempre bom verificar se o player existe, pois as vezes eles acionam o evento e quitam... assim dando erro no debug. function BloquearAssalto(player, seat) if player and isElement(player) and seat == 0 then outputChatBox("#FF0000[Aviso]: #FFFFFFVocê não pode roubar veiculos.", player, 255, 255, 255, true) cancelEvent() end end addEventHandler("onVehicleStartEnter", getRootElement(), BloquearAssalto) Além de não precisar verificar o assento com o getPedOccupiedVehicleSeat (pois iria dar erro, pois o player ainda não esta no veiculo) e usando o 2° argumento da função.
  2. No evento o segundo parametro deve ser o marker, getRootElement() ele puxa todos os markers, então mude aquela definição deixando-a assim: --- Server ----- local marker123 = createMarker(589.438, 870.218, -42.497, 'cylinder', 1.0, 30, 144, 255, 150) function markerfunction(player) setElementData ( player, "Emprego", "Mineirador" ) -- alterei de source para player, pois source neste evento é o marker! outputChatBox("/infos para marcar os markers",player,255,255,0) -- Output that they are. end addEventHandler("onPlayerMarkerHit", marker123, markerfunction)
  3. Você está fazendo o mod do lado client?
  4. Eu costumo diminuir -0.9 da posição do player para que fique no chão perfeitamente.
  5. function fabricarak () if (next:getSpaceMochila(source, "Corpo de AK-47", 1)) then local item = next:getItem(source, "Corpo de AK-47") local item2 = next:getItem(source, "Molas") if (item) and (item >= 1) and (item2) and (item2 >= 1) then next:takeItem(source, "Corpo de AK-47", 1) next:takeItem(source, "Molas", 1) next:giveItem(source, "AK47", 1) end end end addEvent("fabricarakc",true) addEventHandler ( "fabricarakc", getRootElement(), fabricarak ) Creio que isso ira funcionar...
  6. Tem uma virgula após o fechamento da tabela "PersonagensComprar", remova ela. local sW, sH = guiGetScreenSize() local resW, resH = 1920,1080 local x, y = (sW/resW), (sH/resH) PersonagensComprar = { {0}, {25}, {50} } function telaPrinci () dxDrawRectangle(x*26, y*81, x*409, y*871, tocolor(36, 36, 36, 240), false) dxDrawRectangle(x*26, y*81, x*409, y*107, tocolor(17, 17, 17, 240), false) dxDrawRoundedRectangle(x*492, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15) dxDrawRoundedRectangle(x*769, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15) dxDrawRoundedRectangle(x*1046, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15) dxDrawRoundedRectangle(x*1323, y*843, x*246, y*109, tocolor(36, 36, 36, 255), 15) dxDrawImage(x*1694, y*0, x*226, y*205, "assets/icons/Logo.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*1422, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*1145, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*868, y*874, x*47, y*47, "assets/icons/lock.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) dxDrawImage(x*591, y*874, x*47, y*47, "assets/icons/add.png", 0, 0, 0, tocolor(0, 0, 0, 255), false) end addEventHandler("onClientRender", getRootElement(), telaPrinci) function dxDrawRoundedRectangle(x, y, rx, ry, color, radius) rx = rx - radius * 2 ry = ry - radius * 2 x = x + radius y = y + radius if (rx >= 0) and(ry >= 0) then dxDrawRectangle(x, y, rx, ry, color) dxDrawRectangle(x, y - radius, rx, radius, color) dxDrawRectangle(x, y + ry, rx, radius, color) dxDrawRectangle(x - radius, y, radius, ry, color) dxDrawRectangle(x + rx, y, radius, ry, color) dxDrawCircle(x, y, radius, 180, 270, color, color, 7) dxDrawCircle(x + rx, y, radius, 270, 360, color, color, 7) dxDrawCircle(x + rx, y + ry, radius, 0, 90, color, color, 7) dxDrawCircle(x, y + ry, radius, 90, 180, color, color, 7) end end
  7. Tente ajustar o tamanho do texto, coloque um x*1.40 e veja.
  8. @IamCrazy__ Esse seguinte evento no seu client-side provavelmente ira funcionar, teste-o: addEventHandler("onElementDestroy", getRootElement(), function () if source and isElement(source) and getElementType(source) == "vehicle" then if vehiclesSirenes[source] then if isElement(vehiclesSirenes[source]) then destroyElement(vehiclesSirenes[source]) end vehiclesSirenes[source] = nil end end end)
  9. Maninho, como você fez em gui não é necessário o onClientRender... Teste assim: local Janela_Agencia_Emprego = guiCreateWindow(0.22, 0.07, 0.54, 0.80, "", true) guiWindowSetMovable(Janela_Agencia_Emprego, false) guiWindowSetSizable(Janela_Agencia_Emprego, false) guiSetAlpha(Janela_Agencia_Emprego, 1.00) guiSetProperty(Janela_Agencia_Emprego, "CaptionColour", "FF1B0743") local Label_Top = guiCreateLabel(0.29, 0.11, 0.40, 0.09, "AGENCIA DE EMPREGO", true, Janela_Agencia_Emprego) guiSetFont(Label_Top, "clear-normal") guiLabelSetHorizontalAlign(Label_Top, "center", false) guiLabelSetVerticalAlign(Label_Top, "center") local Butoon_Catador = guiCreateButton(0.01, 0.26, 0.27, 0.10, "CATADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Catador, "NormalTextColour", "FFFFFFFF") local Butoon_Jornal = guiCreateButton(0.71, 0.26, 0.27, 0.10, "ENTREGADOR DE JORNAL", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Jornal, "NormalTextColour", "FFFFFFFF") local Butoon_Pedreiro = guiCreateButton(0.01, 0.38, 0.27, 0.10, "PEDREIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pedreiro, "NormalTextColour", "FFFFFFFF") local Butoon_Pescador = guiCreateButton(0.71, 0.38, 0.27, 0.10, "PESCADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Pescador, "NormalTextColour", "FFFFFFFF") local Butoon_MotoBoy = guiCreateButton(0.01, 0.49, 0.27, 0.10, "MOTO BOY", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_MotoBoy, "NormalTextColour", "FFFFFFFF") local Butoon_Gas = guiCreateButton(0.71, 0.49, 0.27, 0.10, "ENTREGADOR DE GÁS", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Gas, "NormalTextColour", "FFFFFFFF") local Butoon_Leite = guiCreateButton(0.01, 0.61, 0.27, 0.10, "ENTRAGADOR DE LEITE", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Leite, "NormalTextColour", "FFFFFFFF") local Butoon_Eletricista = guiCreateButton(0.71, 0.61, 0.27, 0.10, "ELETRICISTA", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Eletricista, "NormalTextColour", "FFFFFFFF") local Butoon_Caminhoneiro = guiCreateButton(0.01, 0.73, 0.27, 0.10, "CAMINHONEIRO", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Caminhoneiro, "NormalTextColour", "FFFFFFFF") local Butoon_Minerador = guiCreateButton(0.71, 0.73, 0.27, 0.10, "MINERADOR", true, Janela_Agencia_Emprego) guiSetProperty(Butoon_Minerador, "NormalTextColour", "FFFFFFFF") local Butoon_Sair = guiCreateButton(10, 532, 719, 59, "SAIR", false, Janela_Agencia_Emprego) guiSetProperty(Butoon_Sair, "NormalTextColour", "FFFFFFFF") guiSetVisible(Janela_Agencia_Emprego, false) addCommandHandler("painel", function() if not guiGetVisible(Janela_Agencia_Emprego) then guiSetVisible(Janela_Agencia_Emprego, true) showCursor(true) else guiSetVisible(Janela_Agencia_Emprego, false) showCursor(false) end end)
  10. Bom dia tudo bem? Não há nada em seu código que faça a fome/sede diminuir... a maioria das huds ela só tem a função de mostrar e não de diminuir. Outra coisa, você não mostra qual essa definição... local hunger = getElementData(localPlayer, configs['Elements']['Fome']) or 100 local thirst = getElementData(localPlayer, configs['Elements']['Sede']) or 100 local stress = getElementData(localPlayer, configs['Elements']['Stress']) or 100
  11. Bom dia, tem vários possíveis erros em seu código, eu corrigi porem não testei... teste para mim por favor! addCommandHandler("staff", function(playerSource) local db = getElementData(playerSource, "debounce") if not db then local staffon = false for _, players in pairs(getElementsByType("player")) do if getPlayerAccount(players) and not isGuestAccount(getPlayerAccount(players)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(players)), aclGetGroup("Staff")) and getElementData(players, "onProt") then staffon = true end end end if staffon then local ID = getElementData(playerSource, "ID") or "N/A" setElementData(playerSource,"debounce", true) for _, player in ipairs(getElementsByType("player")) do if getPlayerAccount(players) and not isGuestAccount(getPlayerAccount(players)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(players)), aclGetGroup("Staff")) and getElementData(players, "onProt") then showinfo(players, "O Cidadão "..getPlayerName(playerSource).." ( "..ID.." ) solicitou ajuda", "info") end end end setTimer(function() setElementData(playerSource, "debounce", false) end, 1500, 1) else showinfo(playerSource, "Não há staff on!", "error") end else showinfo(playerSource,"Você ja chamou staff! Aguarde um pouco", "error") end end) function showinfo(element, typeinfo, msg) exports.infobox:addBox(element, typeinfo, msg) end Outra coisa, você usa setElementData porém eu acho desnecessário... eu não mudei pois não sei se seu intuito ao usar essa data é apenas esse, mas recomendo a utilização de uma tabela com setTimer ai.
  12. Não há nenhum evento acionando a hud, tente usar onClientRender
  13. veh = {} function criarxx() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(467, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carrop",true) addEventHandler("carrop",root,criarxx) --------------------------------------------------------------------------------------- function criarxx2() if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(502, x,y,z + 2) warpPedIntoVehicle (source,veh[source]) end addEvent("carrop2",true) addEventHandler("carrop2",root,criarxx2) addEventHandler("onPlayerQuit", getRootElement(), -- evento acionado quando qualquer player do servidor sair. function () if veh[source] then -- verifica se existe veh[source] if isElement(veh[source]) then -- verificar se veh[source] é um elemento destroyElement(veh[source]) -- destroi veh[source] end end end Isso?
  14. Não entendi sua dúvida, mas não seria o GetFunctionsBoundToKey ?
  15. Mas o evento que ele está utilizando nesse caso já é server-side, imagino que o código seja lado server-side sim. Mas enfim, teste desta maneira: addEventHandler("onMarkerHit", Destroy, function ( thePlayer ) if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then -- verifica thePlayer, se é um elemento e se é um element do tipo player local conta = getPlayerAccount (thePlayer) if conta and not isGuestAccount(conta) then -- verifica se a conta existe e se esta logado local acc = getAccountName(conta) -- verificando o nome da conta do player if isObjectInACLGroup ("user."..acc, aclGetGroup("Policial")) then -- verifica se o rapaz possui a acl policial local veh = getPedOccupiedVehicle(thePlayer) -- verifica se o player está em um veiculo if veh then local model = getElementModel(veh) -- verifica o modelo do veiculo if model == 598 or model == 599 or model == 490 then destroyElement (veh) exports.InfoDx:addBox(thePlayer, "Veiculo Detruido Com Sucesso", "success") end end end end end end)
  16. Olá, boa tarde tudo bem? Você pode resolver verificando se o elemento que hitou o marker é um player, e se for se ele está logado. Teste desta maneira: ------------------------------------------------------------------------------ -------------------------------[PORTÃO PRENDER]------------------------------- ------------------------------------------------------------------------------ --- MARKERS --- local gate3 = createObject(986, 1588.599609375, -1638.2998046875, 13.199999809265, 0, 0, 0) local marker3 = createMarker(1588.599609375, -1638.2998046875, 13.199999809265, "cylinder", 5, 0, 0, 0, 0) --- FUNÇÃO ABRIR --- function moveGate3(thePlayer) if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then if not isGuestAccount(getPlayerAccount(thePlayer)) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 4.5) end end end end addEventHandler("onMarkerHit", marker3, moveGate3) --- FUNÇÃO FECHAR --- function move_back_gate3() moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 13.199999809265) end addEventHandler("onMarkerLeave", marker3, move_back_gate3)
  17. Men, não sei explicar o porque (realmente) Mas mudei o nome da função aqui e funcionou kk Realmente da maneira que está não funciona...
  18. Já tem isso no seu código, apenas fiz algo para aparecer caso ele não tenha armamento: --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] ------------ Variaveis Comando = "p" ACL = "policial" -------------------------------- Funções Iniciais function AbrirPainel(source, comando, id) if(id) then local playerID = tonumber(id) if(playerID) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(ACL)) then if getElementData(source, "TS:Abordando") then return end local Jogador = getPlayerID(playerID) if not Jogador then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffNão foi possivel encontrar o jogador !", "info") return end --if Jogador == source then return end local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(source, "TS:AbrirPolicial", source) setElementData(source, "TS:Abordando", Jogador) toggleAllControls ( source, false ) end end end end addCommandHandler(Comando, AbrirPainel) function FecharPolicial (source) toggleAllControls (source, true ) end addEvent("TS:FecharPolicial", true) addEventHandler("TS:FecharPolicial", root, FecharPolicial) function Algemar (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then if getElementData(Jogador, "TS:Algemado") == false then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end toggleAllControls (Jogador, false ) setElementData(Jogador, "TS:Algemado", true) setElementFrozen(Jogador, true) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi algemado!", "info") setPedAnimation( Jogador, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false) else local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end setPedAnimation(Jogador, nil) toggleAllControls (Jogador, true ) setElementData(Jogador, "TS:Algemado", false) setElementFrozen(Jogador, false) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi desalgemado!", "info") end end end addEvent("TS:Algemar", true) addEventHandler("TS:Algemar", root, Algemar) function Revistar (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO Policial está te revistando!", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador está pedido!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está pedido!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(A)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(B)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(C)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(D)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(E)") == true then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true) else outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true) end local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0 local arma = false for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) arma = true outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true) end end if not arma then outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está armado!",source,255,0,0,true) end end end addEvent("TS:Revistar", true) addEventHandler("TS:Revistar", root, Revistar) VeiculoPolicial = {} function salvacarro (vei, assento, vitima) VeiculoPolicial[source] = vei end addEventHandler ('onPlayerVehicleEnter', root, salvacarro) function ColocarNaViatura (source) local Jogador = getElementData(source, "TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end local viatura = VeiculoPolicial[source] if VeiculoPolicial[source] then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te colocou na viatura !", "info") attachElements (Jogador, viatura, 0.2, -1.5, 0, 0,0,90) setPedAnimation(Jogador, "ped", "CAR_dead_LHS", false, false) local RotVX, RotVY, RotVZ = getElementRotation(viatura) setElementRotation(Jogador, RotVX, RotVY, RotVZ + 65) end end end addEvent ( "TS:ColocarNaViatura", true ) addEventHandler ( "TS:ColocarNaViatura", root, ColocarNaViatura) function RemoverNaViatura (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end local viatura = VeiculoPolicial[source] if VeiculoPolicial[source] then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te removeu da viatura !", "info") detachElements (Jogador, viatura) setPedAnimation(Jogador,nil) local PosX, PosY, PosZ = getElementPosition(Jogador) setElementPosition(Jogador, PosX, PosY, PosZ + 2) end end end addEvent ( "TS:RemoverNaViatura", true ) addEventHandler ( "TS:RemoverNaViatura", root, RemoverNaViatura) function ApreenderArmas (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial removeu todas as suas armas!", "info") takeAllWeapons(Jogador) end end addEvent ( "TS:ApreenderArmas", true ) addEventHandler ( "TS:ApreenderArmas", root, ApreenderArmas) function ApreenderPorte (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end if getElementData(Jogador, "AirNewSCR_Porte_de_Armas") == "Sim" then triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") setElementData(Jogador, "AirNewSCR_Porte_de_Armas", nil) end end end addEvent ( "TS:ApreenderPorte", true ) addEventHandler ( "TS:ApreenderPorte", root, ApreenderPorte) function ApreenderDrogas (source) local Jogador = getElementData( source,"TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial apreendeu suas drogas!", "info") setElementData(Jogador, "TS:Maconha", 0) setElementData(Jogador, "TS:Cocaina", 0) setElementData(Jogador, "TS:Heroina", 0) setElementData(Jogador, "TS:Crack", 0) setElementData(Jogador, "TS:LSD", 0) end end addEvent ( "TS:ApreenderDrogas", true ) addEventHandler ( "TS:ApreenderDrogas", root, ApreenderDrogas) function AlterarFicha (source, Quantidade) local Jogador = getElementData( source, "TS:Abordando") if Jogador then local cx, cy, cz = getElementPosition ( Jogador ) local px, py, pz = getElementPosition ( source ) local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end setPlayerWantedLevel(Jogador, Quantidade) triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial alterou a sua ficha criminal!", "info") end end addEvent ( "TS:AlterarFicha", true ) addEventHandler ( "TS:AlterarFicha", root, AlterarFicha) --------------------- Não Meche 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
  19. Olá, boa noite tudo bem? Fiz desta maneira, imagino que seja isso que esteja procurando hehe. Testa e me avisa ai meu querido! local var = { comandos = {}, } addEventHandler("onResourceStart", root, function () var.comandos = {} local resourceTable = getResources() for _, resourceValue in ipairs(resourceTable) do local comandos = getCommandHandlers(resourceValue) for _, v in ipairs(comandos) do var.comandos.v = true end end end) addEventHandler("onPlayerCommand", getRootElement(), function (cmd) if not var.comandos.cmd then outputChatBox("[ERRO] Esse comando não existe. Digite: /Ajuda ou peça suporte a um Administrador.", source, 255, 0, 0) end end)
  20. Para isso você deve armazenar todos os objetos dentro de uma tabela, e depois entrar na tabela e remover todos os objetos que ali estão... local objetos = {} function createObjectCommand(thePlayer, commandName) if (thePlayer) then local x, y, z = getElementPosition(thePlayer) local theObject = createObject(1238, x, y, z - 0.50, 0, 0, 0) if (theObject) then table.insert(objetos, {theObject}) end end end addCommandHandler("cone", createObjectCommand) addCommandHandler("remover", function (thePlayer) if objetos and #objetos > 0 then for i, v in ipairs(objetos) do if v and isElement(v) then destroyElement(v) end end end end
  21. local vehiclesSirene = {} function apagar() if (vehiclesSirene[source]) and isElement(vehiclesSirene[source]) then destroyElement(vehiclesSirene[source]) end end addEvent("startSireSound2",true) addEventHandler("startSireSound2",root,apagar)
  22. Como você tentou fazer? nos mostre o código...
  23. Ou, pode tentar "burlar"... Coloque isso no arquivo shared, imagino que tenha e seja descompilado. _getRemoteRequestInfo = getRemoteRequestInfo function getRemoteRequestInfo(valor) if valor then return _getRemoteRequestInfo else return {} end end
×
×
  • Create New...