Jump to content

طلب مساعده


3DNAN_!

Recommended Posts

السلام عليكم

كيف أحوالكم

 

الحين بطرح عليكم أكواد هيا مو لي ذي الأكواد بس أبي اتعلم منها واغير فكرتها شويه صغننين

 

المود عباره عن لوحه وجريد لست واديت بوكس و3 ازار

 

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

 

والزر الاخر لو حددت النص ودوسته ينمسح

 

والتالت هو لما احدد النص واضغطه ينسخ النص

 

الحين اللي أبي اعرفه هل الأكواد اللتي سوف اقوم بطرحها تجعل النص الذي ادخله يظهر للجميع ولا يظهر للشخص الذي قام بإدخال النص ده اول طلب

 

تاني طلب صاحب المود مصمم الجريد لست وحاطط عمودين واحده #

والتانيه النص

 

تحت # يظهر رقم

 

وتحت التكست يظهر النص المدخل

 

انا ابي اشيل # واشيل الرقم اللي يظهر اسفلها بحيث تبقا الجريد لست مكونه من النص فقط اللي ادخلته

 

ذا الكود

كود اللوحه ذات نفسها التصميم

----------------------------------

 

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    edit = {}
}
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 479) / 2, (screenH - 353) / 2, 479, 353, "# [ حفظ الكتابات | Save Text's / By ; MR.StoRm ] #", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible ( GUIEditor.window[1] , false )
GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 460, 225, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.5)
guiGridListAddColumn(GUIEditor.gridlist[1], "#YourMessage..!", 5)
GUIEditor.button[1] = guiCreateButton(10, 292, 143, 29, "# [ Copy Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "default-bold-small")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFF4AF08")
GUIEditor.button[2] = guiCreateButton(169, 292, 143, 29, "# [ Select The Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[2], "default-bold-small")
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF29FE00")
GUIEditor.button[3] = guiCreateButton(327, 292, 142, 29, "# [ Delete The Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[3], "default-bold-small")
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFD0000")
GUIEditor.edit[1] = guiCreateEdit(9, 255, 460, 26, "", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(413, 326, 56, 17, "Close", false, GUIEditor.window[1])

 

 

Client

----------

addEvent ( 'aGridSetSelected' , true )
addEventHandler ( 'aGridSetSelected' , root ,
function (Table)
guiGridListClear ( GUIEditor.gridlist[1] )
for i , v in ipairs (Table) do
local aRow_ = guiGridListAddRow ( GUIEditor.gridlist[1])
guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 2 , v [ 'aEdit' ] , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 1 , i .. '-' , false , false )
guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 2 , math.random(0,255),math.random(0,255),math.random(0,255) )
guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 1 , math.random(0,255),math.random(0,255),math.random(0,255) )
end
end )

