Jump to content

help me in small Script :)


^Dev-PoinT^

Recommended Posts

Hi all i have made This

function() 
local pC= getAlivePlayers() 
if ( pC >= 1,3) then 
for id, player in ipairs ( getElementsByType ( "player" ) ) do 
setPlayerArmor ( player, 50 ) 
outputChatBox(..getPlayerName..Has won 50% Armor For Alive on Round,root,") 
outputChatBox("You Have won Free Armor for be Alive in Round",getLocalPlayer() 
end 
end 
 

if 1 player or 3 Alive in Round give Them Armor with msg Please Fix and tell me what is my errors :(

:D

Link to comment
Hi all i have made This
function() 
local pC= getAlivePlayers() 
if ( pC >= 1,3) then 
for id, player in ipairs ( getElementsByType ( "player" ) ) do 
setPlayerArmor ( player, 50 ) 
outputChatBox(..getPlayerName..Has won 50% Armor For Alive on Round,root,") 
outputChatBox("You Have won Free Armor for be Alive in Round",getLocalPlayer() 
end 
end 
  
  
  
 

if 1 player or 3 Alive in Round give Them Armor with msg Please Fix and tell me what is my errors

if ( pC >= 1) then 

replace that with old one.

Edit

function() 
local pC= getAlivePlayers() 
if ( pC >= 1) then 
for id, player in ipairs ( getElementsByType ( "player" ) ) do 
setPlayerArmor ( player, 50 ) 
outputChatBox(getPlayerName.."Has won 50% Armor For Alive on Round",root,0 , 255, 0) 
outputChatBox("You Have won Free Armor for be Alive in Round", source()) 
end 

Try that.

Edited by Guest
Link to comment
it does not, because it's a total mess.

I've just corrected errors.

almost every line in this script has errors, and the whole thing has no logic to it.

you didnt "fixed" it all. and even then ">= 1" is not what topic starter wants.

function() -- no function name 
local pC= getAlivePlayers() -- SERVER function, which returns a TABLE 
if ( pC >= 1 ) then -- not gonna work, pC is a TABLE 
for id, player in ipairs ( getElementsByType ( "player" ) ) do -- why ALL players now? 
setPlayerArmor ( player, 50 ) -- probably single correct line (oh wait, its not: setPedArmor) 
outputChatBox(..getPlayerName..Has won 50% Armor For Alive on Round,root,")  
-- ↑ no quotes, no function call, total mess at its finest 
outputChatBox("You Have won Free Armor for be Alive in Round",getLocalPlayer() -- missing parenthesis 
-- ↑ also getLocalPlayer is a CLIENT function, and you have SERVER function above. wtf? 
end 
end 
-- no end for the function 
  
  
-- PS oh look even forum lua highligther is freaked out.  
  
  
  
 

Link to comment

what about This Pleae Help

function() 
local pC= getAlivePlayers() 
if ( pC >= 1 or 2 or 3) then 
for id, player in ipairs ( getElementsByType ( "player" ) ) do 
setPlayerArmor ( player, 50 ) 
outputChatBox(getPlayerName.."Has won 50% Armor For Alive on Round",root,0 , 255, 0) 
outputChatBox(getPlayerName.."Has won 50% Armor For Alive on Round",root,()255 , 255, 0) 
end 
end 
  

:wink:

Edited by Guest
Link to comment
what i do then ?

can you fix it if Alive Player = 3 give Them Armor with msg :(

and then you go to the scripting basics :P

function giveArmor()  
  local pC= getAlivePlayers()  
  if (#pC >= 1 and #pC <= 3) then 
    for id, player in ipairs(pC) do  
      setPedArmor(player, 50)  
      outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root) 
      outputChatBox("You Have won Free Armor for be Alive in Round", player) 
    end 
  end   
end 

Link to comment

Abio Thx For tell me my errors

and see This :P

function giveArmor()  
  local pC= getAlivePlayers()  
  if (#pC >= 1 and #pC <= 3) 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   
end 
  
addEventHandler( "onPlayerWasted", getRootElement( ), 
    function() 
    setPedArmor(player, 0) 
end) 

:P

Link to comment

why you put arguments outside function call? this is going nowhere.

function giveArmor() 
  local pC= getAlivePlayers() 
  if (#pC >= 1 and #pC <= 3) 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) 
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...