Jump to content

problema con setPlayerTean


0xCiBeR

Recommended Posts

  • MTA Team

Bueno el problema esta cuando le indico q despues que spawnee, me agregue el jugador a un team especifico...

PD:No da errores, solo no lo agrega

function createTeamsOnStart () 
     createTeam ( "RAAZ", 255, 255, 255 )  
     createTeam ( "PDz", 255, 0, 0 ) 
     createTeam ( "CEA", 255, 255, 0 ) 
     createTeam ( "Army", 0, 192, 0 ) 
     createTeam ( "Police", 0, 0, 200 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  )  
  
  
  
addEventHandler( "onPlayerLogin", resourceRoot, 
  function() 
      resetMapInfo() 
       for _,player in ipairs( getElementsByType 'player' ) do 
        spawn( player ) 
      end 
   end 
) 
      
function spawn( player ) 
  if not isElement( player ) then return end 
     showChat( player, true ) 
     local acc = getPlayerAccount( player ) 
      if acc and not isGuestAccount( acc ) then 
         if isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "RAAZ" ) ) then 
            setPlayerTeam ( player, "RAAZ" ) 
            spawnPlayer ( player, -2477.9606933594, 494.64392089844, 30.07054901123, 90, 287 ) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "PDz" ) ) then 
            setPlayerTeam ( player, "PDz" ) 
            spawnPlayer ( player, -2477.9606933594, 494.64392089844, 30.07054901123, 90, 287 ) 
         elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "CEA" ) ) then 
            setPlayerTeam ( player, "CEA" )          
            spawnPlayer ( player, -2477.9606933594, 494.64392089844, 30.07054901123, 90, 287 ) 
 elseif isObjectInACLGroup ( "user.".. getAccountName( acc ), aclGetGroup ( "USFU" ) ) then 
            setPlayerTeam ( player, "CEA" )          
            spawnPlayer ( player, -2477.9606933594, 494.64392089844, 30.07054901123, 90, 287 ) 
       end 
      
     end 
      fadeCamera( player, true ) 
      setCameraTarget( player, player ) 
end 
      
addEventHandler( "onPlayerJoin", root, 
  function( ) 
    spawn( source ) 
end) 
      
addEventHandler( "onPlayerWasted", root, 
  function( ) 
     setTimer( spawn, 500, 1, source ) 
end) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...