DouglaS666 Posted July 14, 2018 Posted July 14, 2018 (edited) Ao tentar blindar fora de um veículo, quero que apareça para o Jogador um erro/aviso em outputChatBox "Você deve estar em um veículo parar usar o /blindar" E como libero o comando para Todos jogadores? até mesmo sem o Painel? Ficarei grato quem poder me Ajudar Server: function vehicleGodMod(player) if not (hasObjectPermissionTo(player,"general.adminpanel",false)) then outputChatBox("Erro você não tem acesso ao /blindar" ,player,255) return end if (isVehicleDamageProof(getPedOccupiedVehicle(player))) then setVehicleDamageProof(getPedOccupiedVehicle(player),false) outputChatBox("Você Desblindou Seu Veículo!",player,255) else setVehicleDamageProof(getPedOccupiedVehicle(player),true) outputChatBox("Você Blindou Seu Veículo!",player,0,255) end end addCommandHandler("blindar",vehicleGodMod) addCommandHandler("blindar",vehicleGodMod) Edited July 14, 2018 by DouglaS666
carlos eduardo Posted July 14, 2018 Posted July 14, 2018 Acho que da para usar a função getPedOcuppiedVehicle. getPedOcuppiedVehicle EX: function vehicleGodMod(player, thePlayer) if not (hasObjectPermissionTo(player,"general.adminpanel",false)) then outputChatBox("Erro você não tem acesso ao /blindar" ,player,255) return end if (isVehicleDamageProof(getPedOccupiedVehicle(player))) then if theVehicle then setVehicleDamageProof(getPedOccupiedVehicle(player),false) outputChatBox("Você Desblindou Seu Veículo!",player,255) else local theVehicle = getPedOccupiedVehicle ( thePlayer ) if theVehicle then setVehicleDamageProof(getPedOccupiedVehicle(player),true) outputChatBox("Você Blindou Seu Veículo!",player,0,255) end end addCommandHandler("blindar",vehicleGodMod) addCommandHandler("blindar",vehicleGodMod) obs:não sei tanto de script ent.
Moderators Lord Henry Posted July 14, 2018 Moderators Posted July 14, 2018 Faça assim: function vehicleGodMod (thePlayer) if not hasObjectPermissionTo (thePlayer, "general.adminpanel", false) then outputChatBox ("Erro você não tem acesso ao /blindar", thePlayer, 255) return end local theVehicle = getPedOccupiedVehicle (thePlayer) if theVehicle and isElement (theVehicle) then if isVehicleDamageProof (theVehicle) then setVehicleDamageProof (theVehicle, false) outputChatBox ("Você desblindou seu veículo!", thePlayer, 255) else setVehicleDamageProof (theVehicle, true) outputChatBox ("Você blindou seu veículo!", thePlayer, 0, 255) end else outputChatBox ("Você deve estar em um veículo para usar o /blindar", thePlayer, 255, 0, 0) end end addCommandHandler ("blindar", vehicleGodMod) 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
DouglaS666 Posted July 14, 2018 Author Posted July 14, 2018 57 minutes ago, Lord Henry said: Faça assim: function vehicleGodMod (thePlayer) if not hasObjectPermissionTo (thePlayer, "general.adminpanel", false) then outputChatBox ("Erro você não tem acesso ao /blindar", thePlayer, 255) return end local theVehicle = getPedOccupiedVehicle (thePlayer) if theVehicle and isElement (theVehicle) then if isVehicleDamageProof (theVehicle) then setVehicleDamageProof (theVehicle, false) outputChatBox ("Você desblindou seu veículo!", thePlayer, 255) else setVehicleDamageProof (theVehicle, true) outputChatBox ("Você blindou seu veículo!", thePlayer, 0, 255) end else outputChatBox ("Você deve estar em um veículo para usar o /blindar", thePlayer, 255, 0, 0) end end addCommandHandler ("blindar", vehicleGodMod) Deu certo Lord, Obrigado
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