Jump to content

simple question


Recommended Posts

Posted

السلأم عليكم ورحمه الله وبركاته

كيفكم شباب جميعأ , أنشاء الله تكونو بخير 

اليوم كنت ابي اسوي بالقريد لست

لو الاعب متصل بالسرفر يجي في القريد متصل

لو مب متصل يجي غير متصل

والسلأم عليكم

ملحوظة: لأ احد يقول ابي جهاز وإلخ

ابي الطريقة او الفشكنات ونا بسويها .

Posted

عليكم السلام ورحمة الله تعالى  وبركاته ،

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

Posted
On ١٣‏/٥‏/٢٠١٧ at 10:26, Deativated said:

السلأم عليكم ورحمه الله وبركاته

كيفكم شباب جميعأ , أنشاء الله تكونو بخير 

اليوم كنت ابي اسوي بالقريد لست

لو الاعب متصل بالسرفر يجي في القريد متصل

لو مب متصل يجي غير متصل

والسلأم عليكم

ملحوظة: لأ احد يقول ابي جهاز وإلخ

ابي الطريقة او الفشكنات ونا بسويها .

انت بدخل الاسماء للجريد لست عبر وشو 

sql

??

لو كذا كل اللي عليك انك بالكلنت

تتحقق

if getPlayerFromName(sql[k].name) then

 

Posted
4 minutes ago, Master_MTA said:

انت بدخل الاسماء للجريد لست عبر وشو 

sql

??

لو كذا كل اللي عليك انك بالكلنت

تتحقق

if getPlayerFromName(sql[k].name) then

 

في طريقة ثانية مثلا غير السكل

:santa:

Posted
19 minutes ago, #BrosS said:

في طريقة ثانية مثلا غير السكل

:santa:

يب فيه :)

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

واذا خرج تعطيه اكوانت داتا اوف لاين 

وطبعاً تحط اكوانت داتا عشان النك نيم :"

وتجلبهم من 

getAccounts;

  • Like 1
Posted

احطه هكذا يعني مثلأ ؟ الداتا بالشكل كذا

setAccountData ( acc, "StatusPlayer", "Online" )

 

Posted

 

بنسبة ل

اكونت داتا الخاص باونلاين و اوف لاين

 

addEventHandler( 'onPlayerLogin', getRootElement( ),
	function( _, theCurrentAccount )
		if getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			updateUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 1 ' )
		elseif not getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			setUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 2 ' )
		elseif getUserName( getAccountName( theCurrentAccount ) ) and not isHGAP( getAccountName( theCurrentAccount ) ) then
			destoryUserName( getAccountName( theCurrentAccount ) )
			--out( ' 3 ' )
		end
	end
)

