Jump to content

Ganar Dinero Con Muertes


Monsthers

Recommended Posts

Hola saludos a todos, bueno vamos al grano, se que hay un script que al matar a un jugador te dan dinero ese script esta en la comunidad se llama ''killmoney'' Pero como ago que cuando un jugador de un team (POLICE) mate a un jugador de otro team (CRIMINAL) Gane cierta cantida de dinero? Aki el codigo del script

function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) 
  
    if ( killer ) and ( killer ~= source ) then 
        givePlayerMoney ( killer, 1000 ) 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) 

Link to comment
function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) 
    if ( killer ) and ( killer ~= source ) then 
         if isPlayerInTeam( killer, "POLICE" ) and isPlayerInTeam( source, "CRIMINAL" ) then 
            givePlayerMoney ( killer, 1000 ) 
         end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) 
  
function isPlayerInTeam(player, team) 
    assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") 
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") 
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) 
end 

Link to comment
  • Recently Browsing   0 members

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