Jump to content

تعديل


Adham

Recommended Posts

سلام عليكم ابي يظهر في قريد لست

كل اسما التيمات المصنوعه في السرفر

عملت لا يعمل

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
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

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 )

 

  • Like 1
Link to comment

ابغأ اسوي اذا حدد تيم من القريد ليست ودوس زرار يحذف التيم المحدد .

جربت اعمل كدا م ظبت كلنت وسرفر

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
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

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 by Bssol
Link to comment
7 minutes ago, Master_MTA said:

لو تلاحظ زين وتفكر بتفهم قصدي يقلبي شف وش غيرت وتكلم

الكود الي حطيته انت غلط

القيمة

name 

مو معرفة في كود السيرفر

 

+

 guiGridListGetSelectedItem ( gridlist2 ) ~= ""

هذي بعد غلط، لان الفنشكشن هذا دايم يرجع قيمة رقم، وانت جالس تقارنه بنص فاضي، معناها المقارنة دائما صحيحة وراح يسوي تريقر ويروح للسيرفر

 

Edited by Bssol
Link to comment
6 minutes ago, Bssol said:

الكود الي حطيته انت غلط

القيمة


name 

مو معرفة في كود السيرفر

 

+


 guiGridListGetSelectedItem ( gridlist2 ) ~= ""

هذي بعد غلط، لان الفنشكشن هذا دايم يرجع قيمة رقم، وانت جالس تقارنه بنص فاضي، معناها المقارنة دائما صحيحة وراح يسوي تريقر ويروح للسيرفر

 

-1

الثانيه ما انتبهت لها اما النيم معرفه يقلبي ركز شويي وتشوف

او الا الا صحيح ما انتبهت لاني جالس اعدل من جوال ×_×

Edited by Master_MTA
Link to comment
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

  • Like 1
Link to comment
1 minute ago, N3xT said:
  1. local team = getTeamFromName ( name )
  2. if ( getTeamFromName ( name ) ) then
  3. destroyElement ( team )
  4. end

 

وشلون النيم معرفه ^ ؟ ، ركز الله لا يهينك

توني انتبه اعذرني معدل من جوال

Just now, Bssol said:

هذا الكود الي تقول انك عدلته، ما اشوف تعريف حق الـ

name

اعتذر توني انتبه

Link to comment
--- # 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...