Jump to content

Help ..


Recommended Posts

السلأم عليكم ورحمه الله وبركاته اليوم سويت سقل

طريقه انشاء القاعده :

executeSQLQuery( "CREATE TABLE IF NOT EXISTS Systems (text,CardType,Adham)" )

وسويت يوم لما يضعط علي زر يسوي DROP

executeSQLQuery("DROP TABLE Systems" )

وم يتحذف شي 

الدي بق :

Database query failed: no such table:Systems

Link to comment

شف اخ مستر مسوي

لما يكتب في 3 ايديت

يجي بالقريد لست الكتبو بالايديت

ويتحفظ

محاولتي :

triggerServerEvent ( "Save", localPlayer )
addEventHandler ( "onClientGUIClick", root,
function ( )
       if ( source == Button ) then
	             local Text = guiGetText ( edit1 )
				 local Tezt2 = guiGetText ( edit2 )
				 local Text3 = guiGetText ( edit3 )
				 if Text == "" or Tezt2 == "" or Text3 == "" then return end
				 triggerServerEvent ( "onSend", localPlayer,Text,Tezt2,Text3 )
			end
		end
)


addEvent ( "Accept", true )
addEventHandler ( "Accept", root,
function ( theList )
   guiGridListClear(GUIEditor.gridlist[4])
          for i, R in pairs(theList) do
		    guiGridListSetItemText(GUIEditor.gridlist[4], row, 1, R["Text"], false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 2, R["Tezt2"], false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 3, R["Text3"], false, false)
		end
	end
)

-- Server
addEventHandler ("onResourceStart", resourceRoot,
	function () 
		executeSQLQuery ("CREATE TABLE IF NOT EXISTS `ModsSystem` (Text,Tezt2,Text3)")
	end
) 
addEvent ( "Save", true )
addEventHandler ( "Save", root,
	function ( )
		local result = executeSQLQuery ( "SELECT * FROM `ModsSystem` " )
			if ( type ( result ) == "table" and #result == 0 ) or not result then
				triggerClientEvent ( client, "Accept", client, result )
		end
	end
)

addEvent ( "onSend", true )
addEventHandler ( "onSend", root,
	function ( Text,Tezt2,Text3 )
		executeSQLQuery("INSERT INTO `ModsSystem` ( Text,Tezt2,Text3  ) VALUES ( ?, ?, ? )", tostring ( Text ), tostring ( Tezt2 ), tostring ( Text2 ) )
	end
)

ملحوظه: التريقر الأول في كود فتح الوحة

Edited by Deativated
Link to comment
riggerServerEvent ( "Save", localPlayer )
addEventHandler ( "onClientGUIClick", root,
function ( )
       if ( source == Button ) then
	             local Text = guiGetText ( edit1 )
				 local Tezt2 = guiGetText ( edit2 )
				 local Text3 = guiGetText ( edit3 )
				 if Text == "" or Tezt2 == "" or Text3 == "" then return end
				 triggerServerEvent ( "onSend", localPlayer,Text,Tezt2,Text3 )
			end
		end
)


addEvent ( "Accept", true )
addEventHandler ( "Accept", root,
function (text1,text2,text3)
		  row = guiGridListAddRow(GUIEditor.gridlist[4])
		    guiGridListSetItemText(GUIEditor.gridlist[4], row, 1,text1, false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 2,text2, false, false)
			guiGridListSetItemText(GUIEditor.gridlist[4], row, 3,text3, false, false)
		end
	)


-- Server
		executeSQLQuery ("CREATE TABLE IF NOT EXISTS `ModsSystem` (Text,Tezt2,Text3)")
 
addEvent ( "Save", true )
addEventHandler ( "Save", root,
	function ( )
		local result = executeSQLQuery ( "SELECT * FROM `ModsSystem` " )
			if ( type ( result ) == "table" and #result == 0 ) or not result then
		local 	text1 = result[1]["Text"]
		local 	text2 = result[1]["Tezt2"]
		local 	text3 = result[1]["Text3"]
triggerClientEvent (source, "Accept", source, text1,text2,text3 )
		end
	end
)

addEvent ( "onSend", true )
addEventHandler ( "onSend", root,
	function ( Text,Tezt2,Text3 )
		executeSQLQuery("INSERT INTO `ModsSystem` ( Text,Tezt2,Text3  ) VALUES ( ?, ?, ? )",Text,Tezt2,Text3)
	end
)

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...