abu5lf Posted October 31, 2012 Share Posted October 31, 2012 countPlayersInTeam والمثال الاخير هو الي تحتاجه Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 ههههه لقد فهمت اني غبي بالفعل Link to comment
Tete omar Posted October 31, 2012 Share Posted October 31, 2012 ههههه لقد فهمت اني غبي بالفعل بس كلمة غبي ماهي لايقة عليك ... انت اذكى شخص عرفته بالعالم Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 function balanceTeams ( thePlayer ) local groveTeam = getTeamFromName ( "n" ) local ballasTeam = getTeamFromName ( "a" ) local groveCount = countPlayersInTeam ( 15 ) local ballasCount = countPlayersInTeam ( 15 ) if groveCount == ballasCount then setPlayerTeam ( thePlayer , n ) elseif groveCount > ballasCount then setPlayerTeam ( thePlayer , a ) elseif groveCount < ballasCount then setPlayerTeam ( thePlayer , a ) end end انه صح Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 ههههه لقد فهمت اني غبي بالفعل بس كلمة غبي ماهي لايقة عليك ... انت اذكى شخص عرفته بالعالم ياخي مافهم ض1 افهم بس ماقرى تصدق لما تقلي اول مشوف رابط ويكي افتحه ولا اقرى كلامك هههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 صح ؟ ام خطأ Link to comment
abu5lf Posted October 31, 2012 Share Posted October 31, 2012 function balanceTeams ( thePlayer ) local groveTeam = getTeamFromName ( "n" ) local ballasTeam = getTeamFromName ( "a" ) local groveCount = countPlayersInTeam ( 15 ) local ballasCount = countPlayersInTeam ( 15 ) if groveCount == ballasCount then setPlayerTeam ( thePlayer , n ) elseif groveCount > ballasCount then setPlayerTeam ( thePlayer , a ) elseif groveCount < ballasCount then setPlayerTeam ( thePlayer , a ) end end انه صح لا مهب صح Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 وش الصح ؟؟ قريب منه انا ولا بعيد Link to comment
abu5lf Posted October 31, 2012 Share Posted October 31, 2012 انا مابسوي الكود بس ابعلمك وش تعدل انسخ المثال كامل الي عطيتك شل thePlayer الي في الفنشكن بدل thePlayer الي داخل الكود إلى source حط أيفينت عند دخول الاعب Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 function balanceTeams ( source ) --get the team pointers from their names local groveTeam = getTeamFromName ( "grove" ) local ballasTeam = getTeamFromName ( "ballas" ) --count the number of players in each team, and store them local groveCount = countPlayersInTeam ( groveTeam ) local ballasCount = countPlayersInTeam ( ballasTeam ) if groveCount == ballasCount then --if the teams are equal setPlayerTeam ( thePlayer , groveTeam ) --place the player in grove elseif groveCount > ballasCount then --if there are more in grove setPlayerTeam ( thePlayer , ballasTeam ) --place him in ballas elseif groveCount < ballasCount then --if there are more in ballas setPlayerTeam ( thePlayer , groveTeam ) --place him in grove. end end هذا الويكي مع التعديل Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 ؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟ Link to comment
./BlackBird# Posted October 31, 2012 Share Posted October 31, 2012 (edited) اتوقع انه قالك حط لما يدخل الاعب و غير thePlayer الى source function balanceTeams () local groveTeam = getTeamFromName ( "grove" ) local ballasTeam = getTeamFromName ( "ballas" ) local groveCount = countPlayersInTeam ( groveTeam ) local ballasCount = countPlayersInTeam ( ballasTeam ) if groveCount == ballasCount then setPlayerTeam ( source, groveTeam ) elseif groveCount > ballasCount then setPlayerTeam ( source, ballasTeam ) elseif groveCount < ballasCount then setPlayerTeam ( source, groveTeam ) end end addEventHandler("onPlayerJoin", root,balanceTeams ) Edited October 31, 2012 by Guest Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 function balanceTeams ( source ) --get the team pointers from their names local groveTeam = getTeamFromName ( "grove" ) local ballasTeam = getTeamFromName ( "ballas" ) --count the number of players in each team, and store them local groveCount = countPlayersInTeam ( groveTeam ) local ballasCount = countPlayersInTeam ( ballasTeam ) if groveCount == ballasCount then --if the teams are equal setPlayerTeam ( source , groveTeam ) --place the player in grove elseif groveCount > ballasCount then --if there are more in grove setPlayerTeam ( source , ballasTeam ) --place him in ballas elseif groveCount < ballasCount then --if there are more in ballas setPlayerTeam ( source , groveTeam ) --place him in grove. end end صح Link to comment
ABO-SR777777A Posted October 31, 2012 Author Share Posted October 31, 2012 اها يعني الكود الحين جاهز ولا وش Link to comment
MR.S3D Posted October 31, 2012 Share Posted October 31, 2012 addEventHandler ( "onPlayerJoin", getRootElement(), function() local groveTeam = getTeamFromName ( "grove" ) local ballasTeam = getTeamFromName ( "ballas" ) local groveCount = countPlayersInTeam ( groveTeam ) local ballasCount = countPlayersInTeam ( ballasTeam ) if groveCount == ballasCount then setPlayerTeam ( source , groveTeam ) elseif groveCount > ballasCount then setPlayerTeam ( source , ballasTeam ) elseif groveCount < ballasCount then setPlayerTeam ( source , groveTeam ) end end) Link to comment
ABO-SR777777A Posted November 1, 2012 Author Share Posted November 1, 2012 ثانكس سعد باجربه 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