Checking if connection is player's first?Solved
So IPlayer.Connected returns an array of all connected users? (right?)
and IPlayer.All returns an array of all connceted players and those who are offline? (right?)

and what whould be the easiest way to tell if a players current connection session is hes/hers first?
There isn't anything natively that would be used to detect first connection, but you could assign and check for a permission.
sad i hoped i chould avoid doing something like that.
but so doing something like:
void OnPlayerInit(BasePlayer basePlayer) {

  IPlayer player = basePlayer.IPlayer;

  if (!player.HasPermission("tacti.joinedbefore") {
    //do whatever if the player hasn't joined before



    //and grant tacti.joinedbefore to player
    player.GrantPermission("tacti.joinedbefore");
  } 
}​

whould work?
and does a permission have to be initilized?

If you are going universal, I'd use the OnUserConnected(IPlayer player) hook instead of OjnPlayerInit.

To grant a permission, it has to be registered by a plugin; to check it doesn't need to be registered.
how do i reqister a permission?
and how does colors work in umod when sending a message to the game chat?
private void Init()
{
    permission.RegisterPermission("tacti.joinedbefore", this);
}

private void OnUserConnected(IPlayer player)
{
    player.Message($"Hello [#ffffff]{player.Name}[/#]!");
}

ahhhh ok thanks wolf :)
btw emm the OnUserCommand doesn't sems to work (as you told me at my last thread)

tryed:
object OnUserCommand(ConsoleSystem.Arg arg)
{

  string text = "";

  foreach (string str in arg.Args)
  {
      text = text + str + " ";
  }


  Puts(arg.Connection.username + ": " + text);

  return null;
}​
OnUserCommand would be a universal hook, would not have a Rust arg. Pretty sure that hook doesn’t exist in the current branch though, but would need to check
yes please find out how to use it

Merged post

nvm
object OnUserCommand(IPlayer player, string command)
{
   Puts(player.Name + ": " + command);

   return null;
}​
works just fine
Locked automatically