Adham Posted September 20, 2017 Share Posted September 20, 2017 (edited) #Client Side: onSendMessage = function ( ) local n1, n2 = guiGetText ( edit ), guiGetText ( edit2 ) if n1 == "" or n2 == "" then return end triggerServerEvent ( "onSendMessage", localPlayer, n1, n2 ) end addEventHandler( "onClientGUIClick", button, function ( ) onSendMessage ( ) end, false ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "onRefesh", localPlayer ) end ) addEvent ( "accept", true ) addEventHandler ( "accept", root, function ( table ) if table then guiGridListClear ( grid ) for i,v in ipairs ( table ) do local Row = guiGridListAddRow( grid ) guiGridListSetItemText ( grid, Row, 1, v.n1, false, false ) guiGridListSetItemText ( grid, Row, 2, v.n2, false, false ) end end end ) #Server Side: executeSQLQuery( "CREATE TABLE IF NOT EXISTS SaveS ( n1, n2, serial )" ) Refresh = function ( ) local aSQL2 = executeSQLQuery ( 'SELECT * FROM aSave WHERE serial=?' , getPlayerSerial ( source ) ) if ( #aSQL2 ~= 0 ) then triggerClientEvent ( source, "accept", source, aSQL2 ) end end addEvent ( "onRefesh", true ) addEventHandler ( "onRefesh", root, Refresh ) SendMessage = function (n1,n2) if n1 and n2 then executeSQLQuery( "INSERT INTO aSave ( n1, n2, serial ) VALUES( ? , ?, ? )", n1, n2, getPlayerSerial(source) ) Refresh ( ) end end addEvent ( "onSendMessage", true ) addEventHandler ( "onSendMessage", root, SendMessage ) Edited September 20, 2017 by Deativated Link to comment
+Source|> Posted September 20, 2017 Author Share Posted September 20, 2017 2 minutes ago, Deativated said: #Client Side: onSendMessage = function ( ) local n1, n2 = guiGetText ( edit ), guiGetText ( edit2 ) if n1 == "" or n2 == "" then return end triggerServerEvent ( "onSendMessage", localPlayer, n1, n2 ) end addEventHandler( "onClientGUIClick", button, function ( ) onSendMessage ( ) end, false ) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) triggerServerEvent ( "onRefesh", localPlayer ) end ) addEvent ( "accept", true ) addEventHandler ( "accept", root, function ( table ) if table then guiGridListClear ( grid ) for i,v in ipairs ( table ) do local Row = guiGridListAddRow( grid ) guiGridListSetItemText ( grid, Row, 1, v.n1, false, false ) guiGridListSetItemText ( grid, Row, 2, v.n2, false, false ) end end end ) #Server Side: executeSQLQuery( "CREATE TABLE IF NOT EXISTS SaveS ( n1, n2, serial )" ) Refresh = function ( ) local aSQL2 = executeSQLQuery ( 'SELECT * FROM aSave WHERE serial=?' , getPlayerSerial ( source ) ) if ( #aSQL2 ~= 0 ) then triggerClientEvent ( source, "accept", source, aSQL2 ) end end addEvent ( "onRefesh", true ) addEventHandler ( "onRefesh", root, Refresh ) SendMessage = function ( ) executeSQLQuery( "INSERT INTO aSave ( n1, n2, serial ) VALUES( ? , ?, ? )", n1, n2, getPlayerSerial(source) ) Refresh ( ) end addEvent ( "onSendMessage", true ) addEventHandler ( "onSendMessage", root, SendMessage ) انا ظبطه شكرا لك بس الحين في شي تاني كود مسح الرو وش هو ؟ Link to comment
Adham Posted September 20, 2017 Share Posted September 20, 2017 (edited) بدل, button, بإسم زرك بدل, grid, باسم القريد حقك والكود غير مجرب : Event = "onClientGUIClick" Button = Delete Grid = GridList addEventHandler ( Event, Button, function ( ) local n1 = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) if n1 == "" then return end triggerServerEvent ( "delete", localPlayer, n1 ) end , false ) sql = executeSQLQuery addEvent ( "delete", true ) addEventHandler ( "delete", root, function(a) local db = sql ( "SELECT serial FROM aSave WHERE a = ?", a ) if #db == 0 then sql ( "DELETE FROM aSave WHERE a = ?", a ) Refresh ( ) end end ) Edited September 20, 2017 by Deativated Link to comment
+Source|> Posted September 20, 2017 Author Share Posted September 20, 2017 11 minutes ago, Deativated said: بدل, button, بإسم زرك بدل, grid, باسم القريد حقك والكود غير مجرب : Event = "onClientGUIClick" Button = Delete Grid = GridList addEventHandler ( Event, Button, function ( ) local n1 = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) if n1 == "" then return end triggerServerEvent ( "delete", localPlayer, n1 ) end , false ) sql = executeSQLQuery addEvent ( "delete", true ) addEventHandler ( "delete", root, function(a) local db = sql ( "SELECT serial FROM aSave WHERE a = ?", a ) if #db == 0 then sql ( "DELETE FROM aSave WHERE a = ?", a ) Refresh ( ) end end ) شف هذا ما اشتغل addEvent("Done", true) addEventHandler("Done", root, function( a ) local db = executeSQLQuery ( "SELECT serial FROM aSave WHERE Serial = ?", getPlayerSerial( source ) ) if #db == 0 then executeSQLQuery ( "DELETE FROM aSave WHERE Serial = ?", getPlayerSerial( source ) ) executeSQLQuery( "DELETE FROM aSave WHERE Serial =?", getPlayerSerial ( source ) ) triggerEvent ( 'Refresh_' , source ) end end ) Link to comment
Adham Posted September 20, 2017 Share Posted September 20, 2017 اولأ انت جايب سريال اللاعب الهوأ السورس فأ انت لازم تضيف كلومن جديد في قريد لست بأسم سريال اللاعب وتسوي تريقر مع تحديد سريال اللاعب وتستقبله بالترقير, وتحذفه بالسيرفر عن طريق السجل وتسوي ريفرش للقاعدة. Link to comment
+Source|> Posted September 20, 2017 Author Share Posted September 20, 2017 5 minutes ago, Deativated said: اولأ انت جايب سريال اللاعب الهوأ السورس فأ انت لازم تضيف كلومن جديد في قريد لست بأسم سريال اللاعب وتسوي تريقر مع تحديد سريال اللاعب وتستقبله بالترقير, وتحذفه بالسيرفر عن طريق السجل وتسوي ريفرش للقاعدة. والله يعطيكم العافيه على التعليم تعلمت شويه من السكل اليوم بس هل ينفع guiGridListRemoveRow Link to comment
Adham Posted September 20, 2017 Share Posted September 20, 2017 Just now, Source|> said: والله يعطيكم العافيه على التعليم تعلمت شويه من السكل اليوم بس هل ينفع guiGridListRemoveRow ايه ينفع بس لو سويت رسترت للمود, او سويت ريفرش بيجي تاني م بينحذف. Link to comment
+Source|> Posted September 20, 2017 Author Share Posted September 20, 2017 1 hour ago, Deativated said: ايه ينفع بس لو سويت رسترت للمود, او سويت ريفرش بيجي تاني م بينحذف. طيب كيفف هذا كودي وما اشتغل addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK = ?", NK1 ) triggerEvent ( 'Refresh_' , source ) end ) فيه مشكلة لما احد يرسل الرسالة ما يجيني بالجريد ليست يجي لما انا ارسل بس يعني اشوف نفسي Link to comment
MR.StoRm Posted September 21, 2017 Share Posted September 21, 2017 9 hours ago, Source|> said: طيب كيفف هذا كودي وما اشتغل addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK = ?", NK1 ) triggerEvent ( 'Refresh_' , source ) end ) فيه مشكلة لما احد يرسل الرسالة ما يجيني بالجريد ليست يجي لما انا ارسل بس يعني اشوف نفسي آسف امس سحبت عليك رحت نمت , كودك الي فوق يصير كذا : addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK1 = ?", NK1 ) triggerEvent ( 'Refresh_' , source ) end ) تأكد انه اسم التيبل aSave Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 13 minutes ago, MR.StoRm said: آسف امس سحبت عليك رحت نمت , كودك الي فوق يصير كذا : addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK1 = ?", NK1 ) triggerEvent ( 'Refresh_' , source ) end ) تأكد انه اسم التيبل aSave طيب عوافي المشكله الثانيه كيف احلها Link to comment
MR.StoRm Posted September 21, 2017 Share Posted September 21, 2017 24 minutes ago, Source|> said: طيب عوافي المشكله الثانيه كيف احلها ما فهمتها وضح اكثر Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 1 minute ago, MR.StoRm said: ما فهمتها وضح اكثر الحين مسوي لوحه اكتب فيها اسم التاج واللون لما اضغط ارسال يجيني المعلومات في الجريدليست انا اقدر اشوف اللي اانا ارسلته بس لكن لما واحد يدخل معلوماته ويضغط ارسال ما يجيني بالجريدليست Link to comment
MR.StoRm Posted September 21, 2017 Share Posted September 21, 2017 Just now, Source|> said: الحين مسوي لوحه اكتب فيها اسم التاج واللون لما اضغط ارسال يجيني المعلومات في الجريدليست انا اقدر اشوف اللي اانا ارسلته بس لكن لما واحد يدخل معلوماته ويضغط ارسال ما يجيني بالجريدليست سوي root 12 minutes ago, MR.StoRm said: سوي root ظبط معك ؟ Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 12 minutes ago, MR.StoRm said: سوي root ظبط معك ؟ اسوي وين Link to comment
MR.StoRm Posted September 21, 2017 Share Posted September 21, 2017 Just now, Source|> said: اسوي وين ب سيرفر , بدل source , ب root Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 21 minutes ago, MR.StoRm said: ب سيرفر , بدل source , ب root ما ظبط addEventHandler("onResourceStart", root, function() executeSQLQuery( "CREATE TABLE IF NOT EXISTS aSave ( NK, NKC, Serial )" ) end ) addEvent("add", true) addEventHandler("add", root, function( NK1, NKC1 ) if NK1 and NKC1 then local aSerial = getPlayerSerial ( source ) executeSQLQuery( "INSERT INTO aSave ( NK, NKC, Serial ) VALUES( ? , ? , ? )", NK1, NKC1, aSerial ) triggerEvent ( 'Refresh_' , root ) end end ) addEvent ( 'Refresh_' , true ) addEventHandler ( 'Refresh_' , root , function () local aSQL2 = executeSQLQuery ( 'SELECT * FROM aSave WHERE Serial=?' , getPlayerSerial ( source ) ) if ( #aSQL2 ~= 0 ) then triggerClientEvent ( root, 'AddInGrid' , root , aSQL2 ) end end ) addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK1 = ?", NK1 ) triggerEvent ( 'Refresh_' , root ) end ) Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 هل من مساعده يا قوم ؟؟ MR.StoRm iMr.WiFi..! xX_Ma[D]arA_xX Default#^ Link to comment
Rakan# Posted September 21, 2017 Share Posted September 21, 2017 22 minutes ago, Source|> said: هل من مساعده يا قوم ؟؟ MR.StoRm iMr.WiFi..! xX_Ma[D]arA_xX Default#^ وش آلمشكله بالضبط حقتك ؟ Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 Just now, Rakan# said: وش آلمشكله بالضبط حقتك ؟ لما اللاعب يرسل طلب تاج ما يجيني في اللوحه نفس مود الرنت حق طاره بس انا حقي تاج لما يرسل ما يجيني بالجريد Link to comment
Rakan# Posted September 21, 2017 Share Posted September 21, 2017 Just now, Source|> said: لما اللاعب يرسل طلب تاج ما يجيني في اللوحه نفس مود الرنت حق طاره بس انا حقي تاج لما يرسل ما يجيني بالجريد يعني لما شخص يرسل تجيك بـ القريد ليست حقك بـ إختصار ؟ Link to comment
iMr.WiFi..! Posted September 21, 2017 Share Posted September 21, 2017 (edited) 3 minutes ago, Source|> said: لما اللاعب يرسل طلب تاج ما يجيني في اللوحه نفس مود الرنت حق طاره بس انا حقي تاج لما يرسل ما يجيني بالجريد خل هذا كذا : addEvent("add", true) addEventHandler("add", root, function( NK1, NKC1 ) if NK1 and NKC1 then local aSerial = getPlayerSerial ( source ) executeSQLQuery( "INSERT INTO aSave ( NK, NKC, Serial ) VALUES( ? , ? , ? )", NK1, NKC1, aSerial ) for _, v in ipairs ( getElementsByType ( 'player' ) ) do triggerEvent ( 'Refresh_' , v ) end end end ) addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK1 = ?", NK1 ) for _, v in ipairs ( getElementsByType ( 'player' ) ) do triggerEvent ( 'Refresh_' , v ) end end ) + ارسل اكواد الكلنت اذا المشكلة مانحلت معك Edited September 21, 2017 by iMr.WiFi..! Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 (edited) addEvent ( 'AddInGrid' , true ) addEventHandler ( 'AddInGrid' , root , function( Table ) guiGridListClear( grdnk ) for i, v in ipairs( Table ) do local Row = guiGridListAddRow( grdnk ) local plr = getPlayerFromName( source ) guiGridListSetItemText( grdnk, Row, 2, v.NK , false, false ) guiGridListSetItemText( grdnk, Row, 3, v.NKC , false, false ) guiGridListSetItemColor( grdnk, Row, 1, 0, 255, 255 ) guiGridListSetItemColor( grdnk, Row, 2, 0, 255, 255 ) guiGridListSetItemColor( grdnk, Row, 3, 0, 255, 255 ) end end ) addEventHandler("onClientGUIClick", root, function( ) if source == con then local NK1 , NKC1 = guiGetText( nkedit1 ) , guiGetText( nkedit2 ) if ( NK1 ~= '' and NK1 ~= ' ' and NKC1 ~= '' and NKC1 ~= ' ' and NK1 ~= 'إسم التاج ؟' and NKC1 ~= 'كود اللون ؟' ) then triggerServerEvent ( 'add' , localPlayer , NK1 , NKC1 ) else outputChatBox( " الرجاء كتابة تاج و كود لون ", 255, 0, 0, true ) end end end ) Edited September 21, 2017 by Source|> Link to comment
iMr.WiFi..! Posted September 21, 2017 Share Posted September 21, 2017 (edited) عدله لذا : addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK = ?", NK1 ) for _, v in ipairs ( getElementsByType ( 'player' ) ) do triggerEvent ( 'Refresh_' , v ) end end ) وقلي لو زبط ولا @_@ + اطرح الاخطاء الي تجيك بالديبق Edited September 21, 2017 by iMr.WiFi..! Link to comment
+Source|> Posted September 21, 2017 Author Share Posted September 21, 2017 1 minute ago, iMr.WiFi..! said: عدله لذا : addEvent("Done", true) addEventHandler("Done", root, function( NK1 ) executeSQLQuery ( "DELETE FROM aSave WHERE NK = ?", NK1 ) for _, v in ipairs ( getElementsByType ( 'player' ) ) do triggerEvent ( 'Refresh_' , v ) end end ) وقلي لو زبط ولا @_@ + اطرح الاخطاء الي تجيك بالديبق هذا حق مسح رو Link to comment
iMr.WiFi..! Posted September 21, 2017 Share Posted September 21, 2017 Just now, Source|> said: هذا حق مسح رو يب كان في خطأ عدله + 2 minutes ago, iMr.WiFi..! 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