addEventHandler ( 'onClientGUIClick', root, function (    )
if ( source == GUIEditor.button[4] ) then
    playSoundFrontEnd ( 30 )
        guiSetVisible ( GUIEditor.window[1] , false )
            showCursor ( false )
                guiSetInputEnabled ( false )
                    elseif ( source == GUIEditor.button[2] ) then
                        local aEdit = guiGetText ( GUIEditor.edit[1] )
                            if ( aEdit ~= '' and aEdit ~= ' ' ) then
                                triggerServerEvent ( 'SelectText' , localPlayer , aEdit )
                                outputChatBox ( '* [ TextSystem ] #FFFFFF: #60ff60You Have Been Successfully Select Text #c0c0c0[ #ff0000'..aEdit..' #c0c0c0] #ff0000! ' , 255 , 0 , 0 , true )
                                outputChatBox ( '* [ TextSystem ] #FFFFFF: #00ffffThe Text Will Be Saved By #20c0ffSQL #ff0000!' , 255 , 0 , 0 , true )
                                guiSetEnabled ( GUIEditor.button[2], false )
                                setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
                            else
                                outputChatBox ( '* [ TextSystem ] : You Must Write The Text !' , 255 , 0 , 0 )
                            playSoundFrontEnd ( 30 )
                        guiSetEnabled ( GUIEditor.button[2], false )
                            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
                        end
                            elseif ( source == GUIEditor.button[1] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                        if ( sel ~= -1 ) then
                    local aText = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                        setClipboard ( '* The Text : '..aText..'' )
                            outputChatBox ( '* [ TextSystem ] : #60ff60You Are Successfully Copy The Text #00ffff[ #ff6020'..aText..'#00ffff ] #ff0000!' , 255 , 0 , 0 , true )
                            playSoundFrontEnd ( 30 )
                                guiSetEnabled ( GUIEditor.button[1], false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                                    else
                                    outputChatBox ( '* [ TextSystem ] : You Must Select a Text To Copy it !' , 255 , 0 , 0 , true )    
                            playSoundFrontEnd ( 30 )
                                guiSetEnabled ( GUIEditor.button[1], false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )                                    
                        end
                            elseif ( source == GUIEditor.button[3] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                                    if ( sel ~= -1 ) then
                                        local aDelete = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                                            triggerServerEvent ( 'DeleteText' , localPlayer , aDelete, localPlayer )
                                guiGridListClear ( GUIEditor.gridlist[1] )
                    playSoundFrontEnd ( 30 )
                guiSetEnabled ( GUIEditor.button[3], false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3], true )
        else
            outputChatBox ( '* [ TextSystem ] : You Must Select a Text To Delete it !' , 255 , 0 , 0 , true )
            playSoundFrontEnd ( 30 )
            guiSetEnabled ( GUIEditor.button[3], false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3], true )
        end
    end
end )

 

 

server

---------

addEventHandler ( 'onResourceStart', resourceRoot, function (    )
    executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aText_ ( aEdit, Serial ) ' )
end )

addEvent ( 'SelectText' , true )
addEventHandler ( 'SelectText', root, function (aEdit)
local aSerial = getPlayerSerial ( source )
if aEdit then
executeSQLQuery("INSERT INTO aText_ ( aEdit, Serial ) VALUES( ? , ? )", aEdit, aSerial )
triggerEvent ( 'aRefresh_' , source )
end
end )
addEvent ( 'aRefresh_' , true )
addEventHandler ( 'aRefresh_' , root ,
function ()
local aSQL_ = executeSQLQuery ( 'SELECT * FROM aText_ WHERE Serial=?' , getPlayerSerial ( source ) )
if #aSQL_ ~= 0 then
triggerClientEvent ( source, 'aGridSetSelected' , source , aSQL_ )
end
end )

addEvent ( 'DeleteText' , true )
addEventHandler ( 'DeleteText', root, function ( aEdit, plr )
executeSQLQuery ( 'DELETE FROM aText_ WHERE aEdit = ?' , aEdit )                    
triggerEvent ( 'aRefresh_' , source )
outputChatBox ( '* [ TextSystem ] #ffffff: #60ff60You Have Been Successfully Delete Text #c0c0c0[ #ffff00'..aEdit..' #c0c0c0] #ff0000! ', plr , 255 , 0 , 0 , true )
end )

 

 

 

لو الأكواد تظهر النص اللي انا دخلته للجميع اذا تمام ما في مشكلة لاكن لو ما تظهر للجميع ابي تعدلون الكود انه يظهر للجميع النص

 

وتاني شئ أبي تشيلون # وابي يظهر بالجريد لست النص عالطول من غير اي شئ

 

وأبي كود لما اضغط علي زر تحقق اذا كان الرتبه اللي ضغطت كونسل او لا لو كونسل يفتح لها اللوحه لو مو كونسل ما يفتح لها

 

 

Edited by 3DNAN_!
Link to comment
21 hours ago, 3DNAN_! said:

السلام عليكم

كيف أحوالكم

 

الحين بطرح عليكم أكواد هيا مو لي ذي الأكواد بس أبي اتعلم منها واغير فكرتها شويه صغننين

 

المود عباره عن لوحه وجريد لست واديت بوكس و3 ازار

 

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

 

والزر الاخر لو حددت النص ودوسته ينمسح

 

والتالت هو لما احدد النص واضغطه ينسخ النص

 

الحين اللي أبي اعرفه هل الأكواد اللتي سوف اقوم بطرحها تجعل النص الذي ادخله يظهر للجميع ولا يظهر للشخص الذي قام بإدخال النص ده اول طلب

 

تاني طلب صاحب المود مصمم الجريد لست وحاطط عمودين واحده #

والتانيه النص

 

تحت # يظهر رقم

 

وتحت التكست يظهر النص المدخل

 

انا ابي اشيل # واشيل الرقم اللي يظهر اسفلها بحيث تبقا الجريد لست مكونه من النص فقط اللي ادخلته

 

ذا الكود

كود اللوحه ذات نفسها التصميم

----------------------------------

 

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    edit = {}
}
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 479) / 2, (screenH - 353) / 2, 479, 353, "# [ حفظ الكتابات | Save Text's / By ; MR.StoRm ] #", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetVisible ( GUIEditor.window[1] , false )
GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 460, 225, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.5)
guiGridListAddColumn(GUIEditor.gridlist[1], "#YourMessage..!", 5)
GUIEditor.button[1] = guiCreateButton(10, 292, 143, 29, "# [ Copy Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[1], "default-bold-small")
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFF4AF08")
GUIEditor.button[2] = guiCreateButton(169, 292, 143, 29, "# [ Select The Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[2], "default-bold-small")
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF29FE00")
GUIEditor.button[3] = guiCreateButton(327, 292, 142, 29, "# [ Delete The Text ] !", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[3], "default-bold-small")
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFD0000")
GUIEditor.edit[1] = guiCreateEdit(9, 255, 460, 26, "", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(413, 326, 56, 17, "Close", false, GUIEditor.window[1])

 

 

Client

----------

addEvent ( 'aGridSetSelected' , true )
addEventHandler ( 'aGridSetSelected' , root ,
function (Table)
guiGridListClear ( GUIEditor.gridlist[1] )
for i , v in ipairs (Table) do
local aRow_ = guiGridListAddRow ( GUIEditor.gridlist[1])
guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 2 , v [ 'aEdit' ] , false , false )
guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 1 , i .. '-' , false , false )
guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 2 , math.random(0,255),math.random(0,255),math.random(0,255) )
guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 1 , math.random(0,255),math.random(0,255),math.random(0,255) )
end
end )

