Jump to content

[help] Hitman


Recommended Posts

This script is for an admin for bounty on his head I want to by any player could reward for the head of any player

example: / reward (nameplayer) (money)

And who kill the player wins the reward offered

What do I add?

  
huntingEvent = { 
    huntingOn = false, 
    adminElement = nil, 
    reward = 0, 
} 
function PlayerWasted( ammo, attacker, weapon, bodypart ) 
    if huntingEvent.huntingOn then 
        if attacker then 
            if ( getElementType ( attacker ) == "player" ) then 
                if source == huntingEvent.adminElement then 
                    if huntingEvent.reward > 0 then 
                        givePlayerMoney(attacker,huntingEvent.reward) 
                        outputChatBox("O Adm " .. getPlayerName(source) .. " está morto!",getRootElement(),255,255,255,true) 
                        outputChatBox("---- Killer: ".. getPlayerName(attacker) .. " ----",getRootElement(),255,255,255,true) 
                        outputChatBox("---- Reward: ".. tostring(huntingEvent.reward) .. " ----") 
                        if getWeaponNameFromID(weapon) then 
                            outputChatBox("---- Weapon: ".. getWeaponNameFromID(weapon) .. " ----") 
                        end 
                        huntingEvent.huntingOn = false 
                        huntingEvent.adminElement = nil 
                        huntingEvent.reward = 0 
                    else 
                        outputChatBox("The Hunting Event has a reward of $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 == huntingEvent.adminElement then 
        outputChatBox("The Admin for hunting Event has Joined the game!") 
        outputChatBox("Resuming Adminhunting!") 
        huntingEvent.huntingOn = true 
        huntingEvent.adminElement = source 
    end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), PlayerJoin ) 
  
function PlayerQuit(quitType) 
    if source == huntingEvent.adminElement then 
        outputChatBox("The Admin for hunting Event has left the Game!") 
        outputChatBox("Adminhunting stopped!") 
        huntingEvent.huntingOn = false 
    end 
end 
addEventHandler("onPlayerQuit",getRootElement(),PlayerQuit) 
  
function startAdminHunting(player, commandName,cReward) 
    if not huntingEvent.huntingOn then 
        if cReward and tonumber(cReward) > 0 then 
            huntingEvent.huntingOn = true 
            huntingEvent.adminElement = player 
            huntingEvent.reward = cReward 
            outputChatBox("Admin Hunting has been started!",getRootElement(),255,0,0) 
            outputChatBox("You must kill the Admin: " .. getPlayerName(player),getRootElement(),255,0,0,true) 
            outputChatBox("---- Happy Killing ----",getRootElement(),0,255,0) 
        else 
            outputChatBox("/".. commandName .. " [Reward]",player) 
        end 
    else 
        huntingEvent.huntingOn = false 
        huntingEvent.adminElement = nil 
        huntingEvent.reward = 0 
        outputChatBox("A recompensa pelo admin!",getRootElement(),255,0,0) 
        outputChatBox("---- The Admin has stopped the Admin hunting ----",getRootElement(),0,255,0) 
    end 
end 
addCommandHandler("adminhunting",startAdminHunting) 
  
function isPlayerAdminHunting(player) 
    if player == huntingEvent.adminElement then 
        return true 
    else 
        return false 
    end 
end 

Sorry I know I'm asking a lot is that I can not!

Help-me Plis :(

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