K4stic Posted May 11, 2014 Share Posted May 11, 2014 Hello MTAsa Community i have an problem with this script i don't know how to solve it the porblem is that they not pass the line 7 local WonSteak = {} function getWonSteakonMapComplete( ) local totalPlayers = getPlayerCount ( ) if ( totalPlayers >= 1 ) then local position = getAliveRacePlayersSteak() if ( position == 1 ) then ------------------------------------------------ -- BlaBLa the other part of Code blabla -- ------------------------------------------------ end end end addEventHandler ( "onPlayerWasted", root, getWonSteakonMapComplete ) function getAliveRacePlayersSteak() local alivePlayers = 0 for index, player in ipairs(getElementsByType("player")) do if getElementData( player, "state" ) == "alive" then alivePlayers = alivePlayers + 1 end end return alivePlayers end Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 I don't understand the problem. Is it that "position" is not returning 1? Link to comment
K4stic Posted May 11, 2014 Author Share Posted May 11, 2014 i think yes they not return 1 i will example: like we are 2 players in server and 1 die they nothing happen. till line 7 all work Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 And what is "position" returning? what value? Link to comment
K4stic Posted May 11, 2014 Author Share Posted May 11, 2014 check lines from 16 till 24 all are in code Link to comment
Castillo Posted May 11, 2014 Share Posted May 11, 2014 I know what it's meant to return, but I mean what is returning when you test it, if it's not returning 1, then it has to be returning another value. 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