Please update plugin from 1.18 to 2 version
Thanks in advance.
Code:function On_PlayerConnected(Player) { var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var online = Web.GET(""+url+"?steamid="+Player.SteamID+"&name="+Player.Name+""); } }function On_PlayerDisconnected(Player) { var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var online = Web.GET(""+url+"?steamid="+Player.SteamID+"&offline=0"); } }function On_Command(Player, cmd, args){ if(cmd == "password"){ var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var pass = Web.GET(""+url+"?steamid="+Player.SteamID+"&pass="+args[0]+""); if (pass == 1) { Player.Notice("㋛", "Ваш пароль успешно изменен!", 10); } else { Player.Notice("Извините, сервер авторизации временно недоступен."); } } } }
Universal Site registration
Discussion in 'Plugin Requests' started by AMX PRO MESSI, Feb 2, 2016.
-
Wulf Community Admin
What exactly does the plugin do, and what exactly do you want it to do?
-
I need to work on this plugin oxide 2.0
Thanks in advance. -
Wulf Community Admin
-
Provide the full plugin?
-
[DOUBLEPOST=1454500812][/DOUBLEPOST]
Code:function On_PlayerConnected(Player) { var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var online = Web.GET(""+url+"?steamid="+Player.SteamID+"&name="+Player.Name+""); } }function On_PlayerDisconnected(Player) { var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var online = Web.GET(""+url+"?steamid="+Player.SteamID+"&offline=0"); } }function On_Command(Player, cmd, args){ if(cmd == "password"){ var enable = Data.GetConfigValue("Register++", "Main", "enable"); if (enable == "true") { var url = Data.GetConfigValue("Register++", "Main", "url"); var pass = Web.GET(""+url+"?steamid="+Player.SteamID+"&pass="+args[0]+""); if (pass == 1) { Player.Notice("㋛", "Ваш пароль успешно изменен!", 10); } else { Player.Notice("Извините, сервер авторизации временно недоступен."); } } } }
Code:[Main] enable=true url=http://install.ru/reg.php
Make the plugin worked for Oxide 2.0 -
Why you don't try to do it by yourself? Not so hard
Code:webrequest.EnqueueGet("http://www.google.com/search?q=oxide", function(code, response) if response == nil or code ~= 200 then print("Couldn't get an answer from Google!") return end print("Google answered: " .. tostring(response)) end, self.Plugin)
-
Please, if you can help me with the plugin.
Thank you. -
-
-
Code:
namespace Oxide.Pluginsusing System; using Oxide.Core; using Oxide.Core.Libraries; using System.Text;{ [Info("SiteRegistration", "Prefix", 0.1)] [Description("Makes epic stuff happen")] class SiteRegistration : RustLegacyPlugin { public static bool enabled = true; public static string url = "http://install.ru/reg.php"; public static string success = "You have changed your password successfully"; public static string failure = "Some problems occured with your server, try later."; public static string nname = "Registration"; void LoadDefaultConfig() { } private void CheckCfg<T>(string Key, ref T var) { if (Config[Key] is T) var = (T)Config[Key]; else Config[Key] = var; } void Init() { CheckCfg<bool>("Enabled", ref enabled); CheckCfg<string>("URL", ref url); CheckCfg<string>("Password change success", ref text1); CheckCfg<string>("Password change failure", ref text2); CheckCfg<string>("Notice name", ref nname); SaveConfig(); } [ChatCommand("register")] void Chat_Register(NetUser netuser, string command, string[] args) { string result = string.Join(" ", args); webrequest.EnqueueGet(string.Format("{0}?steamid={1}&pass={2}", url, netuser.userID.ToString(), result), (code, response) => Chat_Register_CB(code, response, netuser), this); } void OnPlayerConnected(NetUser netuser) { webrequest.EnqueueGet(string.Format("{0}?steamid={1}&name={2}", url, netuser.userID.ToString(), netuser.userName.ToString()), (code, response) => VoidCallback(code, response), this); } void OnPlayerDisconected(uLink.NetworkPlayer networkPlayer) { if(netplayer == null) return; PlayerClient player = ((NetUser)netplayer.GetLocalData()).playerClient; if(player.controllable == null) return; if(player.controllable.GetComponent<Character>() == null) return; var netUser = netplayer.GetLocalData<NetUser>(); webrequest.EnqueueGet(string.Format("{0}?steamid={1}&name={2}&offline=0", url, netuser.userID.ToString(), netuser.userName.ToString()), (code, response) => VoidCallback(code, response), this); } void Chat_Register_CB(int code, string response, NetUser netuser) { if (response == 1) { rust.Notice(netuser, text1, nname, 10f) } else { rust.Notice(netuser, text2, nname, 10f) } } void VoidCallback(int code, string response) { } }
-
[SERVER] Got Message: Exit
[SERVER] Exit received. Shutdown
[SERVER] Started as service
[SERVER] Running as service
[SERVER] Got Message: Ready
[SERVER] Got Message: Compile
[SERVER] Console: SiteRegistration.cs(4,0): error CS1525: Unexpected symbol `using'
SiteRegistration.cs(5,16): error CS1525: Unexpected symbol `;'
SiteRegistration.cs(6,26): error CS1525: Unexpected symbol `;'
SiteRegistration.cs(7,17): error CS1525: Unexpected symbol `;'
SiteRegistration.cs(71,13): error CS1002: ; expected
SiteRegistration.cs(73,13): error CS1002: ; expected
SiteRegistration.cs(79,246): error CS1525: Unexpected symbol `end-of-file' -
Code:
using System; using System.Collections.Generic; using Oxide.Core; using Oxide.Core.Libraries;namespace Oxide.Plugins { [Info("SiteRegistration", "Prefix", 0.1)] [Description("Makes epic stuff happen")] class SiteRegistration : RustLegacyPlugin { public static bool enabled = true; public static string url = "http://install.ru/reg.php"; public static string success = "You have changed your password successfully"; public static string failure = "Some problems occured with your server, try later."; public static string nname = "Registration"; void LoadDefaultConfig() { } private void CheckCfg<T>(string Key, ref T var) { if (Config[Key] is T) var = (T)Config[Key]; else Config[Key] = var; } void Init() { CheckCfg<bool>("Enabled", ref enabled); CheckCfg<string>("URL", ref url); CheckCfg<string>("Password change success", ref success); CheckCfg<string>("Password change failure", ref failure); CheckCfg<string>("Notice name", ref nname); SaveConfig(); } [ChatCommand("register")] void Chat_Register(NetUser netuser, string command, string[] args) { string result = string.Join(" ", args); webrequest.EnqueueGet(string.Format("{0}?steamid={1}&pass={2}", url, netuser.userID.ToString(), result), (code, response) => Chat_Register_CB(code, response, netuser), this); } void OnPlayerConnected(NetUser netuser) { webrequest.EnqueueGet(string.Format("{0}?steamid={1}&name={2}", url, netuser.userID.ToString(), netuser.displayName.ToString()), (code, response) => VoidCallback(code, response), this); } void OnPlayerDisconected(uLink.NetworkPlayer networkPlayer) { if(networkPlayer.GetLocalData<NetUser>() == null) return; NetUser netUser = networkPlayer.GetLocalData<NetUser>(); webrequest.EnqueueGet(string.Format("{0}?steamid={1}&name={2}&offline=0", url, netUser.userID.ToString(), netUser.displayName.ToString()), (code, response) => VoidCallback(code, response), this); } void Chat_Register_CB(int code, string response, NetUser netuser) { if (response.Equals("1")) { rust.Notice(netuser, success, nname, 10f); } else { rust.Notice(netuser, failure, nname, 10f); } } void VoidCallback(int code, string response) { } } }
-
[SERVER] Got Message: Exit
[SERVER] Exit received. Shutdown
[SERVER] Started as service
[SERVER] Running as service
[SERVER] Got Message: Ready
[SERVER] Got Message: Compile
[SERVER] Console: SiteRegistration.cs(20,14): warning CS0114: `Oxide.Plugins.SiteRegistration.LoadDefaultConfig()' hides inherited member `Oxide.Core.Plugins.Plugin.LoadDefaultConfig()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
C:\servers\bormutov\rust_oeb2n8_28021\Oxide.Core.dll (Location of the symbol related to previous warning)
SiteRegistration.cs(43,13): error CS0103: The name `webrequest' does not exist in the current context
SiteRegistration.cs(48,13): error CS0103: The name `webrequest' does not exist in the current context
SiteRegistration.cs(56,13): error CS0103: The name `webrequest' does not exist in the current context -
yes I know what error is, but I don't know how to fix it so wait for @Wulf
-
Wulf Community Admin
-
Code:
webrequests.EnqueueGet(string.Format("{0}?steamid={1}&pass={2}", url, netuser.userID.ToString(), result), (code, response) => Chat_Register_CB(code, response, netuser), this);
-
Wulf Community Admin
It's only available in the recent updates, before you had to manually load it yourself. -
-
Wulf Community Admin