Vice City: Multiplayer

VC:MP Discussion => Support => Topic started by: Nihongo^ on Dec 27, 2018, 12:34 PM

Title: Gui read the data base ?
Post by: Nihongo^ on Dec 27, 2018, 12:34 PM
Hi how do i use GUI to read the data base ? like when something update on db its show on Server ( with gui )
Title: Re: Gui read the data base ?
Post by: MatheuS on Dec 27, 2018, 01:10 PM
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.
Title: Re: Gui read the data base ?
Post by: Nihongo^ on Dec 27, 2018, 01:15 PM
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 ?
Title: Re: Gui read the data base ?
Post by: Strike Eagle on Dec 28, 2018, 03:38 PM
Any one help here ????
Title: Re: Gui read the data base ?
Post by: Nihongo^ on Dec 29, 2018, 05:49 AM
Quote from: Strike Eagle on Dec 28, 2018, 03:38 PMAny one help here ????
be paitent maybe they're busy
Title: Re: Gui read the data base ?
Post by: Anik on Dec 29, 2018, 06:30 AM
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.
Title: Re: Gui read the data base ?
Post by: Nihongo^ on Dec 29, 2018, 08:22 AM
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 ?
Title: Re: Gui read the data base ?
Post by: ! on Jan 01, 2019, 02:11 PM
Quote from: Nihongo^ on Dec 29, 2018, 08:22 AM...
if you don't mind can you tell me with an example ?
https://forum.vc-mp.org/?topic=4484.0
https://forum.vc-mp.org/?topic=4417.0
https://forum.vc-mp.org/?board=36.20
Title: Re: Gui read the data base ?
Post by: Strike Eagle on Jan 01, 2019, 04:09 PM
Quote from: ! on Jan 01, 2019, 02:11 PM
Quote from: Nihongo^ on Dec 29, 2018, 08:22 AM...
if you don't mind can you tell me with an example ?
https://forum.vc-mp.org/?topic=4484.0
https://forum.vc-mp.org/?topic=4417.0
https://forum.vc-mp.org/?board=36.20

hmm thanks