MTA Team 0xCiBeR Posted February 28, 2013 MTA Team Share Posted February 28, 2013 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
Castillo Posted February 28, 2013 Share Posted February 28, 2013 setPlayerTeam necesita un elemento de un team, no el nombre, usa getTeamFromName. Link to comment
Sasu Posted March 1, 2013 Share Posted March 1, 2013 Ademas puedes remplazar el onPlayerJoin y onPlayerWasted por onPlayerSpawn Link to comment
MTA Team 0xCiBeR Posted March 3, 2013 Author MTA Team Share Posted March 3, 2013 Gracias Solid y Sasuke Link to comment
Recommended Posts