addEventHandler ( 'onClientGUIClick', root, function (    )
if ( source == GUIEditor.button[4] ) then
    playSoundFrontEnd ( 30 )
        guiSetVisible ( GUIEditor.window[1] , false )
            showCursor ( false )
                guiSetInputEnabled ( false )
                    elseif ( source == GUIEditor.button[2] ) then
                        local aEdit = guiGetText ( GUIEditor.edit[1] )
                            if ( aEdit ~= '' and aEdit ~= ' ' ) then
                                triggerServerEvent ( 'SelectText' , localPlayer , aEdit )
                                outputChatBox ( '* [ TextSystem ] #FFFFFF: #60ff60You Have Been Successfully Select Text #c0c0c0[ #ff0000'..aEdit..' #c0c0c0] #ff0000! ' , 255 , 0 , 0 , true )
                                outputChatBox ( '* [ TextSystem ] #FFFFFF: #00ffffThe Text Will Be Saved By #20c0ffSQL #ff0000!' , 255 , 0 , 0 , true )
                                guiSetEnabled ( GUIEditor.button[2], false )
                                setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
                            else
                                outputChatBox ( '* [ TextSystem ] : You Must Write The Text !' , 255 , 0 , 0 )
                            playSoundFrontEnd ( 30 )
                        guiSetEnabled ( GUIEditor.button[2], false )
                            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
                        end
                            elseif ( source == GUIEditor.button[1] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                        if ( sel ~= -1 ) then
                    local aText = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                        setClipboard ( '* The Text : '..aText..'' )
                            outputChatBox ( '* [ TextSystem ] : #60ff60You Are Successfully Copy The Text #00ffff[ #ff6020'..aText..'#00ffff ] #ff0000!' , 255 , 0 , 0 , true )
                            playSoundFrontEnd ( 30 )
                                guiSetEnabled ( GUIEditor.button[1], false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                                    else
                                    outputChatBox ( '* [ TextSystem ] : You Must Select a Text To Copy it !' , 255 , 0 , 0 , true )    
                            playSoundFrontEnd ( 30 )
                                guiSetEnabled ( GUIEditor.button[1], false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )                                    
                        end
                            elseif ( source == GUIEditor.button[3] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                                    if ( sel ~= -1 ) then
                                        local aDelete = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                                            triggerServerEvent ( 'DeleteText' , localPlayer , aDelete, localPlayer )
                                guiGridListClear ( GUIEditor.gridlist[1] )
                    playSoundFrontEnd ( 30 )
                guiSetEnabled ( GUIEditor.button[3], false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3], true )
        else
            outputChatBox ( '* [ TextSystem ] : You Must Select a Text To Delete it !' , 255 , 0 , 0 , true )
            playSoundFrontEnd ( 30 )
            guiSetEnabled ( GUIEditor.button[3], false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3], true )
        end
    end
end )

 

 

server

---------

addEventHandler ( 'onResourceStart', resourceRoot, function (    )
    executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aText_ ( aEdit, Serial ) ' )
end )

addEvent ( 'SelectText' , true )
addEventHandler ( 'SelectText', root, function (aEdit)
local aSerial = getPlayerSerial ( source )
if aEdit then
executeSQLQuery("INSERT INTO aText_ ( aEdit, Serial ) VALUES( ? , ? )", aEdit, aSerial )
triggerEvent ( 'aRefresh_' , source )
end
end )
addEvent ( 'aRefresh_' , true )
addEventHandler ( 'aRefresh_' , root ,
function ()
local aSQL_ = executeSQLQuery ( 'SELECT * FROM aText_ WHERE Serial=?' , getPlayerSerial ( source ) )
if #aSQL_ ~= 0 then
triggerClientEvent ( source, 'aGridSetSelected' , source , aSQL_ )
end
end )

addEvent ( 'DeleteText' , true )
addEventHandler ( 'DeleteText', root, function ( aEdit, plr )
executeSQLQuery ( 'DELETE FROM aText_ WHERE aEdit = ?' , aEdit )                    
triggerEvent ( 'aRefresh_' , source )
outputChatBox ( '* [ TextSystem ] #ffffff: #60ff60You Have Been Successfully Delete Text #c0c0c0[ #ffff00'..aEdit..' #c0c0c0] #ff0000! ', plr , 255 , 0 , 0 , true )
end )

 

 

 

لو الأكواد تظهر النص اللي انا دخلته للجميع اذا تمام ما في مشكلة لاكن لو ما تظهر للجميع ابي تعدلون الكود انه يظهر للجميع النص

 

وتاني شئ أبي تشيلون # وابي يظهر بالجريد لست النص عالطول من غير اي شئ

 

وأبي كود لما اضغط علي زر تحقق اذا كان الرتبه اللي ضغطت كونسل او لا لو كونسل يفتح لها اللوحه لو مو كونسل ما يفتح لها

 

 

@MR.StoRm

Link to comment

عليكم السلام ,
الطلب الأول أو السؤال الأول : تظهر لك فقط , (تظهر فقط للذي قام بكتابة النص وليس للجميع) ذ ,
الطلب التاني : 
ببساطة تشيل ذا :
 

3 hours ago, #Himoo said:

guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.5)

