Why Not Working

Started by RW, Mar 27, 2017, 10:15 AM

Previous topic - Next topic

RW

Client Side:
BS <- GUILabel(VectorScreen( sX * 0.06, sY * 0.4 ),Colour(0,255,0,0),"NO ROUND");
 BS.FontSize = 15;
 BS.FontFlags = GUI_FLAG_TEXT_TAGS | GUI_FFLAG_ULINE;

function Server::ServerData(stream) {
    local type = stream.ReadInt();
    switch(type)
   {
      case 1:
      ::BS.Text = stream.ReadString();
      break;
      case 2:
      ::BS.Text = "NO ROUND";
      break;
    }
}

Normal Script:
local Stream = Stream();
Stream.WriteInt( 1 );
Stream.WriteString( "Base ID : ["+BaseID+"] Name : ["+BaseName+"]" );
Stream.SendStream(null);


I'm sure the BaseID and BaseName are not wrong... Why this text didn't change?

Luis_Labarca

#1
Hello bro everything is good side of the client-side where you are putting masl is in Stream.SendStream (null); To put it null you are sending an unknown player you must put it Stream.SendStream (player);


So I tried it and it works
Client-Side
BS <- GUILabel(VectorScreen( 100, 100 ),Colour(0,255,0,0),"NO ROUND");
BS.FontSize = 15;
BS.FontFlags = GUI_FLAG_TEXT_TAGS | GUI_FFLAG_ULINE;

function Server::ServerData(stream) {
    local type = stream.ReadInt();
    switch(type)
   {
      case 1:
      ::BS.Text = stream.ReadString();
      break;
      case 2:
      ::BS.Text = "NO ROUND";
      break;
    }
}
Server Script
local Stream = Stream();
Stream.WriteInt( 1 );
Stream.WriteString( "Base ID : ["+BaseID+"] Name : ["+BaseName+"]" );
Stream.SendStream(player);
My server RP
IP: 51.222.28.159:8194

RW

Quote from: Luis_Labarca on Mar 27, 2017, 12:33 PMHello bro everything is good side of the client-side where you are putting masl is in Stream.SendStream (null); To put it null you are sending an unknown player you must put it Stream.SendStream (player);


So I tried it and it works
Client-Side
BS <- GUILabel(VectorScreen( 100, 100 ),Colour(0,255,0,0),"NO ROUND");
BS.FontSize = 15;
BS.FontFlags = GUI_FLAG_TEXT_TAGS | GUI_FFLAG_ULINE;

function Server::ServerData(stream) {
    local type = stream.ReadInt();
    switch(type)
   {
      case 1:
      ::BS.Text = stream.ReadString();
      break;
      case 2:
      ::BS.Text = "NO ROUND";
      break;
    }
}
Server Script
local Stream = Stream();
Stream.WriteInt( 1 );
Stream.WriteString( "Base ID : ["+BaseID+"] Name : ["+BaseName+"]" );
Stream.SendStream(player);
I will try it now. Thanks :)

Luis_Labarca

@[F.BI]RW You are welcome, my friend, it's a pleasure to have helped you
My server RP
IP: 51.222.28.159:8194

RW

Quote from: Luis_Labarca on Mar 27, 2017, 05:28 PM@[F.BI]RW You are welcome, my friend, it's a pleasure to have helped you
Wonderful! It worked great