Adham Posted January 21, 2017 Share Posted January 21, 2017 سلام عليكم ابي يظهر في قريد لست كل اسما التيمات المصنوعه في السرفر عملت لا يعمل function Players ( ) guiGridListClear ( GUIEditor.gridlist[1] ) for id, players in ipairs(getElementsByType("team")) do local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerTeam ( players ), false, false ) end end addEventHandler ( 'onClientResourceStart' , resourceRoot , Players ) addEventHandler( "onClientPlayerJoin", root, Players ) addEventHandler( "onClientPlayerQuit", root, Players ) addEventHandler( "onClientPlayerChangeNick", root, Players ) Link to comment
MR.Mosa Posted January 21, 2017 Share Posted January 21, 2017 13 minutes ago, Deativated said: function Players ( ) guiGridListClear ( GUIEditor.gridlist[1] ) for i,v in ipairs ( getPlayerTeam ( ) ) do local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerTeam ( v ), false, false ) end end addEventHandler ( 'onClientResourceStart' , resourceRoot , Players ) addEventHandler( "onClientPlayerJoin", root, Players ) addEventHandler( "onClientPlayerQuit", root, Players ) addEventHandler( "onClientPlayerChangeNick", root, Players ) جرب كذا Link to comment
' A F . Posted January 21, 2017 Share Posted January 21, 2017 function Players ( ) guiGridListClear ( GUIEditor.gridlist[1] ) for i, v in ipairs(getElementsByType("team")) do local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getTeamName ( v ), false, false ) end end addEventHandler ( 'onClientResourceStart' , resourceRoot , Players ) addEventHandler( "onClientPlayerJoin", root, Players ) addEventHandler( "onClientPlayerQuit", root, Players ) addEventHandler( "onClientPlayerChangeNick", root, Players ) 1 Link to comment
Adham Posted January 21, 2017 Author Share Posted January 21, 2017 ابغأ اسوي اذا حدد تيم من القريد ليست ودوس زرار يحذف التيم المحدد . جربت اعمل كدا م ظبت كلنت وسرفر addEvent( " Server;CreateTeam", true ) addEventHandler ( " Server;CreateTeam", root, function ( bool, team, name ) if bool == "Delete" then local team = getTeamFromName ( name ) if ( getTeamFromName ( name ) ) then destroyElement ( team ) end end end ) -- كلنت addEventHandler ( 'onClientGUIClick' ,root, function ( ) if source == deletem then local team = guiGridListGetItemText ( gridlist2, guiGridListGetSelectedItem ( gridlist2 ), 1 ) if team == "" then return end triggerServerEvent( "Server;CreateTeam",localPlayer,"Delete",team ) end end end ) Link to comment
Master_MTA Posted January 21, 2017 Share Posted January 21, 2017 1 hour ago, Deativated said: ابغأ اسوي اذا حدد تيم من القريد ليست ودوس زرار يحذف التيم المحدد . جربت اعمل كدا م ظبت كلنت وسرفر addEvent( " Server;CreateTeam", true ) addEventHandler ( " Server;CreateTeam", root, function ( bool, team, name ) if bool == "Delete" then local team = getTeamFromName ( name ) if ( getTeamFromName ( name ) ) then destroyElement ( team ) end end end ) -- كلنت addEventHandler ( 'onClientGUIClick' ,root, function ( ) if source == deletem then local team = guiGridListGetItemText ( gridlist2, guiGridListGetSelectedItem ( gridlist2 ), 1 ) if team == "" then return end triggerServerEvent( "Server;CreateTeam",localPlayer,"Delete",team ) end end end ) صراحه اشوفك تعبت وحاولت وبكذا بعطيك كود جاهز addEvent( " Server;CreateTeam", true ) addEventHandler ( " Server;CreateTeam", root, function ( text, team ) if text == "Delete" then local team = getTeamFromName ( name ) if ( getTeamFromName ( name ) ) then destroyElement ( team ) end end end ) -- كلنت addEventHandler ( 'onClientGUIClick' ,root, function ( ) if source == deletem then local team = guiGridListGetItemText ( gridlist2, guiGridListGetSelectedItem ( gridlist2 ), 1 ) if guiGridListGetSelectedItem ( gridlist2 ) ~= "" then triggerServerEvent( "Server;CreateTeam",localPlayer,"Delete",team ) end end end ) Link to comment
Adham Posted January 21, 2017 Author Share Posted January 21, 2017 hhhhhhhhhhhhh ^ م ظبت شي . نفس الكود البعتهولك عطتهولي Link to comment
Bssol Posted January 21, 2017 Share Posted January 21, 2017 (edited) Client function onClickToRemoveTeam ( ) if ( source == deletem ) then local row = guiGridListGetSelectedItem ( gridlist2 ) if ( row ~= -1 ) then local teamName = guiGridListGetItemText ( gridlist2, row, 1 ) triggerServerEvent( "Server;CreateTeam", localPlayer, "Delete", teamName ) end end end addEventHandler ( 'onClientGUIClick' ,root, onClickToRemoveTeam ) Server function deleteTeamFun( text, teamName ) if ( text == "Delete" ) then local team = getTeamFromName ( teamName ) if ( team ) then destroyElement ( team ) end end end addEvent( "Server;CreateTeam", true ) addEventHandler ( "Server;CreateTeam", root, deleteTeamFun ) Edited January 21, 2017 by Bssol Link to comment
Master_MTA Posted January 21, 2017 Share Posted January 21, 2017 53 minutes ago, Deativated said: hhhhhhhhhhhhh ^ م ظبت شي . نفس الكود البعتهولك عطتهولي لو تلاحظ زين وتفكر بتفهم قصدي يقلبي شف وش غيرت وتكلم وش ذا التخبيص function ( bool, team, name ) Link to comment
Bssol Posted January 21, 2017 Share Posted January 21, 2017 (edited) 7 minutes ago, Master_MTA said: لو تلاحظ زين وتفكر بتفهم قصدي يقلبي شف وش غيرت وتكلم الكود الي حطيته انت غلط القيمة name مو معرفة في كود السيرفر + guiGridListGetSelectedItem ( gridlist2 ) ~= "" هذي بعد غلط، لان الفنشكشن هذا دايم يرجع قيمة رقم، وانت جالس تقارنه بنص فاضي، معناها المقارنة دائما صحيحة وراح يسوي تريقر ويروح للسيرفر Edited January 21, 2017 by Bssol Link to comment
Master_MTA Posted January 21, 2017 Share Posted January 21, 2017 (edited) 6 minutes ago, Bssol said: الكود الي حطيته انت غلط القيمة name مو معرفة في كود السيرفر + guiGridListGetSelectedItem ( gridlist2 ) ~= "" هذي بعد غلط، لان الفنشكشن هذا دايم يرجع قيمة رقم، وانت جالس تقارنه بنص فاضي، معناها المقارنة دائما صحيحة وراح يسوي تريقر ويروح للسيرفر -1 الثانيه ما انتبهت لها اما النيم معرفه يقلبي ركز شويي وتشوف او الا الا صحيح ما انتبهت لاني جالس اعدل من جوال ×_× Edited January 21, 2017 by Master_MTA Link to comment
N3xT Posted January 21, 2017 Share Posted January 21, 2017 (edited) local team = getTeamFromName ( name ) وشلون النيم معرفه ^ ؟ ، ركز الله لا يهينك Edited January 21, 2017 by N3xT Link to comment
Bssol Posted January 21, 2017 Share Posted January 21, 2017 3 hours ago, Master_MTA said: صراحه اشوفك تعبت وحاولت وبكذا بعطيك كود جاهز addEvent( " Server;CreateTeam", true ) addEventHandler ( " Server;CreateTeam", root, function ( text, team ) if text == "Delete" then local team = getTeamFromName ( name ) if ( getTeamFromName ( name ) ) then destroyElement ( team ) end end end ) -- كلنت addEventHandler ( 'onClientGUIClick' ,root, function ( ) if source == deletem then local team = guiGridListGetItemText ( gridlist2, guiGridListGetSelectedItem ( gridlist2 ), 1 ) if guiGridListGetSelectedItem ( gridlist2 ) ~= "" then triggerServerEvent( "Server;CreateTeam",localPlayer,"Delete",team ) end end end ) هذا الكود الي تقول انك عدلته، ما اشوف تعريف حق الـ name 1 Link to comment
Master_MTA Posted January 21, 2017 Share Posted January 21, 2017 1 minute ago, N3xT said: local team = getTeamFromName ( name ) if ( getTeamFromName ( name ) ) then destroyElement ( team ) end وشلون النيم معرفه ^ ؟ ، ركز الله لا يهينك توني انتبه اعذرني معدل من جوال Just now, Bssol said: هذا الكود الي تقول انك عدلته، ما اشوف تعريف حق الـ name اعتذر توني انتبه Link to comment
' A F . Posted January 22, 2017 Share Posted January 22, 2017 --- # Client Side addEventHandler ( 'onClientGUIClick' , root , function ( ) if ( source == buttonname ) then local select_ = guiGridListGetSelectedItem ( listname ) if ( select_ ~= -1 ) then triggerServerEvent ('Server;CreateTeam' , localPlayer , "Remove" , guiGridListGetItemText ( listname , select_ , 1 ) ) end end end ); -- # Server Side addEvent ( 'Server;CreateTeam' , true ) addEventHandler ( 'Server;CreateTeam' , root , function ( Selector , Value ) if ( Selector == 'Remove' ) then if ( getTeamFromName ( Value ) ) then destroyElement ( getTeamFromName ( Value ) ) end end end ); لاتنسى بدل listname + buttonname بـ إسم الزر والقريد ليست . 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