@iMr.WiFi..!
عندك اخطاء و كمان ماراح يظهر للكل
المهم انا سويته
كلينت :
aGridList_ , g = GUIEditor.gridlist[2] , guiGetText
guiSetFont( aGridList_ , 'default-bold-small' )
if ( Send ) then
addEventHandler ( 'onClientGUIClick' , Send ,
function ( )
local aText1 , aText2 , aCardType = g ( Edit1 ) , g ( memo ) , ( guiComboBoxGetItemText ( com , guiComboBoxGetSelected( com ) ) )
if ( aText1 and aText2 and aCardType ) then
triggerServerEvent ( 'aTrigger' , localPlayer , aText1 , aText2 , aCardType )
end
end , false )
end
addEventHandler ( 'onClientResourceStart' , resourceRoot ,
function ( )
setTimer ( triggerServerEvent , 50 , 1 , 'aHandler' , localPlayer )
end )
addEvent ( 'AddRows', true )
addEventHandler ( 'AddRows', root ,
function ( aValue )
for _ , v in ipairs ( aValue ) do
local aRow = guiGridListAddRow( aGridList_ )
guiGridListSetItemText( aGridList_ , aRow , 1, v['aText1'] , false , false )
guiGridListSetItemText( aGridList_ , aRow , 2, v['aCardType'] , false , false )
guiGridListSetItemText( aGridList_ , aRow , 3, v['aText2'] , false, false )
end
end )
addEvent ( 'AddRow' , true )
addEventHandler ( 'AddRow' , root ,
function ( _1 , _2 , _3 )
local aRow , aTable = guiGridListAddRow( aGridList_ ) , { _1 , _2 , _3 }
for Index = 1 , 3 do
guiGridListSetItemText( aGridList_ , aRow , Index , aTable[Index] , false , false )
end
end )
سيرفر
executeSQLQuery( 'CREATE TABLE IF NOT EXISTS aRentSystem_ ( aText1 , aCardType , aText2 )' )
addEvent('aHandler', true )
addEventHandler('aHandler' , getRootElement ( ) ,
function ( )
local aValue = executeSQLQuery( 'SELECT * FROM aRentSystem_' )
if ( aValue and #aValue > 0 ) then
triggerClientEvent ( source , 'AddRows' , source , aValue )
end
end )
addEvent( 'aTrigger' , true )
addEventHandler ( 'aTrigger' , root ,
function ( aText1_ , aCardType_ , aText2_ )
local _1 , _2 , _3 = aText1_ , aCardType_ , aText2_
executeSQLQuery('INSERT INTO aRentSystem_ ( aText1 , aCardType , aText2 ) VALUES( ? , ? , ? ) ' , aText1_ , aCardType_ , aText2_ )
triggerClientEvent ( root , 'AddRow' , root , _1 , _2 , _3 )
end )