Hello
I just started getting into C# (been coding a little bit in the past, small stuff like basic php and such) and I want to get into the oxide modding.
I want to start with making a very simple plugin that basicly announces in chat when a player respawns from death. I've used the Oxide API site for reference, and found the following code
So I downloaded a few plugins that announces to chat and looked at their code. I've ended up with the followingCode:void OnPlayerRespawned(BasePlayer player) { Puts("OnPlayerRespawned works!"); }
Now i'm stuck and not sure how to continue. First of all, i've installed the JustDecompile program and looked through Assembly-CSharp.dll for references but not really sure how or what to do with it.Code:using Oxide.Core.Libraries.Covalence; using System.Collections.Generic; using Newtonsoft.Json; using Oxide.Core; using System;namespace PlayerRespawnAnnouncement { [Info("Player Respawn Announcement", "Maloxan", 0.1)] [Description("Mention in chat when player respawns from death")] class PlayerRespawnAnnouncement { void OnPlayerRespawned(BasePlayer player) { Puts("{Player} just respawned from a short temporarily death!"); } } }
If you have any inputs on how to continue from here when stuck, please let me know. Much appreciated! I am willing to eventually pay for further assistance with the right help
New dev looking for input on some code
Discussion in 'Rust Development' started by Maloxan, Feb 9, 2017.
-
Hey there,
From what I can see what you have is almost correct and here are a few tips
- The namespace should be Oxide.Plugins
- You need to inherit RustPlugin for it to be registered as a plugin
- The Puts command outputs to the server window and not actually to the game
Code:using Oxide.Core.Libraries.Covalence; using System.Collections.Generic; using Newtonsoft.Json; using Oxide.Core; using System;namespace Oxide.Plugins { [Info("Player Respawn Announcement", "Maloxan", 0.1)] [Description("Mention in chat when player respawns from death")] class PlayerRespawnAnnouncement : RustPlugin { void OnPlayerRespawned(BasePlayer player) { rust.BroadcastChat(player.displayName + " just respawned from a short temporary death!", null, null); } } }
- The namespace should be Oxide.Plugins
-
Wulf Community Admin
-
Now, alright! Thanks so much for the replies.
I copy pasted Kriogenic's code and understood a bit more! I am still confused about theCode:null, null);
Is it possible to check for errors? When I hit "Start" (green arrow / play button) it gives me 30 warnings and 10 errors. I did input the necessary Analyzers as mentioned in a thread somewhere. How do I "finish" it? I mean, I guess there should be generated a .json file to edit for the users. Basicly it should just be one setting to be changed on or off or something, just to make it super simple and easily understandable -
Wulf Community Admin
-
Is there any guides available I haven't seen that explains the finishing touches on a plugin? So I can upload it and test it on my own server working. -
Wulf Community Admin
-
Last short question - If a plugin were to be uploaded to oxidemod as it is right now; would it be accepted or declined? And if declined, on what background? Just curious! -
Wulf Community Admin
-
-
Wulf Community Admin
-
-
-
Wulf Community Admin