Jump to content

setPlayerTeam


Chris!i!

Recommended Posts

local Gangsters = createTeam ( "Gangsters", 90, 11, 207 )

if (zone == "Las Venturas") then

setPlayerTeam ( source, Gangsters )

end

If the player just logins in LV or enter LV while he was outside of it, i want his team to turn into this team called Gangsters i tried 3 other methods still didnt work it only creates the team on the scoreboard

i could make it 100% if u guys give me LV col shape x y z

Link to comment
901.67871, 601.66272, 2050 = LVarea 
local lv = createColRectangle(901.67871, 601.66272, 2050, 2400) 
local theTeam = createTeam ( Gangsters ) 
   
function LV (thePlayer) 
outputChatBox("test, thePlayer, 255, 255, true) 
setPlayerTeam ( source, theTeam ) 
  
end 
addEventHandler("onColShapeHit", LVcolshape, LV) 
 

is this good and works perfectly?

Link to comment
lv = createColRectangle(901.67871, 601.66272, 2050, 2400) 
theTeam = createTeam("Gangsters") 
  
addEventHandler("onColShapeHit", getRootElement(), 
    function() 
        if getElementType(hitElement) == 'player' then 
            if source == lv then 
                outputChatBox("test") 
                setPlayerTeam(hitElement, theTeam) 
            end 
        end 
    end 
) 

Link to comment

Whoops, my bad, sorry! Try this:

lv = createColRectangle(901.67871, 601.66272, 2050, 2400) 
theTeam = createTeam("Gangsters") 
  
addEventHandler("onColShapeHit", getRootElement(), 
    function(hitElement) -- forgot hitElement 
        if getElementType(hitElement) == 'player' then 
            if source == lv then 
                outputChatBox("test") 
                setPlayerTeam(hitElement, theTeam) 
            end 
        end 
    end 
) 

Link to comment

lv = createColRectangle(901.67871, 601.66272, 2050, 2400)

theTeam = createTeam("Criminal")

addEventHandler("onColShapeLeave", getRootElement(),

function(hitElement)

if getElementType(hitElement) == 'player' then

if source == lv then

setPlayerTeam(hitElement, anotherTeam)

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