Jump to content

x [ تعديل ]x : كود SQL,


Adham

Recommended Posts

سلأم عليكم 

انا الأن ابي اسوي

لين يخش السررفر , او يسوي login

اسمه يجي بالقريد لست وسريالو

ويتحفظ المهم م ظبت معي وقعدت اجرب مليون مره م ظبت ..
وم في دي بق

سرفر

executeSQLQuery( "CREATE TABLE IF NOT EXISTS Ha (name,Serial) " )

function ManagePlayrsSystem ( name,Serial,Date ) 
    local name = getPlayerName ( source ):gsub( "#%x%x%x%x%x%x", "" )
    local Serial = getPlayerSerial ( source )
        Send ( )
end
addEventHandler ( "onPlayerJoin", root,ManagePlayrsSystem )
addEventHandler ( "onPlayerLogin", root,ManagePlayrsSystem )


function Send ( )
    local SQLListe = executeSQLQuery ( "SELECT * FROM Ha " )
        if #SQLListe ~= 0 then
              triggerClientEvent ( "ManagePlayers:SaveName", root, SQLListe )
           end
     end
addEvent ( "RefreshSystem", true )
addEventHandler ( "RefreshSystem", root, Send )

كلنت

addEvent ( "ManagePlayers:SaveName", true )
addEventHandler ( "ManagePlayers:SaveName", root,
function ( Table )            
    guiGridListClear( GUIEditor.gridlist[1] )
         for i, _ in ipairs( Table ) do    
                 local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,Table[i].Name, false, false)
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 3,Table[i].Serial, false, false)
               end
        end
)

addEventHandler( 'onClientResourceStart', resourceRoot,
function(  )
    triggerServerEvent( 'RefreshSystem', localPlayer )
end )

 

Link to comment
1 minute ago, #_iMr.[E]coo said:

:crazy:

:smoker: ايش تتعاطى ؟

بكود الاس كيو ال " VALUES " 

ماني , فاهم عليك ؟

انا مب عارف اسويها بالسقل بالطريقه " هكذا "

انا اعرف اسويها لما يكتب بالايديت مثلا

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

ويتحفظ الاشياء

عن طريق

VALUES(???)

لاكن الطريقه دي حيرتني .

Link to comment
executeSQLQuery( "CREATE TABLE IF NOT EXISTS Ha (name,Serial) " )

function ManagePlayrsSystem ( ) 
    local name = getPlayerName ( source ):gsub( "#%x%x%x%x%x%x", "" )
    local Serial = getPlayerSerial ( source )
  local master = executeSQLQuery( ' SELECT * FROM Ha WHERE Serial=? ', Serial)
if ( type( master ) == "table" and #master == 0 ) or not master then
  iserttotable(name,Serial)
    end
end
addEventHandler ( "onPlayerJoin", root,ManagePlayrsSystem )
addEventHandler ( "onPlayerLogin", root,ManagePlayrsSystem )
function iserttotable(name,serial)
  executeSQLQuery("INSERT INTO Ha(name,Serial) VALUES(?,?)", name, serial)
          Send ( )

  end

function Send ( )
    local SQLListe = executeSQLQuery ( "SELECT * FROM Ha " )
        if #SQLListe ~= 0 then
              triggerClientEvent ( "ManagePlayers:SaveName", root, SQLListe )
           end
     end
addEvent ( "RefreshSystem", true )
addEventHandler ( "RefreshSystem", root, Send )

سيرفر

الكلنت

 

addEvent ( "ManagePlayers:SaveName", true )
addEventHandler ( "ManagePlayers:SaveName", root,
function ( Table )            
    guiGridListClear( GUIEditor.gridlist[1] )
         for i, _ in ipairs( Table ) do    
                 local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,Table[i].name, false, false)
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 3,Table[i].Serial, false, false)
               end
        end
)

addEventHandler( 'onClientResourceStart', resourceRoot,
function(  )
    triggerServerEvent( 'RefreshSystem', localPlayer )
end )

تمام

 

13 minutes ago, #BrosS said:

name و serial 

غير معرفين ومابحثت عنهم

ركز شوي وش تقول انت +_+

Link to comment
شف اخ مستر هكذا.

م ظبت


addEvent ( "ManagePlayers:SaveName", true )
addEventHandler ( "ManagePlayers:SaveName", root,
function ( Table )            
    guiGridListClear( GUIEditor.gridlist[1] )
         for i, _ in ipairs( Table ) do    
                 local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,Table[i].name, false, false)
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 2,Table[i].det, false, false)
                         guiGridListSetItemText( GUIEditor.gridlist[1], row, 3,Table[i].Serial, false, false)
               end
        end
)

addEventHandler( 'onClientResourceStart', resourceRoot,
function(  )
    triggerServerEvent( 'RefreshSystem', localPlayer )
end )

executeSQLQuery( "CREATE TABLE IF NOT EXISTS Ha (name,Serial,det) " )

function ManagePlayrsSystem ( ) 
    local name = getPlayerName ( source ):gsub( "#%x%x%x%x%x%x", "" )
    local Serial = getPlayerSerial ( source )
    local time = getRealTime(  )
    local hour = time.hour % 12 and time.hour % 12
    local det = ('[' .. hour .. ':' ..time.minute.. ':'.. time.second.. '] - ['.. time.monthday.. '/'.. time.month.. '/20'.. string.sub( time.year, 2 ) .. ']')
  local master = executeSQLQuery( ' SELECT * FROM Ha WHERE Serial=? ', Serial)
if ( type( master ) == "table" and #master == 0 ) or not master then
  iserttotable(name,Serial,det)
    end
end
addEventHandler ( "onPlayerJoin", root,ManagePlayrsSystem )
addEventHandler ( "onPlayerLogin", root,ManagePlayrsSystem )
function iserttotable(name,serial,det)
  executeSQLQuery("INSERT INTO Ha(name,Serial,det) VALUES(?,?,?)", name, serial,det)
          Send ( )

  end

function Send ( )
    local SQLListe = executeSQLQuery ( "SELECT * FROM Ha " )
        if #SQLListe ~= 0 then
              triggerClientEvent ( "ManagePlayers:SaveName", root, SQLListe )
           end
     end
addEvent ( "RefreshSystem", true )
addEventHandler ( "RefreshSystem", root, Send )

يقول لي باد ارقمنت في 

 guiGridListSetItemText( GUIEditor.gridlist[1], row, 2,Table[i].det, false, false)

 

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...