On_PlayerMove

Jun 25, 2016
On_PlayerMove
  • Method:
    On_PlayerMove

    Argument(s):
    HumanController
    Vector3
    int
    ushort
    uLink.NetworkMessageInfo

    Examples:

    C# (This event is called a lot, so I decided to make It only for C#)

    Code (C#):

    public void OnPlayerMove(HumanController hc, Vector3 origin, int encoded, ushort stateflags, uLink.NetworkMessageInfo info)
    {
        Fougerite.Player Player = Fougerite.Server.Cache.ContainsKey(hc.netUser.userID) ? Fougerite.Server.Cache[hc.netUser.userID] : Fougerite.Server.GetServer().FindPlayer(hc.netUser.userID.ToString());
        if (Player == null)
        {
            if (hc.netUser == null) return;
            if (hc.netUser.connected)
            {
                hc.netUser.Kick(NetError.NoError, true);
            }
            return;
        }
        Player.Message("You are moving!");
    }