This does not work for legacy... Loads in perfectly but any plugin linked to it says "You must have the PlayerDataBase plugin to use this plugin"
[DOUBLEPOST=1491005676][/DOUBLEPOST]So prod works fine it's just House Locations for Rust Legacy | Oxide
PlayerDatabase
Big database with light weight way to save it to prevent lag
Total Downloads: 2,478 - First Release: May 30, 2016 - Last Update: Jan 11, 2017
- 5/5, 8 likes
-
solved.
-
There seems to be an issue when the plugin registers names with weird characters, for whatever reason the plugin didn't close the quote on a name and it messed up the entire database (MySql, don't know about any other database type). Lazy solution below.
Replace line 6 with:
Code:try { d = GetPlayerData(userid, "name"); } catch (JsonReaderException) { continue; }
-
Getting Error while compiling: PlayerDatabase.cs(515,14): error CS0234: The type or namespace name `MySql' does not exist in the namespace `Oxide.Core'. Are you missing an assembly reference? with Oxide Build 2.0.3589
-
-
Wulf Community Admin
-
[DOUBLEPOST=1508595807][/DOUBLEPOST] -
Couldn't get columns. Database might be corrupted.
It connects to the database but doesn't make the table. -
The only problem is, the ID is always 0 now. I gave id primary key and Auto Increment but now it doesn't add anything to the database anymore. -
Code:
(05:52:43) | Unloaded plugin EnhancedBanSystem v5.2.1 by Reneb/Slut (05:52:43) | Failed to call hook 'OnServerInitialized' on plugin 'EnhancedBanSystem v5.2.1' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_Load () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EnhancedBanSystem.OnServerInitialized () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EnhancedBanSystem.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 (05:52:43) | Loaded plugin EnhancedBanSystem v5.2.1 by Reneb/Slut
Not sure what's going on here to be honest, I use EBS alongside PlayerDB. Any idea @Slut?
This'll happen OnSave:
Code:(05:43:16) | Failed to call hook 'OnServerSave' on plugin 'EnhancedBanSystem v5.2.1' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.EnhancedBanSystem.Save_Files () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EnhancedBanSystem.OnServerSave () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EnhancedBanSystem.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
This'll happen every-time someone joins the server:
Code:(05:41:41) | MySql handle raised an exception (Exception: Connection is null) at Oxide.Core.MySql.Libraries.MySql+MySqlQuery.Handle () [0x00000] in <filename unknown>:0 (05:41:41) | MySql handle raised an exception (Exception: Connection is null) at Oxide.Core.MySql.Libraries.MySql+MySqlQuery.Handle () [0x00000] in <filename unknown>:0
-
-
I dont understand how to install this.
Do i have to change this?
{
"Data Type : 0 (Files) or 1 (SQLite) or 2 (MySQL)": 2,
"MySQL - Database Name": "rust",
"MySQL - Host": "localhost",
"MySQL - Password": "toor",
"MySQL - Port": 3306,
"MySQL - Username": "root",
"SQLite - Database Name": "playerdatabase.db"
} -
So i finish installing this plugin got all player information in mysql, So how do i add Economics plugin to work in the database ?
-
@Wulf Do you know what data type the "Time Played" column is? I've tried seconds and minutes but then it's just all wrong. I also tried unix time stamp but I doubt its that. Sorry for tagging you. It seems that Reneb isnt active so I tagged you.
Last edited by a moderator: Apr 22, 2018 -
Wulf Community Admin
-
If you type /played "playername" It gives you their time played in days, hours, and minutes.... for example "Captain Nebulous has played __d __h __s"
You don't specify what the format is yourself, it just tells you in that format. And it's /played, not /timeplayed -
Example in pascal:
Code:query := 'SELECT [Time Played] FROM PlayerDatabase WHERE [name]=''"' + sname + '"'''; Log(query); try sqlqueryPlayers.SQL.Text := query; sqlqueryPlayers.Active := true; except on E: Exception do begin mmo1.Lines.Add('Exception raised with message: ' + E.Message); lblNickname.Caption := ''; lblSteamID.Caption := ''; lblLastSeen.Caption := ''; lblTimePlayed.Caption := ''; exit; end; end; if not sqlqueryPlayers.IsEmpty then begin sqlqueryPlayers.First; names := TStringList.Create; try sqlqueryPlayers.GetFieldNames(names); while not sqlqueryPlayers.Eof do begin currentLine := ''; for i := 0 to names.Count - 1 do begin currentField := sqlqueryPlayers.FieldByName(names[i]); currentLine := currentLine + ' ' + currentField.AsString; end; Trim(currentLine); currentLine := StringReplace(currentLine, '.', ',', [rfReplaceAll, rfIgnoreCase]); Delete(currentLine, 1, 2); Delete(currentLine, Length(currentLine), 1); if currentLine <> '' then begin lastseen := StrToFloat(currentLine); lastseen := lastseen / 60; ilastseen := Round(lastseen); lblTimePlayed.Caption := FloatToStr(ilastseen) + ' Minutes'; end else if Trim(currentLine) = '' then lblTimePlayed.Caption := 'No data'; sqlqueryPlayers.Next; end; finally names.Free; end; end;
-
Divide by 60*