This is working ?

Started by KrOoB_, Jul 06, 2018, 10:30 AM

Previous topic - Next topic

KrOoB_

Client side


g_option3 = GUILabel();
function Script::ScriptLoad( )
{
   //score message ( I just copied the code for showing scores. )
       g_option3.Text = "Current Score: Reds: 0 || Blues: 0";
       g_option3.TextColour = Colour( 255, 0, 255 );
      g_option3.FontSize = 15;
      g_option3.Pos = VectorScreen( sizex * 0.8, sizey / 2 - 65 );
}
function Server::ServerData( stream )
{
 local strint = stream.ReadInt( );
 switch( strint.tointeger( ) )
{
case 4 :
     local txt = stream.ReadString();
     g_option3.Text = txt;
     break;
}
}

Server Side

function GUITeamScore()
{
// this function will be called everytime the scores change.
    local data = Stream();
    data.WriteInt( 4 );
    data.WriteString( "Current Score: Reds: " + RedScore + " || Blues: " + BlueScore );
    data.SendStream( null );
}

https://forum.vc-mp.org/?topic=4203.msg31075#msg31075