LoverX Posted August 26, 2020 Posted August 26, 2020 function MakePlayerHeadshot( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "ped" then if bodypart == 9 then triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) setPedHeadless ( source, true ) killPed( source, attacker, weapon, bodypart ) setTimer( BackUp, 900, 1, source ) end end end function MakeHeadshot( source, attacker, weapon, loss ) triggerEvent( "onPlayerHeadshot", source, attacker, weapon, loss ) killPed( source, attacker, weapon, 9 ) setPedHeadless ( source, true ) setTimer( BackUp, 900, 1, source ) end function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, false ) end end function outputHeadshotIcon (killer, weapon, bodypart) if bodypart == 9 then cancelEvent() local r2,g2,b2 = getTeamColor ( getPlayerTeam( killer ) ) local r1,g1,b1 = getTeamColor ( getPlayerTeam( source ) ) exports.killmessages:outputMessage ( {getPlayerName(killer),{"padding",width=3},{"icon",id=weapon},{"padding",width=3},{"icon",id=256},{"padding",width=3},{"color",r=r1,g=g1,b=b1},getPlayerName(source) }, getRootElement(),r2,g2,b2) end end addEvent ( "onServerHeadshot", true ) addEventHandler( "onPlayerDamage", getRootElement(), MakePlayerHeadshot ) addEventHandler( "onPlayerKillMessage", getRootElement(), outputHeadshotIcon ) addEventHandler( "onServerHeadshot", getRootElement(), MakeHeadshot ) Poderiam me ajudar? Meu staffs estão morrendo mesmo com a proteção, por favor me ajudem, não sei se o problema é no script ou na proteção staff.
Moderators Lord Henry Posted August 26, 2020 Moderators Posted August 26, 2020 (edited) A função killPed burla as proteções, pois ela não dá dano e sim mata direto. Se a sua proteção seta um elementData no jogador quando ele ativa a proteção, adicione essa condição antes no seu script de headshot. Dessa forma o jogador só irá morrer se não estiver com a elementData da proteção. Edited August 27, 2020 by Lord Henry 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.
eqFoxim Posted September 5, 2020 Posted September 5, 2020 Opa tambem estou com duvida quanto a isso, eu iria adicionar um função do elemento data que cria na proteção staff como? function hs(source) setElementData("invincible") ----o elemento da proteção crida cancelEvent(killPed) end seria isso, não sei muito de script estou tentando aprender.
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