executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aTable ( aSerial , aData )' )
addEventHandler( 'onPlayerQuit' , root ,
function ( )
local aData_ , aSerial_ = ( getElementData ( source , 'Launcher' ) or 0 ) , getPlayerSerial ( source )
local aSQL_ = executeSQLQuery( 'SELECT * FROM aTable WHERE aSerial = ?' , aSerial_ )
return ( ( ( #aSQL_ == 0 ) and executeSQLQuery( 'INSERT INTO aTable VALUES ( ? , ? )' , aSerial_ , aData_ ) ) or executeSQLQuery( 'UPDATE aTable SET Launcher = ? WHERE aSerial = ?' , aData_ , aSerial_ ) )
end )
addEventHandler( 'onPlayerLogin' , root ,
function ( )
local aSQL_ = executeSQLQuery( 'SELECT * FROM aTable WHERE aSerial = ? ' , getPlayerSerial ( source ) )
for Index in ipairs ( aSQL_ ) do
setElementData ( source , 'Launcher' , aSQL_ [ Index ] [ 'aData' ] )
end
end )
ماجربته لاني جوال شوف لو في خطء قلي