Gui read the data base ?

Started by Nihongo^, Dec 27, 2018, 12:34 PM

Previous topic - Next topic

Nihongo^

Hi how do i use GUI to read the data base ? like when something update on db its show on Server ( with gui )

MatheuS

You need use Streams to send information from server to client-side. So yes, its possible to "read the data base" but giving information from server to client-side.
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

Nihongo^

Hi i am sorry for bothering you i am complety noob in gui can you give an example how it works and how client read my databaseetc ?

Strike Eagle

Best Game Hosting ever for VCMP
https://gamehosting.co/aff.php?aff=112

Nihongo^


Anik

Send data to server.
Process the data.
Read the database in server.
Send the data to client you read from database.

Just a quick example for you:
In client side
local st = Stream( );
st.WriteInt( 1 );
Server.SendData( st );

Now In server side:

function onClientScriptData( player )
{
local Int = Stream.ReadInt( );
if (Int == 1)
{
 // Do the database query
 // Then send that back  to client
}
}

Now again in client side
check the stream and you got the data of your database.

Nihongo^

Quote// Do the database query
 // Then send that back  to client
That's want i want to know how the code look like? if you don't mind can you tell me with an example ?

!


Discord: zeus#5155