Alnassre Posted June 17, 2013 Share Posted June 17, 2013 السلام عليكم ورحمة الله وبركاته .. اليوم سويت كود حق اغلاق الزر بس اذا يطلع ويدخل ينفتح الزر كيف اخليه يغلق عند اللاعب نهائياً ؟ Link to comment
iPrestege Posted June 17, 2013 Share Posted June 17, 2013 السلام عليكم ورحمة الله وبركاته ..اليوم سويت كود حق اغلاق الزر بس اذا يطلع ويدخل ينفتح الزر كيف اخليه يغلق عند اللاعب نهائياً ؟ اطرح كودك ووضح اكثر Link to comment
Alnassre Posted June 17, 2013 Author Share Posted June 17, 2013 function closeb ( ) if source == b then guiSetEnabled ( b, false ) end end addEventHandler("onClientGUIClick",root, closeb ) احين مثلاً انت ضربت على زر b يتقفل لكن المشكلة اذا اللاعب خرج ودخل مرة ثانية ينفتح الزر انا امبيه ماينفتح نهائياً طبعاً للاعب فقط ينقفل مو للكل Link to comment
iMr.Dawix~# Posted June 17, 2013 Share Posted June 17, 2013 خلاص ضيف حدث اول ما يدخل اللاعب يقفل الزر Link to comment
iPrestege Posted June 17, 2013 Share Posted June 17, 2013 تقدر تسوي حفظ بقاعدة او تقدر تسوي باكاونت الاعب Link to comment
Alnassre Posted June 17, 2013 Author Share Posted June 17, 2013 ما اعرف للقاعدة .. في حل ثاني ؟ Link to comment
./BlackBird# Posted June 17, 2013 Share Posted June 17, 2013 ما اعرف للقاعدة .. في حل ثاني ؟ setAccountData Link to comment
Alnassre Posted June 17, 2013 Author Share Posted June 17, 2013 حل ثاني مافي كلش ؟ ..~ Link to comment
Alnassre Posted June 17, 2013 Author Share Posted June 17, 2013 انزين لو بغيت اسويه بالأكاونت .. كيف بتكون طريقة الكود ؟ Link to comment
iPrestege Posted June 17, 2013 Share Posted June 17, 2013 addEventHandler 'onClientGUIClick' triggerServerEvent setAccountData getAccountData getPlayerAccount isGuestAccount triggerClientEvent onPlayerLogin guiSetEnabled triggerClientEvent Link to comment
./BlackBird# Posted June 17, 2013 Share Posted June 17, 2013 'onClientGUIClick' triggerServerEvent setAccountData getPlayerAccount isGuestAccount onPlayerLogin getPlayerAccount getAccountData triggerClientEvent guiSetEnabled Link to comment
iPrestege Posted June 17, 2013 Share Posted June 17, 2013 'onClientGUIClick' triggerServerEvent setAccountData getPlayerAccount isGuestAccount onPlayerLogin getPlayerAccount getAccountData triggerClientEvent guiSetEnabled getAccountData > نسيتها getPlayerAccount > مالها داعي --- حياكـ الله Link to comment
Alnassre Posted June 17, 2013 Author Share Posted June 17, 2013 ويش الغلط ؟ -- Client Side function closeb ( ) if source == b1 or source == b2 then guiSetEnabled ( b1, false ) guiSetEnabled ( b2, false ) triggerServerEvent("Save",localPlayer) end end addEventHandler("onClientGUIClick",root, closeb ) -- addEvent ( "Close", true ) function Close(b) if (b) then guiSetEnabled ( b1, false ) guiSetEnabled ( b2, false ) end end addEventHandler("Close", getRootElement(),Close) -- Server Side addEvent ( "Save", true ) function Save( ) local account = getPlayerAccount(source) if account and not isGuestAccount(account) then local b = getAccountData(account, "stats.b") triggerClientEvent(source,"Close",source,b) end addEventHandler("onPlayerLogin", getRootElement(),SaveC) end addEventHandler("Save", getRootElement(),Save) Link to comment
iPrestege Posted June 17, 2013 Share Posted June 17, 2013 -- # ~ Server Side addEvent ( 'Save',true ) addEventHandler ( 'Save',root, function ( ) if isGuestAccount ( getPlayerAccount ( client ) ) then return end if getAccountData ( getPlayerAccount ( client ),'GuiButtonEnabled' ) then return end setAccountData ( getPlayerAccount ( client ),'GuiButtonEnabled',true ) outputChatBox(' لا يمكنكـ ضغط الزر مرة أخرى بعد الآن ',client,255,0,0) end ) addEventHandler('onPlayerLogin',root, function ( _,gAccount ) if getAccountData ( gAccount,'GuiButtonEnabled' ) then triggerClientEvent ( source,'Close',source ) end end ) -- # ~ Client Side function closeb ( ) if source == b1 or source == b2 then triggerServerEvent("Save",localPlayer) guiSetEnabled ( b1, false ) guiSetEnabled ( b2, false ) end end addEventHandler( "onClientGUIClick",root,closeb ) function Close ( ) guiSetEnabled ( b1, false ) guiSetEnabled ( b2, false ) end addEvent ( "Close", true ) addEventHandler("Close",root,Close) 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