^Dev-PoinT^ Posted October 21, 2011 Share Posted October 21, 2011 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 Link to comment
Castillo Posted October 21, 2011 Share Posted October 21, 2011 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
^Dev-PoinT^ Posted October 21, 2011 Author Share Posted October 21, 2011 has Lost His Armor For Dead in Round Noob!" he say it even if i dont have Armor how To Fix This Link to comment
Castillo Posted October 21, 2011 Share Posted October 21, 2011 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
^Dev-PoinT^ Posted October 21, 2011 Author Share Posted October 21, 2011 Thx SoldSnake14 You Have Helped me so mutch i relay appreciate my Frind Link to comment
^Dev-PoinT^ Posted October 21, 2011 Author Share Posted October 21, 2011 SoldSnake There is one last problem i got the armor but when map end and move to Lobey BaseMode Armor gone ! can you make it if killer kill the player he lost his Armor Link to comment
^Dev-PoinT^ Posted October 21, 2011 Author Share Posted October 21, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now