Jump to content

Team Spawnpoint


Recommended Posts

Basicly this;

addEventHandler ( "onPlayerLogin", root, function ( ) 
    if ( isPlayerInACL ( source, "Forever" ) ) then 
        spawnPlayer ( source, 5, 00565, 95 ) 
    elseif -- so on 
    end 
end ) 
  
function isPlayerInACL(player,acl) 
    local account = getAccountName(getPlayerAccount(player)) 
    if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then 
        return true 
    else 
        return false 
    end 
end 

Link to comment

Are the teams have been created? if so try this

local gTeam = 
{ 
  --['Team Name'] = { PosX, PosY, PosZ, Rotation, SkinID, interior, dimension  } 
    [ 'Forever' ] = { 0, 0, 0, 0, 0, 0, 0 }, 
    [ 'Saint Row' ] = { 0, 0, 0, 0, 0, 0, 0 } 
}; 
  
addEventHandler( 'onPlayerSpawn', root, 
    function( _, _, _, _, theTeam ) 
        if gTeam[ theTeam ] then 
            spawnPlayer( source, gTeam[ theTeam ][ 1 ], gTeam[ theTeam ][ 2 ], gTeam[ theTeam ][ 3 ], gTeam[ theTeam ][ 4 ], gTeam[ theTeam ][ 5 ], gTeam[ theTeam ][ 6 ], gTeam[ theTeam ][ 7 ] ); 
            fadeCamera( source, true ); 
            setCameraTarget( source, source ); 
        end 
    end 
); 

P.S : You have to spawn them before.

Link to comment
  
addEventHandler ( "onPlayerLogin", root, function ( ) 
    if ( isPlayerInACL ( source, "Forever" ) ) then 
        spawnPlayer ( source, 5, 00565, 95 ) 
    elseif 
    ( isPlayerInACL ( source, "Saint Row" ) ) then 
        spawnPlayer ( source, 5, 00565, 95 ) 
    end 
end ) 
  
function isPlayerInACL(player,acl) 
    local account = getAccountName(getPlayerAccount(player)) 
    if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then 
        return true 
    else 
        return false 
    end 
end 
  

Like that ?

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