Jump to content

[help] Functions


Recommended Posts

this is for when someone type / hitman (nameplayer) (money) put a bounty on the death of someone, the more wrong What did not work?

HitmanEvent = { 
    reward = 0, 
} 
  
function Hitman( ammo, attacker, weapon, bodypart ) 
        if attacker then 
            if ( getElementType ( attacker ) == "player" ) then 
                if source == HitmanEvent then 
                    if HitmanEvent.reward > 0 then 
                        givePlayerMoney(attacker,HitmanEvent.reward) 
                        outputChatBox("O player " .. getPlayerName(source) .. " está morto!",getRootElement(),255,255,255,true) 
                        outputChatBox("Matador: ".. getPlayerName(attacker) .. " ",getRootElement(),255,255,255,true) 
                        outputChatBox("Recompensa: ".. tostring(huntingEvent.reward) .. " -") 
                        if getWeaponNameFromID(weapon) then 
                            outputChatBox("arma: ".. getWeaponNameFromID(weapon) .. "-- ") 
  
                        huntingEvent.HitmanOn = false 
                        huntingEvent.Element = nil 
                        huntingEvent.reward = 0 
                    else 
                        outputChatBox("A recompensa pela morte é de $0!",attacker) 
                        huntingEvent.huntingOn = false 
                        huntingEvent.adminElement = nil 
                        huntingEvent.reward = 0 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler("onPlayerWasted",getRootElement(),PlayerWasted) 
  
function PlayerJoin() 
    if source == HitmanEvent.Element then 
        outputChatBox("O player " .. getPlayerName(source) .. "voltou para o servidor MATE-o!",getRootElement(),255,255,255,true) 
        outputChatBox("Resumindo...!") 
        HitmanEvent.HitmanOn = true 
        HitmanEvent.Element = source 
    end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), PlayerJoin ) 
  
function PlayerQuit(quitType) 
    if source == HitmanEvent.Element then 
        outputChatBox("O player " .. getPlayerName(source) .. "saiu do servidor!",getRootElement(),255,255,255,true) 
        outputChatBox("Hitman Parado!") 
        HitmanEvent.HitmangOn = false 
    end 
end 
addEventHandler("onPlayerQuit",getRootElement(),PlayerQuit) 
  
function startHitman(player, commandName,cReward) 
    if not HitmanEvent.HitmanOn then 
        if cReward and tonumber(cReward) > 0 then 
            HitmanEvent.HitmanOn = true 
            HitmanEvent.reward = cReward 
            player = getPlayerCurtName 
            outputChatBox("O hitman foi iniciado novamente!",getRootElement(),255,0,0) 
            outputChatBox("Cumpra sua missão",getRootElement(),0,255,0) 
            outputChatBox("Cumpra sua missão",getRootElement(),0,255,0) 
        else 
            outputChatBox("/".. commandName .. " [Reward]",player) 
        end 
    else 
        HitmanEvent.HitmanOn = false 
        HitmanEvent.Element = nil 
        HtmanEvent.reward = 0 
        outputChatBox("A recompensa pelo player!",getRootElement(),255,0,0) 
        outputChatBox("O hitman foi parado novamente.",getRootElement(),0,255,0) 
    end 
end 
addCommandHandler("hitman",startHitman) 
  
function isPlayerHitman(thePlayer) 
    if player == HitmanEvent.HitmanElement then 
        return true 
    else 
        return false 
    end 
end 
  

Help-me

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...