Jump to content

[ HELP ]


Recommended Posts

انا مسوي ليبل

ومسوي لو كتبت كلام في الإيديت بوكس يجي في الليبل

ومسوي الكلام ينحفظ بالسكل

بس المشكله انو الكلام يظهر للكل

ابيه يضهر للشخص اللي كتب الكلام بس

 

--server
addEvent("addM", true)
addEventHandler("addM", root,
	function( Medit )
	local MSG = Medit
		executeSQLQuery( "INSERT INTO MSGSYS ( MSG ) VALUES( ? )", MSG )
		triggerEvent ( 'Refresh' , source )
	end
)

addEvent ( 'Refresh' , true )
addEventHandler ( 'Refresh' , root , 
	function ()
	local aSQL2c = executeSQLQuery ( 'SELECT * FROM MSGSYS' )
		if ( #aSQL2c ~= 0 ) then 
			triggerClientEvent ( source, 'AddMsg' , source , aSQL2c )
		end 
	end 
)



--client
addEvent ( 'AddMsg' , true )
addEventHandler ( 'AddMsg' , root ,
	function( Table )
		for i, v in ipairs( Table ) do
			guiSetText( LblMN, v.MSG )
		end
	end
)

 

Link to comment

استبدل السيرفر كذا وشوف

addEvent("addM", true)
addEventHandler("addM", root,
	function( Medit )
		local MSG = Medit
		if ( MSG ) then
			local aSQL2c = executeSQLQuery ( 'SELECT * FROM MSGSYS WHERE playerSerial=?', getPlayerSerial ( source ) )
			if ( #aSQL2c == 0 ) then
				executeSQLQuery( "INSERT INTO MSGSYS ( MSG ) VALUES( ? )", MSG )
			else
				executeSQLQuery("UPDATE MSGSYS SET MSG=? WHERE playerSerial=?", MSG, getPlayerSerial ( source ) )
			end
			triggerEvent ( 'Refresh' , source )
		end
	end
)

addEvent ( 'Refresh' , true )
addEventHandler ( 'Refresh' , root , 
	function ()
	local aSQL2c = executeSQLQuery ( 'SELECT * FROM MSGSYS WHERE playerSerial=?', getPlayerSerial ( source ) )
		if ( #aSQL2c ~= 0 ) then 
			triggerClientEvent ( source, 'AddMsg' , source , aSQL2c )
		end 
	end 
)

 

  • Thanks 1
Link to comment
13 hours ago, N3xT said:

استبدل السيرفر كذا وشوف


addEvent("addM", true)
addEventHandler("addM", root,
	function( Medit )
		local MSG = Medit
		if ( MSG ) then
			local aSQL2c = executeSQLQuery ( 'SELECT * FROM MSGSYS WHERE playerSerial=?', getPlayerSerial ( source ) )
			if ( #aSQL2c == 0 ) then
				executeSQLQuery( "INSERT INTO MSGSYS ( MSG ) VALUES( ? )", MSG )
			else
				executeSQLQuery("UPDATE MSGSYS SET MSG=? WHERE playerSerial=?", MSG, getPlayerSerial ( source ) )
			end
			triggerEvent ( 'Refresh' , source )
		end
	end
)

addEvent ( 'Refresh' , true )
addEventHandler ( 'Refresh' , root , 
	function ()
	local aSQL2c = executeSQLQuery ( 'SELECT * FROM MSGSYS WHERE playerSerial=?', getPlayerSerial ( source ) )
		if ( #aSQL2c ~= 0 ) then 
			triggerClientEvent ( source, 'AddMsg' , source , aSQL2c )
		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...