' A F . Posted July 8, 2015 Share Posted July 8, 2015 ألسسلأم عليكم .. جاتني مشكلة بـ الدتا الارقمنت الاول . الدي بوق يقول باد آرقمنت . انا ابي يوم الاعب يسجل دخول يتحقق من ان قبل اسمه [Pro] يعطيه فلوس الكود addEventHandler("onPlayerLogin",root, function ( player ) if ( getElementData(player,"Moeny") == true ) then if ( getPlayerFromName("[Pro]"..getPlayerName(player).."") ) then givePlayerMoney(player,10000) setElementData(player,"Money",true) outputChatBox("#ffffff* [MoneySystem] : #ff0000 تـم أعطائك فلوس لانك حاط الشعار ",player,255,255,0,true) else outputChatBox("#ffffff* [MoneySystem] : #ff0000 لم يتم اعطائك فلوس لانك ماحطيت الشعار",player,255,0,0,true) end end end ) Link to comment
; Mr.T76eM # Posted July 8, 2015 Share Posted July 8, 2015 onPlayerLogin thePreviousAccount: The account the player was logged into before The source of this event is the player element that just logged in. Playerالـ thePreviousAccount تعريفه Link to comment
; Mr.T76eM # Posted July 8, 2015 Share Posted July 8, 2015 + عندك خطأ بالداتا if ( getElementData(source,"Moeny") == true ) then Moeny ^ setElementData(source,"Money",true) Money Money ~= Moeny Link to comment
' A F . Posted July 8, 2015 Author Share Posted July 8, 2015 ^ مشكور عدلتها لاكن م يعطيني فلوس Link to comment
; Mr.T76eM # Posted July 8, 2015 Share Posted July 8, 2015 addEventHandler("onPlayerLogin",root, function ( ) local name = getPlayerName(source) if string.find(name,"[Pro]" ) then givePlayerMoney(source,10000) outputChatBox("#ffffff* [MoneySystem] : #ff0000 تـم أعطائك فلوس لانك حاط الشعار ",source,255,255,0,true) else outputChatBox("#ffffff* [MoneySystem] : #ff0000 لم يتم اعطائك فلوس لانك ماحطيت الشعار",source,255,0,0,true) end end ) تمت التجربه ^ وخرت الداتا ماشفت لها وظيفة نهائياً لأن الاعب يوم يدخل من جديد ما يكون له داتا الفلوس ما يتحقق الشرط وقتها ما ياخذ فلوس Link to comment
Mr.R Posted July 8, 2015 Share Posted July 8, 2015 الداتا وهميه -.- عشان كذا ماياخذ فلوس اذا طلع ودخل اظن تقدر تسويها ب الاكاونت داتا @The[X]GameR وترى كود شغال Link to comment
; Mr.T76eM # Posted July 8, 2015 Share Posted July 8, 2015 الداتا وهميه -.-عشان كذا ماياخذ فلوس اذا طلع ودخل اظن تقدر تسويها ب الاكاونت داتا @The[X]GameR وترى كود شغال صحيح Link to comment
' A F . Posted July 8, 2015 Author Share Posted July 8, 2015 انا عارف انه كود قيمر شغال لاكن حتى لو بداية آسمي Pr يعطيني .. Link to comment
ALw7sH Posted July 8, 2015 Share Posted July 8, 2015 addEventHandler("onPlayerLogin",root, function ( player ) if ( getElementData(player,"Moeny") == true ) then if ( getPlayerName(player):find("%[Pro%]") ) then givePlayerMoney(player,10000) setElementData(player,"Money",true) outputChatBox("#ffffff* [MoneySystem] : #ff0000 تـم أعطائك فلوس لانك حاط الشعار ",player,255,255,0,true) else outputChatBox("#ffffff* [MoneySystem] : #ff0000 لم يتم اعطائك فلوس لانك ماحطيت الشعار",player,255,0,0,true) end end end ) انه مايقدر ياخذ فلوس غير مره غير من المنت داتا الى اكونت داتا Link to comment
Mr.R Posted July 8, 2015 Share Posted July 8, 2015 (edited) هذا مثال للكل من جانب سيرفر وسويته عن طريق جدول عشان تحط تاجات زيادهـ local nTable = { "[Pro]", -- "tag", } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _,v in ipairs ( nTable ) do if ( string.find ( string.upper ( getPlayerName ( v ), v[1] ) ) ) then givePlayerMoney ( v, 1000000 ) outputChatBox ( "تم اعطاء جميع الاعبين الي حاطين الشعار فلوس", v, 255, 255, 255, true ) else outputChatBox ( "لم يتم اعطاء الجميع فلوس لانهم مو حاطين العشار", v, 255, 255, 255, true ) end end end ) Edit : تم التعديل Edited July 9, 2015 by Guest Link to comment
; Mr.T76eM # Posted July 8, 2015 Share Posted July 8, 2015 جرّب ! addEventHandler("onPlayerLogin",root, function ( ) local name = getPlayerName(source) if ( name:find("%[Pro%]") ) then givePlayerMoney(source,10000) outputChatBox("#ffffff* [MoneySystem] : #ff0000 تـم أعطائك فلوس لانك حاط الشعار ",source,255,255,0,true) else outputChatBox("#ffffff* [MoneySystem] : #ff0000 لم يتم اعطائك فلوس لانك ماحطيت الشعار",source,255,0,0,true) end end ) ي الوحش , الكود حقق جربته ما شتغل لكن عندي سؤال %[Pro%] هذي علامة النسبه المئوية وش وظيفتها ؟ Link to comment
#DRAGON!FIRE Posted July 8, 2015 Share Posted July 8, 2015 (edited) @ Mr.R : مثالكـ خطا ! جربت هالكود .. : addEventHandler ( "onPlayerLogin", root, function ( ) if ( string.find ( string.lower ( getPlayerName ( source ) ), "[pro]" ) ) then givePlayerMoney ( source, 1000 ) setElementData ( source, "ProPlayer", true ) end end ) Edited July 8, 2015 by Guest Link to comment
Rm-Dj Posted July 8, 2015 Share Posted July 8, 2015 @ Mr.R : مثالكـ خطا ! ياليت تجاوب ع هالسؤال ياخ زاحف ي الوحش , الكود حقق جربته ما شتغل لكن عندي سؤال %[Pro%] هذي علامة النسبه المئوية وش وظيفتها ؟ Link to comment
Mr.R Posted July 8, 2015 Share Posted July 8, 2015 @ Mr.R : مثالكـ خطا !جربت هالكود .. : addEventHandler ( "onPlayerLogin", root, function ( ) if ( string.find ( string.lower ( getPlayerName ( source ) ), "[pro]" ) ) then givePlayerMoney ( source, 1000 ) setElementData ( source, "ProPlayer", true ) end end ) الخطأ في التحقق صح ؟ طيب وش وظيفة string.lower Link to comment
#DRAGON!FIRE Posted July 8, 2015 Share Posted July 8, 2015 الخطا فـ الكود كله مو بس التحقق .. فايدتها تصغر لك حروف السترنق بالنسبة لكود الوحش ما ادري وش الغرض من انه حط النسبة المئوية Link to comment
Mr.R Posted July 8, 2015 Share Posted July 8, 2015 الخطا فـ الكود كله مو بس التحقق .. فايدتها تصغر لك حروف السترنقبالنسبة لكود الوحش ما ادري وش الغرض من انه حط النسبة المئوية طيب ولا عليك امر صحح الكود عشان اعرف الخطأ وماطيح فيه مره ثانيهه Link to comment
; Mr.T76eM # Posted July 9, 2015 Share Posted July 9, 2015 @ Mr.R : مثالكـ خطا ! ياليت تجاوب ع هالسؤال ياخ زاحف ي الوحش , الكود حقق جربته ما شتغل لكن عندي سؤال %[Pro%] هذي علامة النسبه المئوية وش وظيفتها ؟ غريبه والله حنا نبرمج ولا رياضيات ؟ وش وظيفة النسبة المئوية يا اخوآن ؟ + برو قيمر طرحت لك الكود الاخير الكود شغال اذا كتبت pr ما تاخذ فلوس وكل شيء تمام بالتوفيق Link to comment
#DRAGON!FIRE Posted July 9, 2015 Share Posted July 9, 2015 (edited) طيب ولا عليك امر صحح الكود عشان اعرف الخطأ وماطيح فيه مره ثانيهه addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( "player" ) ) do if ( string.find ( string.upper ( getPlayerName ( v ), "[Pro]" ) ) ) then givePlayerMoney ( v, 1000000 ) outputChatBox ( "تم اعطاء جميع الاعبين الي حاطين الشعار فلوس", v, 255, 255, 255, true ) end end end ) Edited July 9, 2015 by Guest Link to comment
' A F . Posted July 9, 2015 Author Share Posted July 9, 2015 Thanks For All | شـكرا للجميع . #تمت_الافادة Link to comment
Mr.R Posted July 9, 2015 Share Posted July 9, 2015 حياك الله يارفيقي ^ وتسلم يمينك يآ زاحف $ Link to comment
; Mr.T76eM # Posted July 9, 2015 Share Posted July 9, 2015 حـيّآكـ الله أخوي :] قليله بحقك Link to comment
ALw7sH Posted July 9, 2015 Share Posted July 9, 2015 جرّب ! addEventHandler("onPlayerLogin",root, function ( ) local name = getPlayerName(source) if ( name:find("%[Pro%]") ) then givePlayerMoney(source,10000) outputChatBox("#ffffff* [MoneySystem] : #ff0000 تـم أعطائك فلوس لانك حاط الشعار ",source,255,255,0,true) else outputChatBox("#ffffff* [MoneySystem] : #ff0000 لم يتم اعطائك فلوس لانك ماحطيت الشعار",source,255,0,0,true) end end ) ي الوحش , الكود حقق جربته ما شتغل لكن عندي سؤال %[Pro%] هذي علامة النسبه المئوية وش وظيفتها ؟ ماشتغل لانه فيه تحقق لو معك داتا وانت مامعك ذي الداتا بالنسبه لسؤالك لو تحط زي كذا string.find ("[Pro]Player","[Pro]") مابيشتغل صح السكربت بيكون عندك خطا لازم تحط قبل [ and ] % 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