Jump to content

help over here.


manve1

Recommended Posts

Posted

I need help of refreshing players alive, i tried different way's to fix it my own, but nothing helped. any help accepted

     
    function getAlivePlayers ( ) 
        local players = { } 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            if ( getElementHealth ( player ) > 0 ) then 
                table.insert ( players, player ) 
            end 
  
        end 
        return players 
    end 
setTimer( getAlivePlayers, 50, 0 ) 
  
label = guiCreateLabel ( 0, 0.9525, 1, 1, "ALIVE: ".. #getAlivePlayers ( ), true ) 
guiSetFont ( label, "sa-header" ) 
guiLabelSetColor ( label, 255, 175, 0 )      
  
  

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted
function getAlivePlayers ( ) 
    local players = { } 
    for _, player in ipairs ( getElementsByType ( "player" ) ) do 
        if ( getElementHealth ( player ) > 0 ) then 
            table.insert ( players, player ) 
        end 
    end 
  
    return players 
end 
  
label = guiCreateLabel ( 0, 0.9525, 1, 1, "ALIVE: ".. #getAlivePlayers ( ), true ) 
guiSetFont ( label, "sa-header" ) 
guiLabelSetColor ( label, 255, 175, 0 ) 
  
setTimer ( 
    function ( ) 
        guiSetText ( label, "ALIVE: ".. #getAlivePlayers ( ) ) 
    end 
    ,3000, 0 
) 

That'll update it every 3 seconds.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

P.S: The "MTA Pro" group is for these who donate.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

As I said, it'll update once every 3 seconds.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Copy the code again, it works now ( tested ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Another problem, someone dies, it takes the player off the alive section then puts him back on but he is still dead

EDIT: im using this for race DD/DM

Looking for tutorials or information? check out: www.simpleask.co.uk

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