taha201100 Posted May 31, 2016 Share Posted May 31, 2016 السلام عليكم بسئل كيف يمديني اسوي فلوس مثل نظام فلوس لكن مثلن نظام فلوس ذهب وكذا يا ريت امثله والفنكشنات Link to comment
Ja[B]er[X]Pro Posted May 31, 2016 Share Posted May 31, 2016 dxDrawText تسوي كلام بالشاشة حق عدد الفلوس setElementData يعطي داتا الفلوس getElementData يجيب عدد داتا الفلوس Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 ممكن مثال لانه اول مره اسويها ؟؟ Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 مثلن لما يضغط على زر يعطيه العمليه الذهبيه وتنحفظ مثل الفلوس Link to comment
Me[Z]oO Posted May 31, 2016 Share Posted May 31, 2016 مثلن لما يضغط على زر يعطيه العمليه الذهبيه وتنحفظ مثل الفلوس بسم الله نبدأ الشرح --Client addEventHandler("onClientGUIClick",root,function() if source == button then setElementData(localPlayer, "Gold", getElementData(localPlayer, "Gold") + 10) end end) -- الحين يعطيني 10 ذهب طيب لو طلعت ودخلت الذهب يروح نسوي اكونت داتا نحفظها --Server addEventHandler('onPlayerQuit',root, function ( ) local vAcc = getPlayerAccount(source) if not vAcc or isGuestAccount (vAcc) then return end setAccountData(vAcc,'Gold',getElementData(source,"Gold")) end ) addEventHandler('onPlayerLogin',root, function(_,acc) local v_Data = getAccountData(acc,'Gold') if ( v_Data ) then setElementData(source, "Gold",getAccountData(acc,'Gold')) end end ) -- هنا سوينا حفظ للذهب انشاء الله تفهم بالنسبة لكيف تعرف عدد ذهبك howmany = getElementData(localPlayer,"Gold") dxDrawText(howmany, -- باقي الارقمنتات ) -- هنا تحذف اول ارقمنت الي هو سترنق الكلام وتحط بداله howmany اتمني اكود افدتك Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 مشكووور بس لو بسوي بمود ثاني يتحقق من فلوسه الذهب كيف تصير؟ Link to comment
Me[Z]oO Posted May 31, 2016 Share Posted May 31, 2016 مشكووور بس لو بسوي بمود ثاني يتحقق من فلوسه الذهب كيف تصير؟ --Server addCommandHandler("HowMany", function(p) if getElementData(p,"Gold") == 3 then outputChatBox("ذهبك 3 " ,p) end end) Link to comment
#Soking Posted May 31, 2016 Share Posted May 31, 2016 executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `TablSave` (Serial, Gold) ' ) function onSave( ) local checkData = executeSQLQuery( ' SELECT * FROM `TablSave` WHERE Serial = ? ', getPlayerSerial(source) ) local Gold = getElementData(source,'Gold') if ( type ( checkData ) == 'table' and #checkData == 0 or not checkData ) then executeSQLQuery( ' INSERT INTO `TablSave` (Serial, Gold) VALUES(?, ?) ', getPlayerSerial(source),Gold) else local Gold = getElementData(source,'Gold') executeSQLQuery( ' UPDATE`TablSave` SET Serial = ?, Gold = ?', getPlayerSerial(source), Gold ) end end addEventHandler('onPlayerQuit',getRootElement(),onSave) addEventHandler('onPlayerLogout',getRootElement(),onSave) addEventHandler( 'onPlayerLogin', root, function( ) local Save = executeSQLQuery( ' SELECT * FROM `TablSave` WHERE Serial = ? ', getPlayerSerial(source) ) if ( type ( Save ) == 'table' and #Save == 0 or not Save ) then return end setElementData(source,'Gold',Save[1]['Gold']) end ) اسستخدمهه للحفظ + لو في غلط يا شباب كلموني للشروطط if ( getElementData(Element,'Gold') == 1 ) then Element = نوع الامنت مثل localPlayer - Client Sode source - Server Side وتقدر تستخدمه في Vehicle - Ped - Weapon - Resource - Player Link to comment
#Soking Posted May 31, 2016 Share Posted May 31, 2016 == يساوي >= اكبر من او يساوي <= اقل من او يساوي > اكبر من < اقل من ~= لا يساوي Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 لو بسوي التحقق من الفلوس بمود ثاني بس احط اسم الالمنت ولا لازم set elament بنفس المود؟ Link to comment
#Soking Posted May 31, 2016 Share Posted May 31, 2016 لا عاااااااادييييييي تحط التحقق في اكثر من مود Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 مشكور بحاول وارد خبر بعدين Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 انا مسوي الليبل على جيو مب دي اكس وش احط بدل dxDrawText؟؟ Link to comment
Me[Z]oO Posted May 31, 2016 Share Posted May 31, 2016 انا مسوي الليبل على جيو مب دي اكس وش احط بدل dxDrawText؟؟ هات سطر انشاء الليبل Link to comment
taha201100 Posted May 31, 2016 Author Share Posted May 31, 2016 ممكن تسوي لي واحد تجربه واي ليبل مو مشكله وارفعه هنا او اطرح اكوادهم لانه اتحوست منه ومسحته Link to comment
nxFairlywell Posted May 31, 2016 Share Posted May 31, 2016 انا مافهمتك ، وضح وش تبي بالضبط Link to comment
' A F . Posted June 1, 2016 Share Posted June 1, 2016 تفضل سويت لك نظـام كأمــل .. Client Side : LocalPlayer = getLocalPlayer ( ) addEventHandler("onClientResourceStart", resourceRoot, function() TheLabel = guiCreateLabel(8, 363, 206, 25, "Your Gold : ", false) guiSetFont(TheLabel, "default-bold-small") setTimer ( function ( ) triggerServerEvent("OnGetGold",localPlayer) end,1000,0) end ) addEventHandler("onClientRender",root, function ( ) if ( guiGetVisible ( TheLabel ) ) then local TheData = getElementData ( LocalPlayer , "TheGold" ) if ( TheData ) then guiSetText ( TheLabel , "Your Gold : "..TheData ) end end end ) Server Side : Sqlite = executeSQLQuery DefaultGold = 0 Sqlite("CREATE TABLE IF NOT EXISTS GoldSystem (TheSerial,TheGold)") addEventHandler("onResourceStart",resourceRoot, function ( ) local ThePlayers = getElementsByType("player") for Index,Values in ipairs ( ThePlayers ) do local Default = Sqlite("SELECT * FROM GoldSystem WHERE TheSerial=?",tostring(getPlayerSerial(Values))) if ( Default and type ( Default ) == "table" and #Default ~= 0 ) then setElementData ( Values , "TheGold" , Default[1]["TheGold"] ) else setElementData ( Values , "TheGold" , tonumber ( DefaultGold ) ) end end end ) addEventHandler("onPlayerJoin",root, function ( ) local Default = Sqlite("SELECT * FROM GoldSystem WHERE TheSerial=?",tostring(getPlayerSerial(source))) if ( Default and type ( Default ) == "table" and #Default ~= 0 ) then setElementData ( source , "TheGold" , Default[1]["TheGold"] ) else setElementData ( source , "TheGold" , tonumber ( DefaultGold ) ) end end ) addEvent("OnGetGold",true) addEventHandler("OnGetGold",root, function ( ) local Default = Sqlite("SELECT * FROM GoldSystem WHERE TheSerial=?",tostring(getPlayerSerial(client))) if ( Default and type ( Default ) == "table" and #Default ~= 0 ) then setElementData ( client , "TheGold" , Default[1]["TheGold"] ) else setElementData ( client , "TheGold" , tonumber ( DefaultGold ) ) end end ) function getPlayerGold ( player ) local Default = Sqlite("SELECT * FROM GoldSystem WHERE TheSerial=?",tostring(getPlayerSerial(player))) if ( Default and type ( Default ) == "table" and #Default ~= 0 ) then return Default[1]["TheGold"] else return false end end function setPlayerGold ( player , gold ) if ( type ( gold ) ~= "number" ) then return false end local Default = Sqlite("SELECT * FROM GoldSystem WHERE TheSerial=?",tostring(getPlayerSerial(player))) if ( Default and type ( Default ) == "table" and #Default ~= 0 ) then Sqlite("UPDATE GoldSystem SET TheGold=? WHERE TheSerial=?",Default[1]["TheGold"]+gold,tostring(getPlayerSerial(player))) setElementData ( player , "TheGold" , Default[1]["TheGold"] ) else Sqlite("INSERT INTO GoldSystem (TheSerial,TheGold) VALUES (?,?)",tostring(getPlayerSerial(player)),DefaultGold) setElementData ( player , "TheGold" , DefaultGold ) end end addCommandHandler("Gold", function ( player , command , text ) if ( player and text ) then if ( text == "info" ) then local Gold = getPlayerGold ( player ) outputChatBox("* Your Gold : "..Gold , player , 255 , 255 , 0 , true ) end if ( text == "giveing" ) then setPlayerGold ( player , 1 ) end end end ) ملأحظات : لو تبي تعطي نفسك ذهب اكتب في اف 8 Gold giveing لو تبي تجيب كم ذهب عندك اكتب في اف 8 Gold info Link to comment
taha201100 Posted June 1, 2016 Author Share Posted June 1, 2016 (edited) ضبط مشكور بس حسيتها حوسه ما ينفع انسخ اكواد اللعبه حقت الفلوس الاصليه والصقها واخليها للجولد؟؟ Edited June 1, 2016 by Guest Link to comment
Me[Z]oO Posted June 1, 2016 Share Posted June 1, 2016 ما ضبط ما يعطيبسئلك ما ينفع اريح راسي واسوي مثل نظام فلوس اللعبه بالضبط لكن لخيهم للجولد يعني انسخ الاكواد الاصليه ينفع؟؟ م فهمت عليك Link to comment
taha201100 Posted June 1, 2016 Author Share Posted June 1, 2016 صح لما تحمل اللعبه يجي نظام الفلوس العمله الخضراء ينفع انسخ اكوادها والصقها لكن احولها لجولد وكذا يصير عملتين ونفس الوقت ينحفظون Link to comment
Me[Z]oO Posted June 1, 2016 Share Posted June 1, 2016 صح لما تحمل اللعبه يجي نظام الفلوس العمله الخضراء ينفع انسخ اكوادها والصقها لكن احولها لجولد وكذا يصير عملتين ونفس الوقت ينحفظون وكيف تجيب اكوادها ذي ؟ Link to comment
#Soking Posted June 1, 2016 Share Posted June 1, 2016 مافي شي صعب بس اعتقد ان اخونا تفلسف كثير في الاكواد ض1 Link to comment
' A F . Posted June 1, 2016 Share Posted June 1, 2016 مافي شي صعب بس اعتقد ان اخونا تفلسف كثير في الاكواد ض1 تكلمني ؟ Link to comment
#Soking Posted June 1, 2016 Share Posted June 1, 2016 addEventHandler("onClientRender",root, function ( ) if ( guiGetVisible ( TheLabel ) ) then local TheData = getElementData ( LocalPlayer , "TheGold" ) if ( TheData ) then guiSetText ( TheLabel , "Your Gold : "..TheData ) end end end ) ليه حاط دا الشرط if ( TheData ) then ؟؟ + وش دا LocalPlayer = getLocalPlayer ( ) مب لها اي لاززززززززمه localPlayer وخلاص وتكون وفرت سطر function ( player , command , text ) if ( player and text ) then وش سالفة التحققات دا فهمني يمكن استفاد ض1 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