addEventHandler( 'onPlayerQuit', getRootElement( ),
	function( )
		local pAccount = getPlayerAccount( source )
		if getUserName( getAccountName( pAccount ) ) and isHGAP( getAccountName( pAccount ) ) then
			updateUserName( getAccountName( pAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( pAccount ) ) and not isHGAP( getAccountName( pAccount ) ) then
			destoryUserName( getAccountName( pAccount ) )
			--out( ' 2 ' )
		end
	end
)

addEventHandler( 'onPlayerLogout', getRootElement( ),
	function( thePreviousAccount )
		if getUserName( getAccountName( thePreviousAccount ) ) and isHGAP( getAccountName( thePreviousAccount ) ) then
			updateUserName( getAccountName( thePreviousAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( thePreviousAccount ) ) and not isHGAP( getAccountName( thePreviousAccount ) ) then
			destoryUserName( getAccountName( thePreviousAccount ) )
			--out( ' 2 ' )
		end
	end
)

 

Posted
1 minute ago, Dr.Marco said:

 

بنسبة ل

اكونت داتا الخاص باونلاين و اوف لاين

 


addEventHandler( 'onPlayerLogin', getRootElement( ),
	function( _, theCurrentAccount )
		if getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			updateUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 1 ' )
		elseif not getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			setUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 2 ' )
		elseif getUserName( getAccountName( theCurrentAccount ) ) and not isHGAP( getAccountName( theCurrentAccount ) ) then
			destoryUserName( getAccountName( theCurrentAccount ) )
			--out( ' 3 ' )
		end
	end
)

addEventHandler( 'onPlayerQuit', getRootElement( ),
	function( )
		local pAccount = getPlayerAccount( source )
		if getUserName( getAccountName( pAccount ) ) and isHGAP( getAccountName( pAccount ) ) then
			updateUserName( getAccountName( pAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( pAccount ) ) and not isHGAP( getAccountName( pAccount ) ) then
			destoryUserName( getAccountName( pAccount ) )
			--out( ' 2 ' )
		end
	end
)

addEventHandler( 'onPlayerLogout', getRootElement( ),
	function( thePreviousAccount )
		if getUserName( getAccountName( thePreviousAccount ) ) and isHGAP( getAccountName( thePreviousAccount ) ) then
			updateUserName( getAccountName( thePreviousAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( thePreviousAccount ) ) and not isHGAP( getAccountName( thePreviousAccount ) ) then
			destoryUserName( getAccountName( thePreviousAccount ) )
			--out( ' 2 ' )
		end
	end
)

 

ابداااااااع , علمني الله لا يهينك :(

Posted
2 minutes ago, Dr.Marco said:

 

بنسبة ل

اكونت داتا الخاص باونلاين و اوف لاين

 


addEventHandler( 'onPlayerLogin', getRootElement( ),
	function( _, theCurrentAccount )
		if getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			updateUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 1 ' )
		elseif not getUserName( getAccountName( theCurrentAccount ) ) and isHGAP( getAccountName( theCurrentAccount ) ) then
			setUserName( getAccountName( theCurrentAccount ), 'online' )
			--out( ' 2 ' )
		elseif getUserName( getAccountName( theCurrentAccount ) ) and not isHGAP( getAccountName( theCurrentAccount ) ) then
			destoryUserName( getAccountName( theCurrentAccount ) )
			--out( ' 3 ' )
		end
	end
)

addEventHandler( 'onPlayerQuit', getRootElement( ),
	function( )
		local pAccount = getPlayerAccount( source )
		if getUserName( getAccountName( pAccount ) ) and isHGAP( getAccountName( pAccount ) ) then
			updateUserName( getAccountName( pAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( pAccount ) ) and not isHGAP( getAccountName( pAccount ) ) then
			destoryUserName( getAccountName( pAccount ) )
			--out( ' 2 ' )
		end
	end
)

addEventHandler( 'onPlayerLogout', getRootElement( ),
	function( thePreviousAccount )
		if getUserName( getAccountName( thePreviousAccount ) ) and isHGAP( getAccountName( thePreviousAccount ) ) then
			updateUserName( getAccountName( thePreviousAccount ), getTimeNow( ) )
			--out( ' 1 ' )
		elseif getUserName( getAccountName( thePreviousAccount ) ) and not isHGAP( getAccountName( thePreviousAccount ) ) then
			destoryUserName( getAccountName( thePreviousAccount ) )
			--out( ' 2 ' )
		end
	end
)

 

^ زي كذا تقريباً ,

لكن اغلب الكود فيه وظايف غير معرفة

Posted
1 minute ago, #_iMr.[E]coo said:

ابداااااااع , علمني الله لا يهينك :(

هههههههه الكود هذا حق عناد اعتقد :-D

Posted
Just now, #_iMr.[E]coo said:

@Deativated , لقيت الطريقة 

تستعمل يوزفل فنكشن مودير , 

 

أي شخص يفوت السيرفر ويسجل تعطيه رتبة وتسوي زي فوق ^

مشكور

Posted
2 minutes ago, #_iMr.[E]coo said:

@Deativated , لقيت الطريقة 

تستعمل يوزفل فنكشن مودير , 

 

أي شخص يفوت السيرفر ويسجل تعطيه رتبة وتسوي زي فوق ^

الله يهديك كنت برسله الكود وسبقتني , عوافي .~

بتوفيق لصاحب الموضوع

Posted
Just now, iMr.WiFi..! said:

الله يهديك كنت برسله الكود وسبقتني , عوافي .~

بتوفيق لصاحب الموضوع

اذا كان طريقة غير اللي فوق اطرحه خلنا نستفيد ^

Posted
Just now, #_iMr.[E]coo said:

اذا كان طريقة غير اللي فوق اطرحه خلنا نستفيد ^

لالا نفس الكود االي انت ارسلته :_(

يعني مافي شيء جديد :<

  • Like 1
Posted

سوي سكل احسن شي واحسن من الاكاونت داتا 

اللي راح تسويه قاعدة بكلومين .. الكولمن الاول هو سريال اللاعب والثاني الحالة

واذا دخل تتحقق لو مسجل بالقاعدة من قبل اذا مسجل تحط الحالة اون لاين اذا مو مسجل تسوي له انسيرت .. واذا خرج تحط الحالة اوف لاين

بس .

  • Like 2
Posted
On 5/14/2017 at 14:42, Deativated said:

هههههههه الكود هذا حق عناد اعتقد :-D

غير صحيح. ولا أنصح بإستخدام الداتا الداخلية

* setAccountData

يُفضل استخدام قواعد بيانات خارجية

 

بالتوفيق

Posted
On 13/05/2017 at 09:00, coNolel said:

عليكم السلام ورحمة الله تعالى  وبركاته ،

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

يعني انا م عجبتكم يعني ض2 ههههههههههه

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