M[ROYAL]R Posted August 3, 2015 Share Posted August 3, 2015 ألسلام عليكم شباب انا سويت قريد ليست و ابى اضيف فيها اسماء اللاعبين الى ب تيم انا احدده ممكن تشوفو شو الخطآ الى فى الكود local theTeam = getTeamFromName ( Blue ) if ( theTeam ) then local players = getPlayersInTeam ( players ) for playerKey, playerValue in ipairs ( players ) do local aRow = guiGridListAddRow ( Gblue ) guiGridListSetItemText ( Gblue, aRow, 1, ''..i..'', true, false ) guiGridListSetItemText ( Gblue, aRow, 2, getPlayerName(playerValue), true, false ) end end Link to comment
#Wizard Posted August 3, 2015 Share Posted August 3, 2015 local theTeam = getTeamFromName ( Blue ) اين السترينق Link to comment
i S6O Posted August 3, 2015 Share Posted August 3, 2015 # Not Tested : for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam( getTeamName ( v ) == 'TeamName' ) ) then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, v, false, false ) end end Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 # Not Tested : for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam( getTeamName ( v ) == 'TeamName' ) ) then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, v, false, false ) end end لا يعمل Link to comment
#Madara Posted August 3, 2015 Share Posted August 3, 2015 خليت سترنق لأسم التيم وماضبط ؟ local theTeam = getTeamFromName ( Blue ) إلى local theTeam = getTeamFromName ( "Blue" ) أو جرب كود عقيد مع تعديلي for k, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam( getTeamName ( v ) == 'Blue' ) ) then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) end end Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 خليت سترنق لأسم التيم وماضبط ؟ local theTeam = getTeamFromName ( Blue ) إلى local theTeam = getTeamFromName ( "Blue" ) أو جرب كود عقيد مع تعديلي for k, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getPlayerTeam( getTeamName ( v ) == 'Blue' ) ) then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) end end الأثنين ما ظبطو Link to comment
H25 Posted August 3, 2015 Share Posted August 3, 2015 for k, v in ipairs ( getElementsByType ( 'player' ) ) do if getTeamName(getPlayerTeam(v)) == "teamName" then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) end end ^ تصحيح كود عقيد طبعاً تحط مكان teamName في التحقق اسم التيم الي تبيه Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 for k, v in ipairs ( getElementsByType ( 'player' ) ) do if getTeamName(getPlayerTeam(v)) == "teamName" then local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, ''..i..'', false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerName(v), false, false ) end end ^ تصحيح كود عقيد طبعاً تحط مكان teamName في التحقق اسم التيم الي تبيه لم يعمل Link to comment
H25 Posted August 3, 2015 Share Posted August 3, 2015 local theTeam = getTeamFromName("Blue") if (theTeam) then local players = getPlayersInTeam(theTeam) guiGridListClear(Gblue) for playerKey, playerValue in ipairs(players) do local aRow = guiGridListAddRow(Gblue) guiGridListSetItemText(Gblue, aRow, 1, ''..i..'', true, false) guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) end end Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 local theTeam = getTeamFromName("Blue") if (theTeam) then local players = getPlayersInTeam(theTeam) guiGridListClear(Gblue) for playerKey, playerValue in ipairs(players) do local aRow = guiGridListAddRow(Gblue) guiGridListSetItemText(Gblue, aRow, 1, ''..i..'', true, false) guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) end end لا يعمل فى كود شبه ذا سويته من الويكي ما يعمل بردو Link to comment
H25 Posted August 3, 2015 Share Posted August 3, 2015 تأكد من اسم التيم ومن اسم القريد لست وتأكد اذا في لاعب في التيم أو لا Link to comment
i S6O Posted August 3, 2015 Share Posted August 3, 2015 #جرب function ShowGridList ( ) local theTeam = getTeamFromName("Blue") if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) guiGridListClear ( Gblue ) for playerKey, playerValue in ipairs(players) do local aRow = guiGridListAddRow(Gblue) guiGridListSetItemText(Gblue, aRow, 1, ''..playerKey..'', true, false) guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) end end end setTimer ( ShowGridList, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 #جرب function ShowGridList ( ) local theTeam = getTeamFromName("Blue") if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) guiGridListClear ( Gblue ) for playerKey, playerValue in ipairs(players) do local aRow = guiGridListAddRow(Gblue) guiGridListSetItemText(Gblue, aRow, 1, ''..playerKey..'', true, false) guiGridListSetItemText(Gblue, aRow, 2, getPlayerName(playerValue), true, false) end end end setTimer ( ShowGridList, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) للأسف Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 debugscript ? وضح ؟ Link to comment
Simple. Posted August 3, 2015 Share Posted August 3, 2015 function ShowGridList ( ) local theTeam = getTeamFromName("Blue") guiGridListClear ( Gblue ) for k, v in ipairs( getElementsByType ("player") ) do if getPlayerTeam ( v ) == theTeam then guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) end end end setTimer ( ShowGridList, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) Link to comment
#Madara Posted August 3, 2015 Share Posted August 3, 2015 debugscript ? وضح ؟ أكتب في أف 8 debugscript 3 وقول لنا وش يطلع لك Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 debugscript ? وضح ؟ أكتب في أف 8 debugscript 3 وقول لنا وش يطلع لك Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 function ShowGridList ( ) local theTeam = getTeamFromName("Blue") guiGridListClear ( Gblue ) for k, v in ipairs( getElementsByType ("player") ) do if getPlayerTeam ( v ) == theTeam then guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) end end end setTimer ( ShowGridList, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) Link to comment
</Mr.Tn6eL> Posted August 3, 2015 Share Posted August 3, 2015 getPlayersInTeam + تقدر تستفيد من مثال الويكي function showTeamFunction ( command, teamName ) -- Find and show all the players in the team that was specified with the console command local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) -- Loop through the player table for playerKey, playerValue in ipairs ( players ) do outputChatBox ( getPlayerName(playerValue) ) end end end addCommandHandler ( "showTeam", showTeamFunction ) Link to comment
M[ROYAL]R Posted August 3, 2015 Author Share Posted August 3, 2015 getPlayersInTeam+ تقدر تستفيد من مثال الويكي function showTeamFunction ( command, teamName ) -- Find and show all the players in the team that was specified with the console command local theTeam = getTeamFromName ( teamName ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) -- Loop through the player table for playerKey, playerValue in ipairs ( players ) do outputChatBox ( getPlayerName(playerValue) ) end end end addCommandHandler ( "showTeam", showTeamFunction ) يا تنطيل ولله انا قبل ما اطرح الموضوع هون روحت على الويكي و جربت الكود 1000 مره Link to comment
M[ROYAL]R Posted August 4, 2015 Author Share Posted August 4, 2015 (edited) Gblue = guiCreateGridList(428, 226, 245, 167, false) guiGridListAddColumn(Gblue, "#", 0.2) guiGridListAddColumn(Gblue, "player", 0.7) guiSetAlpha(Gblue, 0.80) guiSetVisible ( Gblue , false ) Gred = guiCreateGridList(167, 228, 245, 167, false) guiSetVisible ( Gred, false ) guiSetAlpha(Gred, 0.80) guiGridListAddColumn(Gred, "#", 0.2) guiGridListAddColumn(Gred, "Player", 0.7) function ShowGridList2 ( ) local theTeam = getTeamFromName("Red") guiGridListClear ( Gred ) for k, v in ipairs( getElementsByType ("player") ) do if getPlayerTeam ( v ) == theTeam then guiGridListSetItemText(Gred, guiGridListAddRow(Gred), 1, k, true, false) guiGridListSetItemText(Gred, guiGridListAddRow(Gred), 2, getPlayerName(v), true, false) end end end setTimer ( ShowGridList2, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList2 ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList2 ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList2 ) function ShowGridList ( ) local theTeam = getTeamFromName("Blue") guiGridListClear ( Gblue ) for k, v in ipairs( getElementsByType ("player") ) do if getPlayerTeam ( v ) == theTeam then guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 1, k, true, false) guiGridListSetItemText(Gblue, guiGridListAddRow(Gblue), 2, getPlayerName(v), true, false) end end end setTimer ( ShowGridList, 100, 1 ) addEventHandler ( 'onClientPlayerQuit', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerJoin', resourceRoot, ShowGridList ) addEventHandler ( 'onClientPlayerChangeNick', resourceRoot, ShowGridList ) server TRed = createTeam ("Red",255,0,0) Tblue = createTeam ("Blue",0,0,255) Edited August 4, 2015 by Guest 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