Jump to content

تعديل


Adham

Recommended Posts

Posted (edited)

سلام عليكم

ابي اسوي يجي في label

اسم حساب الاعب

لاكنه م ظبت : م في دي بق يجي في label

false or nil

triggerServerEvent("Account",localPlayer) 
addEvent("Account",true) 
addEventHandler("Account",root, 
    function(Account) 
        guiSetText(GUIEditor_Label[16],tostring(Account))   
    end 
) 
-- sv
addEvent("Account",true) 
function Account() 
    local Account = getPlayerAccount ( source )
    triggerClientEvent(source,"Account", source,Account) 
end 
addEventHandler("ip",root,Account) 

 

Edited by Deativated
Posted
  1. triggerServerEvent("Account",localPlayer)  -- جرب
  2. addEvent("Account",true) 
  3. addEventHandler("Account",root, 
  4.     function(AccountName) 
  5.         guiSetText(GUIEditor_Label[16],tostring(AccountName))   
  6.     end 
  7. ) 
  8. -- sv
  9. addEvent("Account",true) 
  10. function Account() 
  11.     local Account = getPlayerAccount ( source )
  12.     local AccountName = GetAccountName ( Account )
  13.     triggerClientEvent(source,"Account", source,AccountName) 
  14. end 
  15. addEventHandler("ip",root,Account) 
Posted
-- # Server
addEventHandler("onResourceStart", resourceRoot,
function()
	for i, player in ipairs(getElementsByType("player")) do
		local account = getPlayerAccount(player)
		setElementData(player, "AccountName", getAccountName(account))
	end
end)

---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

 

Posted (edited)
10 minutes ago, #BrosS said:

-- # Server
addEventHandler("onResourceStart", resourceRoot,
function()
	for i, player in ipairs(getElementsByType("player")) do
		local account = getPlayerAccount(player)
		setElementData(player, "AccountName", getAccountName(account))
	end
end)

---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

 

اظن نسيت حاجة لو لاعب توه دخل السيرفر ماينحط له الألمنت داتا

+ يتاكد ان اللاعب مسجل دخوله

-- # Server
addEventHandler("onResourceStart", resourceRoot,
function()
	for i, player in ipairs(getElementsByType("player")) do
		local account = getPlayerAccount(player)
      	if (not isGuestAccount(account)) then
			setElementData(player, "AccountName", getAccountName(account))
        end
	end
end)

addEventHandler("onPlayerJoin", root, function( )
    local account = getPlayerAccount(source)
    if (not isGuestAccount(account)) then
 	    local accountName = getAccountName(account)
 	    setElementData(source, "AccountName", accountName)
    end
    
end)


---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

مدري ايش وضع المحرر ما يرتب الاكواد

Edited by iRamX
Posted
7 minutes ago, iRamX said:

اظن نسيت حاجة لو لاعب توه دخل السيرفر ماينحط له الألمنت داتا

+ يتاكد ان اللاعب مسجل دخوله


-- # Server
addEventHandler("onResourceStart", resourceRoot,
function()
	for i, player in ipairs(getElementsByType("player")) do
		local account = getPlayerAccount(player)
      	if (not isGuestAccount(account)) then
			setElementData(player, "AccountName", getAccountName(account))
        end
	end
end)

addEventHandler("onPlayerJoin", root, function( )
    local account = getPlayerAccount(source)
    if (not isGuestAccount(account)) then
 	    local accountName = getAccountName(account)
 	    setElementData(source, "AccountName", accountName)
    end
    
end)


---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

مدري ايش وضع المحرر ما يرتب الاكواد

أظن 

onResourceStart

تشبه

onPlayerJoin

- و فيه ، اذا مو مسجل يحط 

راجع الكود.ذذ

Posted
3 minutes ago, #BrosS said:

أظن 

onResourceStart

تشبه

onPlayerJoin

- و فيه ، اذا مو مسجل يحط 

راجع الكود.ذذ

يوه، بالنسبة الي مو مسجل كان غلط مني

بس شوف الكونسل

شغلت المود وطلع الرسالة سويت ريكونكت ولا طلع شي

restart: Resource restarting...
Hello World
connect: Connecting to 192.168.56.1:22003...
* Connected! [MTA:SA Server 1.5.3 [Windows]]
Server FPS limit: 36
Welcome to Freeroam
Press F1 to show/hide controls
Server AC info: [Allowed client files: None] [Disabled AC: None] [Enabled SD: None]

