Hey, how can I register command with exclamation mark instead of / ?
Solved Registering command with exclamation mark?
Discussion in 'Rust Development' started by MlokCZ, Jun 24, 2018.
-
Wulf Community Admin
There is no registration for those, you'd have to listen with the OnPlayerChat or OnUserChat hooks. There are existing threads on the forum regarding this as well, which can be found using the search box.
-
Thanks..
[DOUBLEPOST=1529799350][/DOUBLEPOST]And i have a question how can i change this code to show total sleepers on the server?
Code:void OnPlayerChat(ConsoleSystem.Arg arg) { var message = arg.GetString(0); if (message.Contains("!players")) { var playerCount = BasePlayer.activePlayerList if (playerCount > 1) rust.BroadcastChat($"On this server is currently {playerCount} players online."); else rust.BroadcastChat("On this server is currently 1 player online."); } }
-
-
Okey.. thanks
-
How to fix this error? Error while compiling: sleepers.cs(22,246): error CS1525: Unexpected symbol `end-of-file'
With this code:
Code:using Rust;namespace Oxide.Plugins { [Info("sleepers", "qw", "0.1.0")] public class sleepers : RustPlugin { void OnPlayerChat(ConsoleSystem.Arg arg) { var message = arg.GetString(0); if (message.Contains("!sleepers")) { var sleepingPlayerCount = BasePlayer.sleepingPlayerList if (sleepingPlayerCount > 1) rust.BroadcastChat($"On this server {sleepingPlayerCount} players sleeping right now."); else rust.BroadcastChat("On this server 1 player sleeping right now."); } } }
-
Wulf Community Admin
-
And what can I do?
I'm new with this so. :/
And i really want these commands to vanilla -
Wulf Community Admin
-
cause i want the vanilla server a little bit different than other community servers..
-
Wulf Community Admin
I can't really explain how to fix your issue aside from changing how you upload to your server and making sure that there isn't any odd symbols at the end of your file, hidden or visible. If you're using an FTP client, make sure the transfer mode isn't changing the file in any way. -
I don't know if it's hard to create this plugins !players, !sleepers, !discord i tried and i had the Unexpected symbol `end-of-file' and i don't know what can I do :/
[DOUBLEPOST=1529807795][/DOUBLEPOST]okey i'll look at that
[DOUBLEPOST=1529808062][/DOUBLEPOST]I uploaded the plugins in filezilla, and when i upload other plugins from the plugin list so they works.. but the mine don't :/
[DOUBLEPOST=1529808117][/DOUBLEPOST]And I'm in protocol SFTP in the filezilla options
[DOUBLEPOST=1529808497][/DOUBLEPOST]Oww i fixed it but now i have this error: Error while compiling: Sleepers.cs(20,16): error CS1525: Unexpected symbol `else' -
You should consider installing visual studio...
On lineCode:var sleepingPlayerCount = BasePlayer.sleepingPlayerList
-
It's working now.. thanks all for help!
-
It compiled, but it's not working.
Code:BasePlayer.sleepingPlayerList.Count;