![]()
This is the current plugin im making to kill sleepers when they disconnect (Please tell me if im doing it wrong because its my first time making a plugin) and i get this error when loading it into the server -
Error while compiling: Sleeper.cs(28,246): error CS1525: Unexpected symbol `end-of-file'
Solved Error message when loading plugin
Discussion in 'Rust Development' started by God 14, May 6, 2018.
-
Add } at end of file
-
What do you mean though, like have a { on the bottom line
[DOUBLEPOST=1525595630][/DOUBLEPOST]or like in the name?Last edited by a moderator: May 6, 2018 -
you have not close your class Sleeper
-
How would i do that
-
1. missing semicolon at the end of 14 line.
2. replace { with } on the line 24.
3. insert } after the 25 line. -
![[IMG]](proxy.php?image=https%3A%2F%2Fimage.prntscr.com%2Fimage%2Fjx0hun1NTByqVZe-J-sx1Q.png&hash=8585b0df5e1ad79f92b85391c1b0fe24)
Code:namespace Oxide.Plugins{ [Info ("Dormeur", "Malédiction", 01)] [Description ("Tue les dormeurs"]] classe Sleeper: RustPlugin { chaîne PermGroup; chaîne publique PermGroup {get => PermGroup; set => PermGroup = valeur; } override protégé override LoadDefaultCOnfig () { Config ["Permissions Group"] = PermGroup = GetConfig ("Groupe d'autorisations", "Kill.Sleeper"); SaveConfig (); } void OnPlayerDisconnected (lecteur BasePlayer) { if (HasPlayerPermission (joueur, "kill.Sleeper")) { player.Die (); revenir; } } } } -
Thank you guys so very much, really appreciate it
Im still getting another error after editing it from what u guys said
Error while compiling: Sleeper.cs(13,60): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
Last edited by a moderator: May 6, 2018 -
?Code:
string permGroup; public string PermGroup { get { return permGroup; } set { permGroup = value; } };Last edited by a moderator: May 6, 2018 -
That's being rejected because it's a newer C# feature. You can use what's above, but there's no advantage to declaring that as a property over a field, but if you're set on it, you don't need a backing field, at least declared explicitly.
-
Thanks guys, works now
-
What a tolerant community here!
