Jump to content

Headshot


#Dv^

Recommended Posts

Hola!

Disculpen, que se usa para que al matar a alguien en la cabeza salga al chat esto

  
addEventHandler("onPlayerDamage", getRootElement(), 
    function (attacker, weapon, bodypart, loss) 
        if bodypart == 9 then 
            local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) 
            if result == true then 
                outputChatBox("#2971D5[Headshot]#FFFFFF "..getPlayerName(attacker).." #FFFFFFle partió la cabeza a "..getPlayerName(source).." #FFFFFFha ganado#00FF00[+$1000]", root,0,255,0,true) 
                killPlayer(source, attacker, weapon, bodypart) 
            end 
        end 
    end 
) 

Link to comment

En la wiki te lo deja de maravilla, solo cambia el output por lo que quieras poner...

--add an event handler for the onPlayerDamage event 
function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged 
    if ( bodypart == 9 ) then -- if the body part is 9, i.e. the head 
            outputChatBox ( "Headshot!", getRootElement (), 255, 170, 0 ) --output "Headshot" into the chatbox 
        killPed ( source, attacker, weapon, bodypart ) -- and kill the player 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text ) 
  

Link to comment
  • Recently Browsing   0 members

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