+

3 hours ago, #Himoo said:

guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 1 , i .. '-' , false , false )

+

3 hours ago, #Himoo said:

guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 1 , math.random(0,255),math.random(0,255),math.random(0,255) )

 

Link to comment
18 minutes ago, 3DNAN_! said:

طيب عايز تعديل علي الكود عشان يبقا للكل يعني لما اكتب نص واحفظه يظهر للجميع مش ليا انا بس

أها , 
خلي ملف سيرفر كذا : 
 

addEventHandler ( 'onResourceStart', resourceRoot, function (    )
    executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aText_ ( aEdit ) ' )
end )

addEvent ( 'SelectText' , true )
addEventHandler ( 'SelectText', root, function (aEdit)
if aEdit then
executeSQLQuery("INSERT INTO aText_ ( aEdit ) VALUES( ? )", aEdit )
triggerEvent ( 'aRefresh_' , source )
end
end )
addEvent ( 'aRefresh_' , true )
addEventHandler ( 'aRefresh_' , root ,
function ()
local aSQL_ = executeSQLQuery ( 'SELECT * FROM aText_')
if #aSQL_ ~= 0 then
triggerClientEvent ( source, 'aGridSetSelected' , source , aSQL_ )
end
end )

addEvent ( 'DeleteText' , true )
addEventHandler ( 'DeleteText', root, function ( aEdit, plr )
executeSQLQuery ( 'DELETE FROM aText_ WHERE aEdit = ?' , aEdit )                    
triggerEvent ( 'aRefresh_' , source )
outputChatBox ( '* [ TextSystem ] #ffffff: #60ff60You Have Been Successfully Delete Text #c0c0c0[ #ffff00'..aEdit..' #c0c0c0] #ff0000! ', plr , 255 , 0 , 0 , true )
end )


 

