#Mr.Pop Posted March 16, 2018 Share Posted March 16, 2018 السلام عليكم كيف الاحواال شباب الموضوع : انا سويت لوحة فيه اوديت وفي لوحة اخر تحدتوي على ميمو و في زر المشكل : بدي لم اللعب يضغط على زر راح يضهر له الوقت الي كتب فيه لكن مش راضي الكود -- سيرفر addEvent("Trigger:Add",true) addEventHandler("Trigger:Add",root,function(Partage) local Serial = getPlayerSerial(source) local time = getRealTime() local month = time.month if Partage and time then -- executeSQLQuery("INSERT INTO newspaper (Text , Serial ) VALUES ( ? , ? )",Partage,Serial) -- غير مهم executeSQLQuery("INSERT INTO monthday (time,monthday , Serial ) VALUES ( ? , ? ,? )",time,month,Serial) triggerEvent("Trigger:All",source) end end ) -- كلينت addEvent("Trigger:TPClient",true) addEventHandler("Trigger:TPClient",root,function(Table,Dates) --for i , v in ipairs (Table) do -- غير مهم for k , p in ipairs (Dates) do -- guiSetText(newspaper_news,v.Text) -- غير مهم guiSetText(newspaper_data,p.month) end end end) --[[ بدي اعط شهر انا لم احط اليوم يشتغل بس لم احط الشهر ميضهر مفهمة !!!!؟ ]] هيك ي Link to comment
#Mr.Pop Posted March 16, 2018 Author Share Posted March 16, 2018 addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS newspaper( Text , Serial )") executeSQLQuery("CREATE TABLE IF NOT EXISTS monthday( time ,monthday, Serial )") end ) addEvent("Trigger:Add",true) addEventHandler("Trigger:Add",root,function(Partage) local Serial = getPlayerSerial(source) local time = getRealTime() local month = time.month if Partage and time then executeSQLQuery("INSERT INTO newspaper (Text , Serial ) VALUES ( ? , ? )",Partage,Serial) executeSQLQuery("INSERT INTO monthday (time,monthday , Serial ) VALUES ( ? , ? ,? )",time,month,Serial) triggerEvent("Trigger:All",source) end end ) addEvent("Trigger:All",true) addEventHandler("Trigger:All",root,function() local SQL_ = executeSQLQuery("SELECT * FROM newspaper WHERE Serial = ? ",getPlayerSerial ( source )) local dSQL_ = executeSQLQuery("SELECT * FROM monthday WHERE Serial = ? ",getPlayerSerial ( source )) if #SQL_ ~= 0 and #dSQL_ ~= 0 then triggerClientEvent ( source, 'Trigger:TPClient' , source , SQL_ ,dSQL_) end end) ------------- addEventHandler("onClientResourceStart", resourceRoot, function() --------- news Paper Network Ls PANEL_NLS = guiCreateWindow(405, 20, 458, 549, "Control Of The Newspaper ", false) guiWindowSetSizable(PANEL_NLS, false) guiSetVisible(PANEL_NLS,false) MEMO_NLS = guiCreateMemo(9, 21, 439, 476, "", false, PANEL_NLS) EDIT_NLS = guiCreateButton(11, 508, 192, 31, "send Newspaper", false, PANEL_NLS) EXIT_NLS = guiCreateButton(246, 507, 192, 31, "Exit", false, PANEL_NLS) ----- news Paper Player newspaper = guiCreateStaticImage(286, 26, 776, 430, ":newspaper/Accessories/newspaper.png", false) guiSetVisible(newspaper,false) newspaper_data = guiCreateEdit(105, 72, 111, 19, "", false, newspaper) guiEditSetReadOnly(newspaper_data, true) newspaper_news = guiCreateMemo(43, 133, 636, 224, "", false, newspaper) guiMemoSetReadOnly(newspaper_news, true) end ) bindKey("F9","down",function (player) guiSetVisible ( newspaper , not guiGetVisible ( newspaper ) ) showCursor ( guiGetVisible (newspaper) ) return guiGetVisible ( newspaper ) == true and triggerServerEvent("Trigger:All",localPlayer) end ) addEvent("Trigger:TPClient",true) addEventHandler("Trigger:TPClient",root,function(Table,Dates) for i , v in ipairs (Table) do for k , p in ipairs (Dates) do guiSetText(newspaper_news,v.Text) guiSetText(newspaper_data,p.month) end end end) bindKey("F5","down",function (player) if getElementData(localPlayer, "faction") == 20 then -- LSN guiSetVisible ( PANEL_NLS , not guiGetVisible ( PANEL_NLS ) ) showCursor ( guiGetVisible (PANEL_NLS) ) return guiGetVisible ( PANEL_NLS ) == true and triggerServerEvent("Trigger:All",localPlayer) end end ) addEventHandler("onClientGUIClick",root,function() if source == EDIT_NLS then local Partage = guiGetText(MEMO_NLS) triggerServerEvent("Trigger:Add",localPlayer,Partage,monthday) elseif source == EXIT_NLS then guiSetVisible (PANEL_NLS,false) showCursor ( false ) end end ) Link to comment
^iiEcoo'x_) Posted March 16, 2018 Share Posted March 16, 2018 guiSetText(newspaper_data,p.monthday) Link to comment
#Mr.Pop Posted March 16, 2018 Author Share Posted March 16, 2018 3 minutes ago, DABL said: guiSetText(newspaper_data,p.monthday) يب بس لم احط لم احط الشهر والعام ميشتغل Link to comment
^iiEcoo'x_) Posted March 16, 2018 Share Posted March 16, 2018 local time = getRealTime() local month = time.month - 1 time = time.year - 1900 Link to comment
#Mr.Pop Posted March 16, 2018 Author Share Posted March 16, 2018 29 minutes ago, DABL said: local time = getRealTime() local month = time.month - 1 time = time.year - 1900 مضبط Link to comment
^iiEcoo'x_) Posted March 16, 2018 Share Posted March 16, 2018 طلبك الاول سويته لك بس منا فاهم طلبك الثاني Link to comment
#Mr.Pop Posted March 16, 2018 Author Share Posted March 16, 2018 هو لم يكتب و يضغط على الزر راح يتغير النص الى تاريخ اليوم Link to comment
Abdul KariM Posted March 17, 2018 Share Posted March 17, 2018 استخدمهم بالشكل هذا local time = getRealTime( ) local h = time.hour local m = time.minute local s = time.second local y = time.year+1900 local m_ = time.month+1 local d = time.monthday 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