~DarkRacer~ Posted March 7, 2013 Posted March 7, 2013 is there a function returns an integer of the active players in the map(RACE)?
Castillo Posted March 7, 2013 Posted March 7, 2013 You mean the alive players? if so, I'm not sure, but you can make one really easy. function getRaceAlivePlayers ( ) local players = 0 for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then players = ( players + 1 ) end end return players end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
~DarkRacer~ Posted March 7, 2013 Author Posted March 7, 2013 Yes i mean the alive player thanks. the for loop is really difficult to understand
Castillo Posted March 7, 2013 Posted March 7, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
PaiN^ Posted March 7, 2013 Posted March 7, 2013 You mean the alive players? if so, I'm not sure, but you can make one really easy. function getRaceAlivePlayers ( ) local players = 0 for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then players = ( players + 1 ) end end return players end You should add that to the wiki Useful Functions " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
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