Jump to content

[HELP] Race Steak


K4stic

Recommended Posts

Posted

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 

Posted

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

Posted

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.

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