Jump to content

تعديل


Adham

Recommended Posts

سلام عليكم

انا ابي اسوي

لما يحدد كومب بوكس ويكتب في ايديت ويكتب في ميمو

ويدوس علي " زر "

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

ويتحفظ

الكود م ظبت

ك

-- سرفر

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS `RentSystem` (text,CardType,Adham) ' )
addEvent('Handler', true )
addEventHandler('Handler' , getRootElement ( ) ,
function ( text, CardType, Adham )
    Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value ~= 0 ) then
            triggerClientEvent ( source , 'lol' , source , Value, text, CardType, Adham )
    end
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 ( "Handler", localPlayer, Text, Adham, CardType )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( table )
     guiGridListClear(GridList_)
            for i, v in ipairs (table) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].text,false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].CardType,false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].Adham,false,false)
          end
     end
)

 

Link to comment

-- سرفر

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS RentSystem(text TEXT,CardType TEXT,Adham TEXT) ' )
addEvent('Handler', true )
addEventHandler('Handler' , getRootElement ( ) ,
function ( text, CardType, Adham )
    if ( text ) or ( CardType) or (Adham) then
    executeSQLQuery("INSERT INTO RentSystem(text,CardType,Adham) VALUES(?,?,?)", toString(text), toString(CardType), toString(Adham) )
      end
    Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value ~= 0 ) then
            triggerClientEvent ( source , 'lol' , source , text, CardType, Adham )
    end
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 ( "Handler", localPlayer, Text, Adham, CardType )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( text,cardtype,adham )
     guiGridListClear(GridList_)
            for i, v in ipairs (table) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, toString(text),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, toString(cardtype),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, toString(adham),false,false)
          end
     end
)

بتوفيق : )

Link to comment
--- 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 )


--- Client Side

addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == Send ) then 
triggerServerEvent ( "Handler" , localPlayer , guiGetText ( Edit1 ) , guiGetText ( memo ) , guiComboBoxGetItemText(com,guiCheckBoxGetSelected(com)) );
end
end )

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

 

Link to comment

جرب ذذ : )

-- سرفر

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS RentSystem(text TEXT,CardType TEXT,Adham TEXT) ' )
addEvent('Handler', true )
addEventHandler('Handler' , root ,
function ( text, CardType, Adham )
    if ( text ) then
    executeSQLQuery("INSERT INTO RentSystem(text,CardType,Adham) VALUES(?,?,?)", text, CardType, Adham )
      end
    local Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value >= 0 ) and (type(Value) == "table" ) then
            triggerClientEvent ( source , 'lol' , source , text, CardType, Adham )
    end
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 ( "Handler", localPlayer, Text, CardType, Adham )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( text,cardtype,adham )
     guiGridListClear(GridList_)
            for i, v in ipairs (table) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(text),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(cardtype),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(adham),false,false)
          end
     end
)

 

Edited by iMr.WiFi..!
Link to comment

-- سرفر

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS RentSystem(oext TEXT,CardType TEXT,Adham TEXT) ' )
addEvent('Handler', true )
addEventHandler('Handler' , root ,
function ( oext, CardType, Adham )
    if ( oext ) then
    executeSQLQuery("INSERT INTO RentSystem(oext,CardType,Adham) VALUES(?,?,?)", oext, CardType, Adham )
      end
    local Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value >= 0 ) and (type(Value) == "table" ) then
            triggerClientEvent ( source , 'lol' , source , oext, CardType, Adham )
    end
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 ( "Handler", localPlayer, Text, CardType, Adham )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( text,cardtype,adham )
     guiGridListClear(GridList_)
            for i, v in ipairs (table) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(text),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(cardtype),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(adham),false,false)
          end
     end
)

 

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

-- سرفر

executeSQLQuery( ' CREATE TABLE IF NOT EXISTS RentSystem(oext TEXT,CardType TEXT,Adham TEXT) ' )
addEvent('Handler', true )
addEventHandler('Handler' , root ,
function ( oext, CardType, Adham )
    if ( oext ) then
    executeSQLQuery("INSERT INTO RentSystem(oext,CardType,Adham) VALUES(?,?,?)", oext, CardType, Adham )
      end
    local Value = executeSQLQuery( 'SELECT * FROM RentSystem' )
        if ( #Value >= 0 ) and (type(Value) == "table" ) then
            triggerClientEvent ( source , 'lol' , source , oext, CardType, Adham )
    end
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 ( "Handler", localPlayer, Text, CardType, Adham )
             end
    end
)
addEvent ( "lol", true )
addEventHandler ( "lol", root,
function ( text,cardtype,adham )
     guiGridListClear(GridList_)
            for i, v in ipairs (table) do
              local aRow = guiGridListAddRow( GUIEditor.gridlist[2] )
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(text),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(cardtype),false,false)
              guiGridListSetItemText(GUIEditor.gridlist[2],aRow, 1, table[i].tostring(adham),false,false)
          end
     end
)

 

 اصلن ماراح يزبط ولو افترضنا وجود تيبول

لما بترسل بتنضاف ومابتظهر لاي احد غير ال ارسله

Edited by #Soking
Link to comment
2 minutes ago, #Soking said:

اذن اكوادك غلط ووانت مو حاط كل الاكواد و محسسني انك 

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

وش تقول انت ؟

عطيت لك الدي بق فوق

Database query failed: table RentSysteam has no columns named text

Edited by Deativated
Link to comment

ماعليش اخوي الخطا كان مني .

شيل الكود حق onClientGUIClick

وبدله بهاذا

addEventHandler ( "onClientGUIClick" , root , function ( )
if ( source == Send ) then 
triggerServerEvent ( "Handler" , localPlayer , guiGetText ( Edit1 ) , guiGetText ( Memo ) , guiComboBoxGetItemText(ComBox ,guiComboBoxGetSelected(ComBox)) );
end
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...