w7sH Posted May 25, 2017 Author Share Posted May 25, 2017 1 minute ago, Abdul KariM said: "onClientGUIClick" guiCheckBoxGetSelected triggerServerEvent getPlayerAccount isGuestAccount setAccountData -- Part 2 "onResourceStart" getElementsByType getPlayerAccount isGuestAccount getAccountData triggerClientEvent "onPlayerLogin" getAccountData triggerClientEvent لاتشوف الفنكشنات طويله , لكن التركيب سهل والله حاول وانا بساعدك اللي عندي انا فري روم ماهو لوحة عاديه .. الاكواد هذي ماظنتي تضبط Link to comment
Abdul KariM Posted May 25, 2017 Share Posted May 25, 2017 لاتضبط , لكن نسيت انك مستعمل الالمنت داتا هذا الفنكشنات المطلوبة "onPlayerQuit" getElementData getPlayerAccount isGuestAccount setAccountData -- part 2 "onResourceStart" getElementsByType getPlayerAccount isGuestAccount getAccountData triggerClientEvent "onPlayerLogin" getAccountData triggerClientEvent 1 Link to comment
w7sH Posted May 25, 2017 Author Share Posted May 25, 2017 (edited) 29 minutes ago, Abdul KariM said: لاتضبط , لكن نسيت انك مستعمل الالمنت داتا هذا الفنكشنات المطلوبة "onPlayerQuit" getElementData getPlayerAccount isGuestAccount setAccountData -- part 2 "onResourceStart" getElementsByType getPlayerAccount isGuestAccount getAccountData triggerClientEvent "onPlayerLogin" getAccountData triggerClientEvent Edited May 25, 2017 by w7sH Link to comment
^iiEcoo'x_) Posted May 25, 2017 Share Posted May 25, 2017 3 minutes ago, w7sH said: يعطيك العافية .. جربت كذا ولا ضبط معي وحاولت كذا بس مدري هل هو صح او لا , لاني اول مره اشتغل في الاكونت داتا function damgeState() if source == getControl(wndMain, 'damgeState') then if guiCheckBoxGetSelected(getControl(wndMain, 'damgeState')) == false then setElementData( g_Me, 'damgeState', 'yes' ) setAccountData ( damgeState , "damge:State" , g_Me ) guiCheckBoxSetSelected(getControl(wndMain, 'damgeState'), true) else setElementData( g_Me, 'damgeState', 'no' ) setAccountData ( damgeState , "damge:State" , g_Me ) guiCheckBoxSetSelected(getControl(wndMain, 'damgeState'), false) end end end addEventHandler("onClientGUIClick", root, damgeState) addEventHandler ( "onClientPlayerDamage", g_Me, function ( ) if ( getElementData ( g_Me, "damgeState" )=='yes' ) then cancelEvent ( ) end end ) addEventHandler ( "onPlayerQuit", g_Root, function ( ) getElementData( g_Me, 'damgeState', 'yes' or 'no' ) local acc = getPlayerAccount(g_Me) if isGuestAccount ( acc ) then setAccountData( g_Me, 'damgeState', 'yes' or 'no' ) end end) احا في شرح لي عن الاكاونت داتا تقدر تستفيد منه Link to comment
Abdul KariM Posted May 25, 2017 Share Posted May 25, 2017 اول شي لو تلاحظ ان الاكونت داتا سيرفر وانت حاطها كلينت ثاني شي شغلك كله سيرفر سايد ثالث شي راجع الويكي وامثله عن الفنكشنات عشان تعرف كيف تستخدمه Link to comment
w7sH Posted May 25, 2017 Author Share Posted May 25, 2017 محاولة آخرى , الخطأ ماطلع معي بالديق بق والكود فيه مشكلة addEventHandler("onResourceStart",resourceRoot, function() for k,v in ipairs(getElementsByType("g_Me")) do local acc = getPlayerAccount(v) if not isGuestAccount(acc) then local damgeState = getAccountData(acc,"damgeState") setElementData(v,"damgeState","yes" or "no") end end end ) Server ^ Link to comment
Abdul KariM Posted May 28, 2017 Share Posted May 28, 2017 مستحيل مافيه بقات بالدي بوق انا الي اشوفه فيه اكثر من بق Link to comment
^iiEcoo'x_) Posted May 28, 2017 Share Posted May 28, 2017 On ٢٥/٥/٢٠١٧ at 19:55, w7sH said: محاولة آخرى , الخطأ ماطلع معي بالديق بق والكود فيه مشكلة addEventHandler("onResourceStart",resourceRoot, function() for k,v in ipairs(getElementsByType("g_Me")) do local acc = getPlayerAccount(v) if not isGuestAccount(acc) then local damgeState = getAccountData(acc,"damgeState") setElementData(v,"damgeState","yes" or "no") end end end ) Server ^ خطا سطر 3 سطر7 Link to comment
w7sH Posted May 28, 2017 Author Share Posted May 28, 2017 وأيضاً هكذا ؟؟ addEventHandler ( "onResourceStart", resourceRoot, function ( ) function ( g_Me, damgeState ) local acc = getPlayerAccount(v) if not isGuestAccount(acc) then local damgeState = getAccountData(acc,"damgeState") setElementData ( source, "damgeState", stateToValue ) end end end ) Link to comment
#BrosS Posted May 28, 2017 Share Posted May 28, 2017 v و stateToValue غير معرفين واثنين فنكشن ؟ يالحبيب Link to comment
^iiEcoo'x_) Posted May 28, 2017 Share Posted May 28, 2017 6 minutes ago, w7sH said: وأيضاً هكذا ؟؟ addEventHandler ( "onResourceStart", resourceRoot, function ( ) function ( g_Me, damgeState ) local acc = getPlayerAccount(v) if not isGuestAccount(acc) then local damgeState = getAccountData(acc,"damgeState") setElementData ( source, "damgeState", stateToValue ) end end end ) كله خطأ , Link to comment
w7sH Posted May 28, 2017 Author Share Posted May 28, 2017 13 minutes ago, #_iMr.[E]coo said: كله خطأ , أشكرك - سكر الموضوع 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