How to i make a cui appear on a players screen when they load into the server?
Make a CUI show on player load?Solved
Should be some code in ServerInfo near 'private void ShowInfo' line 277.
RyanFromRust
Should be some code in ServerRewards near 'private void ShowInfo' line 277.
Can u link the plugin?
I can't find a private void showinfo anywhere in the plugin. But i tried adding the ui to the player in onserverinitialsed, because that worked in another plugin i saw, but that doesn't seem to work for me.RyanFromRust
dude i'm a dumbass. Server INFO not server rewards. (I'm looking in server rewards like, wtf where was it??)
https://umod.org/plugins/server-info
I updated my previous responses
https://umod.org/plugins/server-info
I updated my previous responses
RyanFromRust
dude i'm a dumbass. Server INFO not server rewards. (I'm looking in server rewards like, wtf where was it??)
https://umod.org/plugins/server-info
I updated my previous responses
Thats look like its just a chat command. I already have a chat command for the ui. What im looking for is a way to get the ui to appear when a player loads into the server.
It's in there. I'm not saying this is gonna be an easily copied/pasted chunk into your script, I just mean that the mod, ServerInfo, show's a CUI when people login, and that you could look through that mod's code for examples.
private void OnPlayerInit(BasePlayer player)
{
if (player == null || _settings == null)
return;
if (player.HasPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot))
{
timer.Once(2, () => OnPlayerInit(player));
return;
}
PlayerInfoState state;
PlayerActiveTabs.TryGetValue(player.userID, out state);
if (state == null)
{
state = new PlayerInfoState(_settings);
PlayerActiveTabs.Add(player.userID, state);
}
AddHelpButton(player);
if (!state.InfoShownOnLogin)
return;
if (state.InfoShownOnLoginOnce && checkedPlayers.Contains(player.userID))
return;
ShowInfo(player, string.Empty, new string[0]);
if (state.InfoShownOnLoginOnce)
checkedPlayers.Add(player.userID);
}at the end of this OnPlayerInit it calls ShowInfo, line 277, which can be called by a chat command, or invoked internally (like it's being done in this example) I beleve onplayerint no longer works you must use OnPlayerConnected
Sagacious.
I CAN PASTE FROM MOBILE!
@WULF @CALYTIC THANK YOU!
I CAN PASTE FROM MOBILE!
@WULF @CALYTIC THANK YOU!
I fixed it, thanks everyone for the help :)
Locked automatically