DmAr511

طلب كود

Recommended Posts

ألسلام عليكم 

 

أبي الكومبو بوكس يبين اسماء الاعبين بسيرفر 

وهأذا طلبي

Share this post


Link to post
39 minutes ago, DmAr511 said:

ألسلام عليكم 

 

أبي الكومبو بوكس يبين اسماء الاعبين بسيرفر 

وهأذا طلبي

يعني إذا ضغط عالكومبو بوكس يبين اسماء اللاعبين ؟

Share this post


Link to post

تفضل هاد 

	local PlayerComboBox = guiCreateComboBox ( 100, 100, 200,400, "Player Names", false ) 
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox, getPlayerName ( p ) ) 
	end
	

 

Share this post


Link to post

كود خطأ 

11 minutes ago, Amr_Mohamed said:

تفضل هاد 


	local PlayerComboBox = guiCreateComboBox ( 100, 100, 200,400, "Player Names", false ) 
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox, getPlayerName ( p ) ) 
	end
	

 

 

Share this post


Link to post
Just now, Amr_Mohamed said:

ويش المشكله انا مجربو بنفسي ؟

:|

بس اسمي مو مبين :|

Share this post


Link to post

جرب

local PlayerComboBox = guiCreateComboBox ( 100, 100, 200,400, "Player Names", false ) 
function ref ()
	guiComboBoxClear ( PlayerComboBox )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox, getPlayerName ( p ) ) 
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)

 

ويش الخبار

الكود يعمل و لا 

Share this post


Link to post
22 hours ago, Amr_Mohamed said:

جرب


local PlayerComboBox = guiCreateComboBox ( 100, 100, 200,400, "Player Names", false ) 
function ref ()
	guiComboBoxClear ( PlayerComboBox )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox, getPlayerName ( p ) ) 
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)

 

ويش الخبار

الكود يعمل و لا 

تعديل بسيط
 

function ref ()
	guiComboBoxClear ( PlayerComboBox  )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox , getPlayerName ( p ) ) 
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler("onClientResourceStart", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)
addEventHandler("onClientPlayerChangeNick", getRootElement(), ref)

 

Edited by #Himoo

Share this post


Link to post
4 hours ago, #Himoo said:

تعديل بسيط
 


function ref ()
	guiComboBoxClear ( PlayerComboBox  )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		guiComboBoxAddItem ( PlayerComboBox , getPlayerName ( p ) ) 
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler("onClientResourceStart", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)
addEventHandler("onClientPlayerChangeNick", getRootElement(), ref)

 

function ref ()
	guiComboBoxClear ( PlayerComboBox  )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		local Add = guiComboBoxAddItem ( PlayerComboBox ) 
    	guiComboBoxSetItemText ( PlayerComboBox, Add, getPlayerName ( p ) ) -- اعتقد لازم هاذي
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler("onClientResourceStart", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)
addEventHandler("onClientPlayerChangeNick", getRootElement(), ref)

اعتقد صح | غير مجرب

Share this post


Link to post
On 9/6/2017 at 16:06, Source|> said:

function ref ()
	guiComboBoxClear ( PlayerComboBox  )   
	for i, p in ipairs ( getElementsByType ( "player" ) ) do 
		local Add = guiComboBoxAddItem ( PlayerComboBox ) 
    	guiComboBoxSetItemText ( PlayerComboBox, Add, getPlayerName ( p ) ) -- اعتقد لازم هاذي
	end
end
ref ()
addEventHandler("onClientPlayerJoin", getRootElement(), ref)
addEventHandler("onClientResourceStart", getRootElement(), ref)
addEventHandler( "onClientPlayerQuit", getRootElement(), ref)
addEventHandler("onClientPlayerChangeNick", getRootElement(), ref)

اعتقد صح | غير مجرب

الي فوق شغال :)
هذا تخبيص

Share this post


Link to post

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.