manve1 Posted October 29, 2012 Posted October 29, 2012 How could i set maximum player amount in a team? Like for example, i created a team, and i only want that 3people would be allowed in that team, no more? thank you for the help.
Castillo Posted October 29, 2012 Posted October 29, 2012 When you set them to the team, you can check the amount of players with this function: countPlayersInTeam
manve1 Posted October 29, 2012 Author Posted October 29, 2012 i tried using that, but i didn't get how to set maximum amount allowed in a team
manve1 Posted October 29, 2012 Author Posted October 29, 2012 addEventHandler( 'onClientGUIClick', buttonJuggernaut, function() triggerServerEvent('giveJuggernautTeam', localPlayer) local theTeamJuggernaut = getTeamFromName( 'Juggernaut' ) if ( countPlayersInTeam( theTeamJuggernaut ) ) then guiSetVisible( windowTeams, false ) else tooMuchJuggernauts = guiCreateLabel( 0.2, 0.3, 0.4, 0.1, "There are to many Juggernauts already", true ) guiSetFont( tooMuchJuggernauts, "sa-header" ) end end, false ) addEvent('giveJuggernautTeam', true) addEventHandler('giveJuggernautTeam', getRootElement(), function() setPlayerTeam(source, getTeamFromName('Juggernaut')) end ) something i tried to do, but didn't work out, top is client, bottom is server sided scripts, i know they are not one of the working ones, but everything there like gui, buttons exist
Castillo Posted October 29, 2012 Posted October 29, 2012 if ( countPlayersInTeam( theTeamJuggernaut ) ) then You are not comparing it with anything. if ( countPlayersInTeam( theTeamJuggernaut ) < 3 ) then
Smart. Posted October 29, 2012 Posted October 29, 2012 if (countPlayersInTeam( theTeamJuggernaut ) > 3 ) then return end
manve1 Posted October 29, 2012 Author Posted October 29, 2012 thank you Solidsnake14, seb:> sorry, i don't have enough time to test yours too
Smart. Posted October 29, 2012 Posted October 29, 2012 It's basically the same, I just didn't see solidsnakes reply.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now