Jump to content

تعديل


Adham

Recommended Posts

-- # Client Side 

addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == Send ) then 
triggerServerEvent ( "Handler" , localPlayer , guiGetText ( Edit1 ) , guiGetText ( Memo ) , guiComboBoxGetItemText(ComBox ,guiComboBoxGetSelected(ComBox)) );
end
end )


addEvent ( "lol" , true )
addEventHandler ( "lol" , root , function ( Table )
guiGridListClear(GUIEditor.gridlist[3])
for i,v in ipairs ( Table ) do 
local row = guiGridListAddRow (GUIEditor.gridlist[3]);
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 1 , tostring ( v["text"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 2 , tostring ( v["CardType"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 3 , tostring ( v["Adham"] ) , false , false )
end
end );

--- # Server Side 

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

returnTable = function ( )
local sqlite = executeSQLQuery ( "SELECT * FROM RentSystem" );
if ( sqlite and type ( sqlite ) == "table" and #sqlite > 0 ) then 
return sqlite
end
end

addEvent("Handler", true )
addEventHandler("Handler" , getRootElement ( ) ,
function ( text, CardType, Adham )
if ( text and CardType and Adham ) then
executeSQLQuery ( "INSERT INTO RentSystem (text,CardType,Adham) VALUES (?,?,?)",text, CardType, Adham )
triggerClientEvent ( source , "lol" , source , returnTable ( ) )
end
end )

 

Link to comment

جرب الكود 

-- # Client Side 

addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == Send ) then 
triggerServerEvent ( "Handler" , localPlayer , guiGetText ( Edit1 ) , guiGetText ( Memo ) , guiComboBoxGetItemText(ComBox ,guiComboBoxGetSelected(ComBox)) );
end
end )


addEvent ( "lol" , true )
addEventHandler ( "lol" , root , function ( Table )
guiGridListClear(GUIEditor.gridlist[3])
for i,v in ipairs ( Table ) do 
local row = guiGridListAddRow (GUIEditor.gridlist[3]);
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 1 , tostring ( v["deafult"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 2 , tostring ( v["CardType"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 3 , tostring ( v["Adham"] ) , false , false )
end
end );

--- # Server Side 

executeSQLQuery( "CREATE TABLE IF NOT EXISTS `RentSystem` (deafult TEXT,CardType TEXT,Adham TEXT)" )

returnTable = function ( )
local sqlite = executeSQLQuery ( "SELECT * FROM RentSystem" );
if ( sqlite and type ( sqlite ) == "table" and #sqlite > 0 ) then 
return sqlite
end
end

addEvent("Handler", true )
addEventHandler("Handler" , getRootElement ( ) ,
function ( deafult, CardType, Adham )
if ( deafult and CardType and Adham ) then
executeSQLQuery ( "INSERT INTO RentSystem (deafult,CardType,Adham) VALUES (?,?,?)",deafult, CardType, Adham )
triggerClientEvent ( source , "lol" , source , returnTable ( ) )
end
end )

 

Link to comment
3 minutes ago, iMr.WiFi..! said:

@#Soking

بسيطة حق ال الف طلب : *

يسوي لما المستخدم يطلب

بعد ما يستقبل الترايقر

قبل لا يسوي Insert  : (

يتحقق من عدد الداتا زي كذا


local sqlite = executeSQLQuery ( "SELECT * FROM RentSystem" );
if #sqlite == 50 then
  -- يسوي قاعدة جديدة : )

 

خخخخخ

يقدر يرجع يضيف الكلام بدون مايفرغ القريد و يطرح السكل تاني

Link to comment

هكذا Soking ?

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `RentSystem` (text,CardType,Adham) ' )

addEvent ( "Handler", true )
addEventHandler ( "Handler", root,
function (  )
local Reaslut = executeSQLQuery( ' SELECT * FROM `RentSystem` ')
if ( type(Reaslut) == "table" and #Reaslut == 0 or notReaslut ) then 
triggerClientEvent ( source,"AddList", source )
end
end
)

-- Client
addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == Send ) then 
triggerServerEvent ( "Handler" , localPlayer , guiGetText ( Edit1 ) , guiGetText ( Memo ) , guiComboBoxGetItemText(ComBox ,guiCheckBoxGetSelected(ComBox)) );
end
end )

addEvent( 'AddList', true )
addEventHandler( 'AddList', root, 
function(Table)
guiGridListClear(GUIEditor.gridlist[3])
for i, v in ipairs ( Table ) do
local activatedONE = guiGridListAddRow(GUIEditor.gridlist[3])
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 1 , tostring ( v["text"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 2 , tostring ( v["CardType"] ) , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[3] , row , 3 , tostring ( v["Adham"] ) , false , false )
end
end );

 

Edited by Deativated
Link to comment
  1. مو متحكم في الرو ال تم اضافته انت جالس تتحكم في شي غير موجود سطر ٢٥ اسم الرو
  2. و جالس تتحكم في تيبل مو موجود
  3. الكلام ماراح يظهر غير ال ارسل
  4. خطء في سطر ٧

انا جوال

Link to comment
1 minute ago, #Soking said:
  1. مو متحكم في الرو ال تم اضافته انت جالس تتحكم في شي غير موجود سطر ٢٥ اسم الرو
  2. و جالس تتحكم في تيبل مو موجود
  3. الكلام ماراح يظهر غير ال ارسل
  4. خطء في سطر ٧

طيب تقدر تعدلهولي انت اذا فاضي

ابي اسوي

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

ويحدد كومب بوكس

ويكتب في الميمو

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

اول راو

الكتبو بالايديت

والتاني الكومب بوكس

والتالت الميمو

ويتحفظ

Edited by Deativated
Link to comment

executeSQLQuery("CREATE TABLE IF NOT EXISTS RentSystem (text TEXT,CardType TEXT,Adham TEXT)")
addEvent('Handler', true )
addEventHandler('Handler' , getRootElement ( ) ,
function (  )
    Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value ~= 0 ) then
            triggerClientEvent ( source , 'lol' , source ,Value )
    end
end )
addEvent('inserttotable',true)
addEvent('inserttotable',root,function(Text, Adham, CardType)
    executeSQLQuery("INSERT INTO RentSystem(text,CardType,Adham) VALUES(?,?,?)", Text, CardType, Adham )
    triggerEvent('Handler',root)
    end)

-- كلنت
addEventHandler ( "onClientGUIClick", root,
function (  ) 
           if ( source == Send ) then
                    local Text = guiGetText ( Edit1 )
                    local CardType = guiComboBoxGetItemText(com, guiComboBoxGetSelected(com))
                    local Adham = guiGetText ( memo )
                    if Text == "" or CardType == "" or Adham == "" then return end
                    triggerServerEvent ( "inserttotable", localPlayer, Text, Adham, CardType )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( sql )
     guiGridListClear(GUIEditor.gridlist[2])
            for i, v in ipairs (sql) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, sql[i].text,false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 2, sql[i].CardType,false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 3, sql[i].Adham,false,false)
          end
     end
)

غير مجرب اولا ثانيا تاكد من اسم الجريد لست

3 تاكد ان الجريد لست فيها 3 كولمن

لان لو ما فيها اكيد ما بيجي

بالتوفيق

بمجرد عمل طلب بيجي طبعا لو تبي تسوي من الكلنت تراقر بيكون كذا

triggerServerEvent(' Handler ',localPlayer)

+

طريقة انشاءك للتيبل غلط بالكليه

  1. executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `RentSystem` (text,CardType,Adham) ' )
Edited by Master_MTA
  • Like 1
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...