ZaaKScripter Posted October 6, 2020 Posted October 6, 2020 Galera, recentemente adquiri um mod de painel policial pro meu servidor, porem a função de revistar dele ta com algum bug, quando coloco pra revistar ele mostra apenas a CNH do player e o nivel de procurado, porem não mostra as armas que ele possui. Agradeceria muito se alguem conseguisse me ajduar. A função de revistar do script: function Revistar (source) local Jogador = getElementData(source, "PX:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "**Policial está te revistando!**", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("**O jogador está pedido!**",source,255,0,0,true) else outputChatBox("**O jogador não está pedido!**",source,255,0,0,true)--------------------------------COR COR end if getElementData(Jogador,"DNL:Categoria(A)") == true then outputChatBox("**O jogador tem Habilitação A!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação A!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(B)") == true then outputChatBox("**O jogador tem Habilitação B!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação B!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(C)") == true then outputChatBox("**O jogador tem Habilitação C!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação C!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(D)") == true then outputChatBox("**O jogador tem Habilitação D!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação D!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(E)") == true then outputChatBox("**O jogador tem Habilitação E!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação E!**",source,255,0,0,true) end local Quantidade = getElementData(source, "PX:"..Droga_Selecionada.."") or 0 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("**O jogador tem "..NomeDaArma.."!**",source,255,0,0,true) end end end end addEvent("PX:Revistar", true) addEventHandler("PX:Revistar", root, Revistar)
Moderators Patrick Posted October 6, 2020 Moderators Posted October 6, 2020 Wrong language and section, moved to Portuguese section.
HiroShi Posted October 12, 2020 Posted October 12, 2020 On 06/10/2020 at 10:46, ZaaKScripter said: Galera, recentemente adquiri um mod de painel policial pro meu servidor, porem a função de revistar dele ta com algum bug, quando coloco pra revistar ele mostra apenas a CNH do player e o nivel de procurado, porem não mostra as armas que ele possui. Agradeceria muito se alguem conseguisse me ajduar. A função de revistar do script: function Revistar (source) local Jogador = getElementData(source, "PX:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "**Policial está te revistando!**", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("**O jogador está pedido!**",source,255,0,0,true) else outputChatBox("**O jogador não está pedido!**",source,255,0,0,true)--------------------------------COR COR end if getElementData(Jogador,"DNL:Categoria(A)") == true then outputChatBox("**O jogador tem Habilitação A!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação A!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(B)") == true then outputChatBox("**O jogador tem Habilitação B!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação B!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(C)") == true then outputChatBox("**O jogador tem Habilitação C!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação C!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(D)") == true then outputChatBox("**O jogador tem Habilitação D!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação D!**",source,255,0,0,true) end if getElementData(Jogador,"DNL:Categoria(E)") == true then outputChatBox("**O jogador tem Habilitação E!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação E!**",source,255,0,0,true) end local Quantidade = getElementData(source, "PX:"..Droga_Selecionada.."") or 0 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("**O jogador tem "..NomeDaArma.."!**",source,255,0,0,true) end end end end addEvent("PX:Revistar", true) addEventHandler("PX:Revistar", root, Revistar) CNHCategorias = { {"A"}, {"B"}, {"C"}, {"D"}, {"E"}, } function Revistar (source) local Jogador = getElementData(source, "PX:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "**Policial está te revistando!**", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("**O jogador está procurado pela justiça!**",source,255,0,0,true) else outputChatBox("**O jogador não está pedido!**",source,255,0,0,true)--------------------------------COR COR end for i,v in ipairs(CNHCategorias) do if getElementData(Jogador,"DNL:Categoria("..v[1]..")") == true then outputChatBox("**O jogador tem Habilitação "..v[1].."!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação "..v[1].."!**",source,255,0,0,true) end end local Quantidade = getElementData(source, "PX:"..Droga_Selecionada.."") or 0 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("**O jogador tem "..NomeDaArma.."!**",source,255,0,0,true) end end end end addEvent("PX:Revistar", true) addEventHandler("PX:Revistar", root, Revistar) pfv use esse código, está mais otimizado 1
ZaaKScripter Posted October 14, 2020 Author Posted October 14, 2020 On 11/10/2020 at 22:01, HiroShi said: CNHCategorias = { {"A"}, {"B"}, {"C"}, {"D"}, {"E"}, } function Revistar (source) local Jogador = getElementData(source, "PX:Abordando") if Jogador then setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false) triggerClientEvent(Jogador, "addNotification", root, "**Policial está te revistando!**", "info") if getPlayerWantedLevel(Jogador) >= 1 then outputChatBox("**O jogador está procurado pela justiça!**",source,255,0,0,true) else outputChatBox("**O jogador não está pedido!**",source,255,0,0,true)--------------------------------COR COR end for i,v in ipairs(CNHCategorias) do if getElementData(Jogador,"DNL:Categoria("..v[1]..")") == true then outputChatBox("**O jogador tem Habilitação "..v[1].."!**",source,255,0,0,true) else outputChatBox("**O jogador não tem Habilitação "..v[1].."!**",source,255,0,0,true) end end local Quantidade = getElementData(source, "PX:"..Droga_Selecionada.."") or 0 for slot = 0, 12 do local Armamento = getPedWeapon ( Jogador, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) outputChatBox("**O jogador tem "..NomeDaArma.."!**",source,255,0,0,true) end end end end addEvent("PX:Revistar", true) addEventHandler("PX:Revistar", root, Revistar) pfv use esse código, está mais otimizado Vlwzao mano, ajudou demais, obrigadao ae
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now