Jump to content

Painel Policial


Recommended Posts

Alguem pode me ajudar com esse script de painel policial? ele esta funcionando quase tudo, mas não acha as armas do player

 

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
for slot = 0, 12 do
local Armamento = getPedWeapon ( Jogador, slot )
if Armamento > 0 then 
local NomeDaArma = getWeaponNameFromID ( Armamento )
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true)
end
end
end
end
addEvent("TS:Revistar", true)
addEventHandler("TS:Revistar", root, Revistar)

Link to comment

Utilize esta ferramenta para postar códigos:
0fx7Pwr.png




Fiz um sistema de revista, porém está em gui...

Você pode fazer as alterações necessárias para outputChatBox e etc.

 

                local arma1 =  getPedWeapon (player, 0)
                local arma2 =  getPedWeapon (player, 1)
                local arma3 =  getPedWeapon (player, 2)
                local arma4 =  getPedWeapon (player, 3)
                local arma5 =  getPedWeapon (player, 4)
                local arma6 =  getPedWeapon (player, 5)
                local arma7 =  getPedWeapon (player, 6)
                local arma8 =  getPedWeapon (player, 7)
                local arma9 =  getPedWeapon (player, 8)
                local arma10 = getPedWeapon (player, 9)
                local arma11 = getPedWeapon (player, 10)
                local arma12 = getPedWeapon (player, 11)
                local arma13 = getPedWeapon (player, 12)

             

                    if arma1 == 0 then
                        guiSetProperty(GUIEditor.label[4], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[4], "Text", getWeaponNameFromID (arma1))
                    end

                    if arma2 == 0 then
                        guiSetProperty(GUIEditor.label[5], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[5], "Text", getWeaponNameFromID (arma2))
                    end

                    if arma3 == 0 then
                        guiSetProperty(GUIEditor.label[6], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[6], "Text", getWeaponNameFromID (arma3))
                    end

                    if arma4 == 0 then
                        guiSetProperty(GUIEditor.label[7], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[7], "Text", getWeaponNameFromID (arma4))
                    end

                    if arma5 == 0 then
                        guiSetProperty(GUIEditor.label[8], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[8], "Text", getWeaponNameFromID (arma5))
                    end

                    if arma6 == 0 then
                        guiSetProperty(GUIEditor.label[9], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[9], "Text", getWeaponNameFromID (arma6))
                    end

                    if arma7 == 0 then
                        guiSetProperty(GUIEditor.label[10], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[10], "Text", getWeaponNameFromID (arma7))
                    end

                    if arma8 == 0 then
                        guiSetProperty(GUIEditor.label[11], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[11], "Text", getWeaponNameFromID (arma8))
                    end

                    if arma9 == 0 then
                        guiSetProperty(GUIEditor.label[12], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[12], "Text", getWeaponNameFromID (arma9))
                    end

                    if arma10 == 0 then
                        guiSetProperty(GUIEditor.label[13], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[13], "Text", getWeaponNameFromID (arma10))
                    end

                    if arma11 == 0 then
                        guiSetProperty(GUIEditor.label[14], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[14], "Text", getWeaponNameFromID (arma11))
                    end

                    if arma12 == 0 then
                        guiSetProperty(GUIEditor.label[15], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[15], "Text", getWeaponNameFromID (arma12))
                    end

                    if arma13 == 0 then
                        guiSetProperty(GUIEditor.label[16], "Text", "-")
                    else
                        guiSetProperty(GUIEditor.label[16], "Text", getWeaponNameFromID (arma13))
                    end


Provavelmente tem uma forma mais simples de se fazer, mas tenta fazer essa...

 

  • Thanks 1
Link to comment

Uma outra forma de escrever o seu exemplo @SrPattif    eh nois manoo

for i=0,12 do
	local arma = getPedWeapon(player,i)
	if arma == 0 then
		guiSetProperty(GUIEditor.label[4+i],"Text","-")
	else
		guiSetProperty(GUIEditor.label[4+i],"Text",getWeaponNameFromID(arma))
	end
end

 

  • Thanks 1
Link to comment
20 hours ago, Gw8 said:

Uma outra forma de escrever o seu exemplo @SrPattif    eh nois manoo


for i=0,12 do
	local arma = getPedWeapon(player,i)
	if arma == 0 then
		guiSetProperty(GUIEditor.label[4+i],"Text","-")
	else
		guiSetProperty(GUIEditor.label[4+i],"Text",getWeaponNameFromID(arma))
	end
end

 

Faz sentido... Não tinha pensado nisso kkk

Obrigado

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...