Vice City: Multiplayer

Community Projects => SLC's Squirrel Plugin => Bug Reports => Topic started by: EK.IceFlake on May 05, 2017, 05:02 AM

Title: Stream not sending
Post by: EK.IceFlake on May 05, 2017, 05:02 AM
    player.StartStream();
    player.StreamInt(CLIENT_STREAMS.SelectClass);
    player.StreamByte(1);
    player.FlushStream(true);

    player.StartStream();
    player.StreamInt(CLIENT_STREAMS.UpdateClass);
    player.StreamString("Sasuke");
    player.StreamString("Sakura Chan");
    player.FlushStream(true);
function Server::ServerData(stream)
{
    local identifier = stream.ReadInt();

    switch (identifier)
    {
        case ServerDataType.SelectClass:
            Binarify(stream.ReadByte()) ? SpawnScreenLabel.Create() : SpawnScreenLabel.Destroy();
            break;

        case ServerDataType.UpdateClass:
            SpawnScreenLabel.LabelValueTeam    = stream.ReadString();
            SpawnScreenLabel.LabelValueSkin    = stream.ReadString();
            break;
       
        default:
            Console.Print("[#33CC33]System internal         [#FFFFFF]| [#FF0000]Error: [#FFFFFF]Unrecognized stream identifier [#33CC33]" + type + "[#FFFFFF].")
            break;
    }
}

Nothing happens. Console.Print doesn't output anything when made to test if Server::ServerData is being called.
Title: Re: Stream not sending
Post by: EK.IceFlake on May 05, 2017, 05:30 AM
Solved. Apparently, you can't define events after Script::ScriptLoad in client side scripts.