Link to comment

لما عدلت الكود عمل أخطاء في النسخ والمسح

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

client

-----------

 

GUIEditor = {
    gridlist = {},
    window = {},
    button = {},
    edit = {}
}
        GUIEditor.window[1] = guiCreateWindow(197, 136, 619, 387, "[ Test mod ]", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 0.88)
        guiSetVisible(GUIEditor.window[1],false)
        GUIEditor.gridlist[1] = guiCreateGridList(9, 27, 600, 279, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9)
        GUIEditor.edit[1] = guiCreateEdit(12, 312, 323, 26, "", false, GUIEditor.window[1])
        GUIEditor.button[1] = guiCreateButton(339, 312, 96, 26, "Add", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "default-bold-small")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFBA603")
        GUIEditor.button[2] = guiCreateButton(440, 312, 96, 26, "Delete", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "default-bold-small")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFD0000")
        GUIEditor.button[3] = guiCreateButton(541, 312, 64, 26, "Copy", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[3], "default-bold-small")
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF13E91D")
        GUIEditor.button[4] = guiCreateButton(140, 346, 334, 29, "Close Panel", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[4], "default-bold-small")
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFF6E205")
        
        

 

addEvent ( 'aGridSetSelected' , true )
addEventHandler ( 'aGridSetSelected' , root ,
function (Table)
guiGridListClear ( GUIEditor.gridlist[1] )
for i , v in ipairs (Table) do
local aRow_ = guiGridListAddRow ( GUIEditor.gridlist[1])
guiGridListSetItemText ( GUIEditor.gridlist[1] , aRow_ , 1 , v [ 'aEdit' ] , false , false )
guiGridListSetItemColor ( GUIEditor.gridlist[1] , aRow_ , 1 , math.random(0,255),math.random(0,255),math.random(0,255) )
end
end )

