Hello guys!
How can I get the number of players online on my server into my mod?
Thx
Hello guys!
How can I get the number of players online on my server into my mod?
Thx
Thx! So this one takes only the “currently online players”? Not “all the players which have a character on the server”?
You’d have to query your database for that.
Tested and approuved. It works for the number online players.
Thx!
And how can you display it eg in a widget?
Nobody knows how to display it in a widget
Create a variable in your widget, then in whatever calls the widget:
Run the player count function
Create widget
Use return value to set value inside of widget
Add to viewport
Make sure in the widget your text box is promoted to a variable and there is a Get Text function for it.
Thanks for the reply, but could you please explain it somewhat, I am still a beginner.
I already have a widget that you can open with F1.
Only now I do not know exactly what you mean.
For the widget, click your textbox then on the right go down to Contents > Text and create a binding for it. It’ll pull up the graph. Just get the variable and return the node.
Thanks for the help, I can not go any further.
This is my bind in the widget
Top left of picture #1, press “+Variable” and then in the details window at the bottom there, switch it to an integer or string.
The return value from Create Widget, the blue dot. Drag it out and it gives you access to all variables in the widget. Just type “Set output”
When I enter set output appears with me nothing
You have to create the variable Output inside the widget. I meant to say picture 3 of that post, the one of the Get Text function
Thanks, just now the widget does not open anymore
Did you remember to add to viewport?
You did forget to connect the arrows, though. The graph stops at create widget. You have to reattach it to set output