Example #1
0
        public override bool OnPlayerDisconnect(Client player)
        {
            Opponent curOp = Opponents.FirstOrDefault(op => op.Client == player);

            if (curOp == null)
            {
                return(true);
            }

            if (RememberedBlips.ContainsKey(player.NetConnection.RemoteUniqueIdentifier))
            {
                RememberedBlips[player.NetConnection.RemoteUniqueIdentifier] = curOp.Blip;
            }
            else
            {
                RememberedBlips.Add(player.NetConnection.RemoteUniqueIdentifier, curOp.Blip);
            }

            if (curOp.Vehicle != 0)
            {
                Program.ServerInstance.SendNativeCallToPlayer(player, 0xAD738C3085FE7E11, curOp.Vehicle, true, false);
                Program.ServerInstance.SendNativeCallToPlayer(player, 0xAE3CBE5BF394C9C9, curOp.Vehicle);
            }

            if (curOp.Blip != 0)
            {
                Program.ServerInstance.SendNativeCallToPlayer(player, 0x45FF974EEE1C8734, curOp.Blip, 0);
            }

            lock (Opponents) Opponents.Remove(curOp);
            return(true);
        }
Example #2
0
        public override bool OnPlayerConnect(Client player)
        {
            Program.ServerInstance.SetNativeCallOnTickForPlayer(player, "RACE_DISABLE_VEHICLE_EXIT", 0xFE99B66D079CF6BC, 0, 75, true);
            Program.ServerInstance.SendNotificationToPlayer(player, "~r~IMPORTANT~w~~n~" + "Quit the server using the ~h~/q~h~ command to remove the blip.");

            if (IsRaceOngoing)
            {
                SetUpPlayerForRace(player, CurrentRace, false, 0);
            }

            if (DateTime.Now.Subtract(VoteStart).TotalSeconds < 60)
            {
                Program.ServerInstance.SendNotificationToPlayer(player, GetVoteHelpString());
            }

            if (RememberedBlips.ContainsKey(player.NetConnection.RemoteUniqueIdentifier))
            {
                Opponents.Add(new Opponent(player)
                {
                    Blip = RememberedBlips[player.NetConnection.RemoteUniqueIdentifier]
                });
            }
            return(true);
        }