Jump to content

Help


golanu21

Recommended Posts

wich team, wich function?

edit: try this;

addCommandHandler("startFunc", 
    function ( source, commandName ) 
        for i, players in ipairs(getElementType("player")) do 
            local team = getPlayerTeam ( player ) 
            if team then 
                function_name_here(Parameters, here) 
            end 
        end 
    end 
) 

Link to comment
function example(player) 
    if(getPlayerTeam(player) == getTeamFromName("TeamName")) then 
        -- do something 
    else -- if not 
        return -- return 
    end 
end 

if(getPlayerTeam(player) == getTeamFromName("TeamName")) then 

Basiclly checks if the player is in that team, that's what i guess you want.

For your request if in criminal team:

if(getPlayerTeam(player) == getTeamFromName("Criminal")) then 

Link to comment

oh, try this then;

addCommandHandler("startFunc", 
    function ( source, commandName ) 
        for i, players in ipairs(getElementType("player")) do 
            local team = getPlayerTeam ( player ) 
            if ( team and getTeamName(team) == "criminal" ) then 
                function_name_here(Parameters, here) 
            end 
        end 
    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...