addEventHandler ( 'onClientGUIClick', root, function (    )
if ( source == GUIEditor.button[4] ) then
        guiSetVisible ( GUIEditor.window[1] , false )
            showCursor ( false )
                guiSetInputEnabled ( false )
                    elseif ( source == GUIEditor.button[1] ) then
                        local aEdit = guiGetText ( GUIEditor.edit[1] )
                            if ( aEdit ~= '' and aEdit ~= ' ' ) then
                                triggerServerEvent ( 'SelectText' , localPlayer , aEdit )
                                outputChatBox ( '* [ System ] #FFFFFF: #60ff60You Have Been Successfully Select Text #c0c0c0[ #ff0000'..aEdit..' #c0c0c0] #ff0000! ' , 255 , 0 , 0 , true )
                                guiSetEnabled ( GUIEditor.button[1], false )
                                setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                            else
                                outputChatBox ( '* [ System ] : You Must Write The Text !' , 255 , 0 , 0 )
                        guiSetEnabled ( GUIEditor.button[1], false )
                            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                        end
                            elseif ( source == GUIEditor.button[3] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                        if ( sel ~= -1 ) then
                    local aText = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                        setClipboard ( '* The Text : '..aText..'' )
                            outputChatBox ( '* [ System ] : #60ff60You Are Successfully Copy The Text #00ffff[ #ff6020'..aText..'#00ffff ] #ff0000!' , 255 , 0 , 0 , true )
                                guiSetEnabled ( GUIEditor.button[3] , false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3] , true )
                                    else
                                    outputChatBox ( '* [ System ] : You Must Select a Text To Copy it !' , 255 , 0 , 0 , true )    
                                guiSetEnabled ( GUIEditor.button[3], false )
                                    setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3] , true )                                    
                        end
                            elseif ( source == GUIEditor.button[2] ) then
                                local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                                    if ( sel ~= -1 ) then
                                        local aDelete = guiGridListGetItemText ( GUIEditor.gridlist[1], sel, 2 )
                                            triggerServerEvent ( 'DeleteText' , localPlayer , aDelete, localPlayer )
                                guiGridListClear ( GUIEditor.gridlist[1] )
                guiSetEnabled ( GUIEditor.button[2] , false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
        else
            outputChatBox ( '* [ System ] : You Must Select a Text To Delete it !' , 255 , 0 , 0 , true )
            guiSetEnabled ( GUIEditor.button[2] , false )
            setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2] , true )
        end
    end
end )

 

 

 

 

server

-----------

 

addEventHandler ( 'onResourceStart', resourceRoot, function (    )
    executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aText_ ( aEdit ) ' )
end )

addEvent ( 'SelectText' , true )
addEventHandler ( 'SelectText', root, function (aEdit)
if aEdit then
executeSQLQuery("INSERT INTO aText_ ( aEdit ) VALUES( ? )", aEdit )
triggerEvent ( 'aRefresh_' , root )
end
end )
addEvent ( 'aRefresh_' , true )
addEventHandler ( 'aRefresh_' , root ,
function ()
local aSQL_ = executeSQLQuery ( 'SELECT * FROM aText_')
if #aSQL_ ~= 0 then
triggerClientEvent ( root, 'aGridSetSelected' , root , aSQL_ )
end
end )

addEvent ( 'DeleteText' , true )
addEventHandler ( 'DeleteText', root, function ( aEdit, plr )
executeSQLQuery ( 'DELETE FROM aText_ WHERE aEdit = ?' , aEdit )                    
triggerEvent ( 'aRefresh_' , root )
outputChatBox ( '* [ System ] #ffffff: #60ff60You Have Been Successfully Delete Text #c0c0c0[ #ffff00'..aEdit..' #c0c0c0] #ff0000! ', plr , 255 , 0 , 0 , true )
end )

 

 

 

Link to comment
GUIEditor.gridlist[1] = guiCreateGridList(9, 27, 600, 279, false, GUIEditor.window[1])
     column    =  guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9)

