Jump to content

Help in My Script :D


^Dev-PoinT^

Recommended Posts

Hi all i have made This

function giveArmor() 
  local pC= getAlivePlayers() 
  if (#pC >= 1 and #pC <= 5) then 
    for id, player in ipairs(pC) do 
      setPedArmor(player, 50) 
      outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) 
      outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) 
    end 
  end   
  setPedArmor(source, 0) 
  outputChatBox(getPlayerName(player).." has Lost His Armor For Dead in Round Noob!", root, 255, 255, 0) 
end 
addEventHandler("onPlayerWasted", root, giveArmor) 

1-but there is a error at line 11 bad argument

2- if player die and dont have Armor he say This

has Lost His Armor For Dead in Round Noob

but what if the player dont have armor that my problem

:D

Link to comment
function giveArmor() 
  local pC= getAlivePlayers() 
  if (#pC >= 1 and #pC <= 5) then 
    for id, player in ipairs(pC) do 
      setPedArmor(player, 50) 
      outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) 
      outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) 
    end 
  end   
  setPedArmor(source, 0) 
  outputChatBox(getPlayerName(source).." has Lost His Armor For Dead in Round Noob!", root, 255, 255, 0) 
end 
addEventHandler("onPlayerWasted", root, giveArmor) 

Link to comment
function giveArmor() 
  local pC= getAlivePlayers() 
  if (#pC >= 1 and #pC <= 5) then 
    for id, player in ipairs(pC) do 
      setPedArmor(player, 50) 
      outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) 
      outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) 
    end 
  end   
  if getPedArmor(source) > 0 then 
       setPedArmor(source, 0) 
       outputChatBox(getPlayerName(source).." has Lost His Armor For Dead in Round Noob!", root, 255, 255, 0) 
  end 
end 
addEventHandler("onPlayerWasted", root, giveArmor) 

Link to comment

i made This

function giveArmor() 
    if ( killer ) and ( killer ~= source ) then 
    setPedArmor(killer, 48) 
    outputChatBox(getPlayerName(killer).." has won 48% Armor For Kill A Player", root, 255, 255, 0) 
    outputChatBox("You Have won Free Armor for Kill A Player", player, 0, 255, 0) 
    end 
  end   
  if getPedArmor(source) > 0 then 
    setPedArmor(source, 0) 
    outputChatBox(getPlayerName(source).." has Lost His Armor For Dead!", root, 255, 255, 0) 
  end 
end 
addEventHandler("onPlayerWasted", root, giveArmor) 

:(

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