micheal1230 Posted June 15, 2012 Share Posted June 15, 2012 Well There Is No Errors But When i Join The Team It Does'nt Say There Is 1 Player On The Team Client: addEvent("tdmstart", true) addEventHandler("tdmstart",root, function() addEventHandler("onClientRender", root, drawthetext) end) function drawthetext() local redteamname = getTeamFromName("Red Team") local blueteamname = getTeamFromName("Blue Team") local redp = countPlayersInTeam( redteamname ) local bluep = countPlayersInTeam( blueteamname ) local screenWidth, screenHeight = guiGetScreenSize() local ax, ay = screenWidth - 90, 200 local ax1, ay1 = screenWidth - 92, 180 dxDrawText("Red Team: "..tostring(redp), ax,ay) dxDrawText("Blue Team: "..tostring(bluep), ax1,ay1) end addEvent("stoptdm",true) addEventHandler("stoptdm",root, function() removeEventHandler("onClientRender", root, drawthetext) end ) Server (Team Join Commands ) : addCommandHandler("joinredteam", function(thePlayer, commandName) setPlayerTeam(thePlayer, "Red Team") outputChatBox("You are on the Red Team.",thePlayer) end ) addCommandHandler("joinblueteam", function(thePlayer, commandName) setPlayerTeam(thePlayer, "Blue Team") outputChatBox("You are on the Blue Team.",thePlayer) end ) Link to comment
micheal1230 Posted June 15, 2012 Author Share Posted June 15, 2012 dont make 50000000 topics Mate Dont Make Useless Comments And These Are All About Different Things Not The Same Thing Link to comment
Kenix Posted June 15, 2012 Share Posted June 15, 2012 setPlayerTeam(thePlayer, "Blue Team") 2 argument should be team element NOT STRING! Read wiki please! Link to comment
micheal1230 Posted June 15, 2012 Author Share Posted June 15, 2012 setPlayerTeam(thePlayer, "Blue Team") 2 argument should be team element NOT STRING! Read wiki please! Thanks How Can I Set The Whole Server To No Team When i type a command? Link to comment
TAPL Posted June 15, 2012 Share Posted June 15, 2012 Thanks How Can I Set The Whole Server To No Team When i type a command? addCommandHandler("noteam", function(thePlayer) outputChatBox("All Players is now without team.",thePlayer) for _, player in ipairs(getElementsByType("player")) do setPlayerTeam(player, nil) end end) Link to comment
micheal1230 Posted June 15, 2012 Author Share Posted June 15, 2012 Thanks How Can I Set The Whole Server To No Team When i type a command? addCommandHandler("noteam", function(thePlayer) outputChatBox("All Players is now without team.",thePlayer) for _, player in ipairs(getElementsByType("player")) do setPlayerTeam(player, nil) end end) how can i set the teams to be fair like auto assign how can i check if the teams are equal Link to comment
TAPL Posted June 15, 2012 Share Posted June 15, 2012 how can i set the teams to be fair like auto assign how can i check if the teams are equal https://wiki.multitheftauto.com/wiki/CountPlayersInTeam In Wiki Example 3 Link to comment
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