Hi! How to deny or allow player connection? OnPlayerConnected or.. maybe CanClientLogin? What to use? I need to send a message such as "Ur banned on this server".. help plz
Solved Denying player connection with message?
Discussion in 'Rust Development' started by Iv Misticos, Oct 12, 2017.
-
Ban them
-
Wulf Community Admin
You can use Rust's built-in banning to send them a message already as suggested above.
If you really need to make a custom plugin, you can return a string in the CanClientLogin hook. -
bool CanClientLogin(Network.Connection conn)
{
if 1=true {
Puts("Success");
return true;
}
if 1=false {
Puts("NO");
return "No. No and no.";
}
}
?? or how can i return message OR boolean?
[DOUBLEPOST=1507833935][/DOUBLEPOST]just in bool return string, yep? -
Wulf Community Admin
Code:object CanClientLogin(Network.Connection conn) { if (conn.username == "Bob") return "You're banned"; return null; }
Code:object CanClientLogin(Network.Connection conn) { return conn.userid == 700000000000000 ? "Go away" : (object)null; }
-
-
Wulf Community Admin
-
-
Wulf Community Admin
-
-
thx im trying to write my own plugin))
[DOUBLEPOST=1507834990][/DOUBLEPOST]