لاحظ شغلت المود وسويت ريكونكت ولا جا شي *رسالة هيلو ورد*

والكود حقي

function helloWorld (  )
	outputChatBox ( "Hello World" )
end
addEventHandler ( "onResourceStart", resourceRoot, helloWorld )

 

Posted
2 minutes ago, iRamX said:

يوه، بالنسبة الي مو مسجل كان غلط مني

بس شوف الكونسل

شغلت المود وطلع الرسالة سويت ريكونكت ولا طلع شي


restart: Resource restarting...
Hello World
connect: Connecting to 192.168.56.1:22003...
* Connected! [MTA:SA Server 1.5.3 [Windows]]
Server FPS limit: 36
Welcome to Freeroam
Press F1 to show/hide controls
Server AC info: [Allowed client files: None] [Disabled AC: None] [Enabled SD: None]

لاحظ شغلت المود وسويت ريكونكت ولا جا شي *رسالة هيلو ورد*

والكود حقي


function helloWorld (  )
	outputChatBox ( "Hello World" )
end
addEventHandler ( "onResourceStart", resourceRoot, helloWorld )

 

ض كفو

ظننته مثل الكلنت ?

  • Like 1
Posted
Just now, #BrosS said:

ض كفو

ظننته مثل الكلنت ?

اخيرا اتفقنا انا وياك غلط مني ومنك xD

الكود النهائي بيكون:
 

-- # Server
addEventHandler("onResourceStart", resourceRoot,
function()
	for i, player in ipairs(getElementsByType("player")) do
		local account = getPlayerAccount(player)
		setElementData(player, "AccountName", getAccountName(account))
	end
end)

addEventHandler("onPlayerJoin", root, function( )
    local account = getPlayerAccount(source)
	local accountName = getAccountName(account)
	setElementData(source, "AccountName", accountName)
    
end)


---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

 

  • Like 1
Posted

@iRamX تراح مايحتاج المنت داتا ابد, وطريقتك غلط بأيفنت الدخول لان اول مايدخل الاعب راح يكون حسابه جوست

والمفروض تتحقق ان الاعب مسجل دخول ان حسابه ماهب جوست

والطريقة الثانية والي هي افضل

يقدر يسويها بالترايقرات لان اسم حساب الاعب مايتغير

اول مايدخل الاعب ترايقر للكلينت وحط حسابه وخلاص

واول مايشتغل المود ترايقر للسيرفر ويجيب اسمه ويرسله للكلينت 

^_^ وانتهينا

  • Like 3
Posted (edited)
16 hours ago, Abdul KariM said:

@iRamX تراح مايحتاج المنت داتا ابد, وطريقتك غلط بأيفنت الدخول لان اول مايدخل الاعب راح يكون حسابه جوست

والمفروض تتحقق ان الاعب مسجل دخول ان حسابه ماهب جوست

والطريقة الثانية والي هي افضل

يقدر يسويها بالترايقرات لان اسم حساب الاعب مايتغير

اول مايدخل الاعب ترايقر للكلينت وحط حسابه وخلاص

واول مايشتغل المود ترايقر للسيرفر ويجيب اسمه ويرسله للكلينت 

^_^ وانتهينا

طيب ايش معصب هد اعصابك, يمدينا نستعمل هالطريقة :)

 

addEventHandler("onPlayerLogin", root, function( )
local account = getPlayerAccount(source)
local accountName = getAccountName(account)
setElementData(source, "AccountName", accountName)
end)


---- Client #
guiSetText( GUIEditor_Label[16],"Account Name : "..(getElementData(localPlayer, "AccountName") or "-") )

 

Edited by iRamX
Posted

بكل بساطه

يحط ذا التراقر بزر بكود فتح اللوحه

triggerServerEvent('getaccname'.localPlayer)
addEvent('settxt',true)
addEventHandler('settxt',root,function(accname)
  guiSetText(sssss,accname)----------------sssss بدلها باسم الليبل
  end
  )
--------------------server
addEvent('getaccname',true)
addEventHandler('getaccname',root,function()
    if not isGuestAccount(getPlayerAccount(source)) then
    triggerClientEvent(source,'settxt',source,getAccountName(getPlayerAccount(source)))  
      else
          triggerClientEvent(source,'settxt',source,'you are not logged in')  

    end
    end
  )

 

#Edit:

اخوي يرجى الرد بتمت الافاده ان استفدت وان لم تستفد تقدر تطرح المشكله ونساعدك

  • Like 1

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