Jump to content

getteam name expected team at argument 1 got boolean


mongui

Recommended Posts

hi guys , i'm new to scripting , this error keeps coming up :

getteam name expected team at argument 1 got boolean

function distance () 
local players = getElementsByType ("player") 
for i,p1 in ipairs(players) do 
local team1 = getPlayerTeam( p1 ) 
local name1 = getTeamName(team1) 
    for k,p2 in ipairs(players) do 
        local team2 = getPlayerTeam(p2) 
        local name2 = getTeamName(team2) 
            if ( name1 ~= name2 ) then 
                x1,y1,z1 = getElementPosition 
                x2,y2,z2 = getElementPosition 
                if ( getDistanceBetweenPoints3D (x1 , y1 , z1 , x2 , y2 , z2 ) <= 50 ) then      
                local resource = getResourceFromName (blip)  
                startResource (resource) 
                setTimer(stopResource (resource), 5000 , 1 ) 
                end 
            end 
    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...