Jump to content

A question about setTimer's


Xeno

Recommended Posts

This is worng

Correct

function start( player ) 
    if isElement( player ) then 
        crate = createObject( 2991,-1353,-185,14 ) 
        local team = getPlayerTeam( player ) 
        local object = createObject( 2991, -1353, -185, 14 ) 
        if team then 
            local police = getTeamFromName( "Police" ) 
            local criminals = getTeamFromName( "Criminals" ) 
            
            if team == police then 
                outputChatBox( "You're a police officer.", player, 0, 255, 0 ) 
            elseif team == criminal then 
                outputChatBox( "You're a criminal.", player, 0, 255, 0 ) 
            end 
        end 
    end     
end 
  
addEventHandler("onResourceStart", resourceRoot,  
    function( resource ) 
        setTimer( 
            function ( ) 
                local players = getElementsByType( "player" ) 
                for _, player in pairs( players ) do 
                    start( player ) 
                end 
            end 
        , 7500, 
        1) 
    end 
)    

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