addEventHandler ( 'onClientGUIClick', root, function (    )
 if ( source == GUIEditor.button[4] ) then
         guiSetVisible ( GUIEditor.window[1] , false )
             showCursor ( false )
                 guiSetInputEnabled ( false )
                     elseif ( source == GUIEditor.button[1] ) then
                         local aEdit = guiGetText ( GUIEditor.edit[1] )
                             if ( aEdit ~= '' and aEdit ~= ' ' ) then
                                 triggerServerEvent ( 'SelectText' , localPlayer , aEdit )
                                 outputChatBox ( '* [ System ] #FFFFFF: #60ff60You Have Been Successfully Select Text #c0c0c0[ #ff0000'..aEdit..' #c0c0c0] #ff0000! ' , 255 , 0 , 0 , true )
                                 guiSetEnabled ( GUIEditor.button[1], false )
                                 setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                             else
                                 outputChatBox ( '* [ System ] : You Must Write The Text !' , 255 , 0 , 0 )
                         guiSetEnabled ( GUIEditor.button[1], false )
                             setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[1], true )
                         end
                             elseif ( source == GUIEditor.button[3] ) then
                                 local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                         if ( sel ~= -1 ) then
                     local aText = guiGridListGetItemText ( GUIEditor.gridlist[1], sel,column)
                         setClipboard ( '* The Text : '..aText..'' )
                             outputChatBox ( '* [ System ] : #60ff60You Are Successfully Copy The Text #00ffff[ #ff6020'..aText..'#00ffff ] #ff0000!' , 255 , 0 , 0 , true )
                                 guiSetEnabled ( GUIEditor.button[3] , false )
                                     setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3] , true )
                                     else
                                     outputChatBox ( '* [ System ] : You Must Select a Text To Copy it !' , 255 , 0 , 0 , true )    
                                 guiSetEnabled ( GUIEditor.button[3], false )
                                     setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[3] , true )                                    
                         end
                             elseif ( source == GUIEditor.button[2] ) then
                                 local sel = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )
                                     if ( sel ~= -1 ) then
                                         local aDelete = guiGridListGetItemText ( GUIEditor.gridlist[1], sel,column)
                                             triggerServerEvent ( 'DeleteText' , localPlayer , aDelete, localPlayer )
                                 guiGridListClear ( GUIEditor.gridlist[1] )
                 guiSetEnabled ( GUIEditor.button[2] , false )
             setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2], true )
         else
             outputChatBox ( '* [ System ] : You Must Select a Text To Delete it !' , 255 , 0 , 0 , true )
             guiSetEnabled ( GUIEditor.button[2] , false )
             setTimer ( guiSetEnabled, 6000 , 1, GUIEditor.button[2] , true )
         end
     end
 end ) 

 

Link to comment

جربت الكود بتاعك

 

ظهر مشكله في الكود بتاع السيرفر السطر ال 16

 

addEventHandler ( 'onResourceStart', resourceRoot, function (    )
    executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aText_ ( aEdit, Serial ) ' )
end )

addEvent ( 'SelectText' , true )
addEventHandler ( 'SelectText', root, function (aEdit)
local aSerial = getPlayerSerial ( root )
if aEdit then
executeSQLQuery("INSERT INTO aText_ ( aEdit, Serial ) VALUES( ? , ? )", aEdit, aSerial )
triggerEvent ( 'aRefresh_' , root )
end
end )
addEvent ( 'aRefresh_' , true )
addEventHandler ( 'aRefresh_' , root ,
function ()
::هنا المشكلة::local aSQL_ = executeSQLQuery ( 'SELECT * FROM aText_ WHERE Serial=?' , getPlayerSerial ( root ) )
if #aSQL_ ~= 0 then
triggerClientEvent ( root, 'aGridSetSelected' , root , aSQL_ )
end
end )

addEvent ( 'DeleteText' , true )
addEventHandler ( 'DeleteText', root, function ( aEdit, plr )
executeSQLQuery ( 'DELETE FROM aText_ WHERE aEdit = ?' , aEdit )                    
triggerEvent ( 'aRefresh_' , root )
outputChatBox ( '* [ TextSystem ] #ffffff: #60ff60You Have Been Successfully Delete Text #c0c0c0[ #ffff00'..aEdit..' #c0c0c0] #ff0000! ', plr , 255 , 0 , 0 , true )
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...