using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RustBuster2016Server;
using Fougerite;
namespace ClientCom
{
public class ClientCom : Fougerite.Module
{
public override string Author
{
get { return "Salva"; }
}
public override string Name
{
get { return "ClientCom"; }
}
public override Version Version
{
get { return new Version("1.0"); }
}
public override string Description
{
get { return "ClientCom"; }
}
public override void DeInitialize()
{
API.OnRustBusterUserMessage -= On_MessageReceived;
}
public override void Initialize()
{
API.OnRustBusterUserMessage += On_MessageReceived;
}
public void On_MessageReceived(API.RustBusterUserAPI user, Message msgc)
{
if (msgc.PluginSender == "FogPlugin")
{
string msg = msgc.MessageByClient;
if (msg == "ServerTime")
{
string actualtime = World.GetWorld().Time.ToString();
msgc.ReturnMessage = actualtime;
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using RustBuster2016.API;
using UnityEngine;
namespace FogPlugin
{
public class Test : RustBusterPlugin
{
public static string Time;
public MainGUI test;
private static GameObject Load;
public override string Name
{
get { return "FogPlugin"; }
}
public override string Author
{
get { return "Salva"; }
}
public override Version Version
{
get { return new Version("1.0"); }
}
public override void DeInitialize()
{
if (Load != null) UnityEngine.Object.Destroy(Load);
}
public override void Initialize()
{
if (this.IsConnectedToAServer)
{
string answer = this.SendMessageToServer("ServerTime");
Time = answer;
Load = new GameObject();
test = Load.AddComponent<MainGUI>();
UnityEngine.Object.DontDestroyOnLoad(Load);
}
UnityEngine.Debug.Log("Loaded!");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace FogPlugin
{
public class MainGUI : MonoBehaviour
{
public void OnGUI()
{
GUI.Box(new Rect(10, 10, 100, 90), "Time" + Test.Time);
if (GUI.Button(new Rect(20, 40, 80, 20), " "))
{
}
}
}
}
I was talking about the screenshot not the codeI would love to, but I still have no time response on the server side xd, at the moment I have this:
C#:using System; using System.Collections.Generic; using System.Linq; using System.Text; using RustBuster2016Server; using Fougerite; namespace ClientCom { public class ClientCom : Fougerite.Module { public override string Author { get { return "Salva"; } } public override string Name { get { return "ClientCom"; } } public override Version Version { get { return new Version("1.0"); } } public override string Description { get { return "ClientCom"; } } public override void DeInitialize() { API.OnRustBusterUserMessage -= On_MessageReceived; } public override void Initialize() { API.OnRustBusterUserMessage += On_MessageReceived; } public void On_MessageReceived(API.RustBusterUserAPI user, Message msgc) { if (msgc.PluginSender == "FogPlugin") { string msg = msgc.MessageByClient; if (msg == "ServerTime") { string actualtime = World.GetWorld().Time.ToString(); msgc.ReturnMessage = actualtime; } } } } }
C#:using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using RustBuster2016.API; using UnityEngine; namespace FogPlugin { public class Test : RustBusterPlugin { public static string Time; public MainGUI test; private static GameObject Load; public override string Name { get { return "FogPlugin"; } } public override string Author { get { return "Salva"; } } public override Version Version { get { return new Version("1.0"); } } public override void DeInitialize() { if (Load != null) UnityEngine.Object.Destroy(Load); } public override void Initialize() { if (this.IsConnectedToAServer) { string answer = this.SendMessageToServer("ServerTime"); Time = answer; Load = new GameObject(); test = Load.AddComponent<MainGUI>(); UnityEngine.Object.DontDestroyOnLoad(Load); } UnityEngine.Debug.Log("Loaded!"); } } }
C#:using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace FogPlugin { public class MainGUI : MonoBehaviour { public void OnGUI() { GUI.Box(new Rect(10, 10, 100, 90), "Time" + Test.Time); if (GUI.Button(new Rect(20, 40, 80, 20), " ")) { } } } }
RenderSettings.fog = true;
RenderSettings.fogColor = Color.white;
RenderSettings.fogDensity = 0.1f;
RenderSettings.fogMode = FogMode.Exponential;
Camera.main.clearFlags = CameraClearFlags.Depth;
Camera.main.backgroundColor = new Color(0f, 0f, 0f, 0.02f);
I was talking about the screenshot, not the codeUps sorry!!
C#:RenderSettings.fog = true; RenderSettings.fogColor = Color.white; RenderSettings.fogDensity = 0.1f; RenderSettings.fogMode = FogMode.Exponential; Camera.main.clearFlags = CameraClearFlags.Depth; Camera.main.backgroundColor = new Color(0f, 0f, 0f, 0.02f);
//btn fps+
if (GUI.Button(new Rect(3, 3, 113, 18), "FPS+", buttonStyle))
{
if (!loadDefault)
{
heightmapPixelError = Terrain.activeTerrain.heightmapPixelError;
detailObjectDistance = Terrain.activeTerrain.detailObjectDistance;
treeDistance = Terrain.activeTerrain.treeDistance;
treeMaximumFullLODCount = Terrain.activeTerrain.treeMaximumFullLODCount;
loadDefault = true;
}
if (fpsBoostActive)
{
Terrain.activeTerrain.heightmapPixelError = heightmapPixelError;
Terrain.activeTerrain.detailObjectDistance = detailObjectDistance;
Terrain.activeTerrain.treeDistance = treeDistance;
Terrain.activeTerrain.treeMaximumFullLODCount = treeMaximumFullLODCount;
fpsBoostActive = false;
}
else
{
Terrain.activeTerrain.heightmapPixelError = 110;
Terrain.activeTerrain.detailObjectDistance = 0;
Terrain.activeTerrain.treeDistance = 225;
Terrain.activeTerrain.treeMaximumFullLODCount = 0;
fpsBoostActive = true;
}
}
Then i don't know what you did with your pc but not somthing that people regular doYes, I know, my pc stinks of shit.
I really would like to be able to achieve this on my server, I wonder, if these changes are included in the rustbuster?
or should I use a plugin ??
thanks for the help, and sorry for my bad english
Yes, I have it done on my server, but in a much more complex and tedious way ... the code above is only the tip of the iceberg, I will try to do something simple if I get some free time these days@salva
205/5000
More or less I have a programming base, I will try to do it with the codes published above, anyway a little help would not be bad, if you could do it, I would really appreciate it, regards!