On_PlayerMove

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,098
4,863
113
At your house.
github.com
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#)

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!");
}
 

fdsfds

New Member
Member
Feb 6, 2017
5
0
1
32
Parts Unknown
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#)

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!");
}
Welcome - please tell me how can I obtain this :
Check if you have changed the position of the player the helmet is the message - if there is in place , it does not send
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,098
4,863
113
At your house.
github.com
is there a way to get the time at which the player moves from the player.Location; to origin?
Without time not be able to calculate the speed
....

Vector3 newl = player.Location;
float dist = Vector3.Distance(origin, newl)- 1.647583f;

If you really need the time use DateTime.