Jump to content

[HELP] Web Scoreboard


koragg

Recommended Posts

I tried to add my server's scoreboard to my website using the webadmin resource. But it asks every player who visits the link (http://5.196.159.12:22095/scoreboard/) to login with their in-game username and password in order to see the scoreboard. How can I remove that login restriction so that anyone can view the scoreboard by going to that link?

And another, for now, less important question is: How to change the width of the columns and show their friendlyName instead of columnName?

Link to comment

So I managed to fix the column names thing today but still need help with two things:

1. How to remove that login request every time I visit the link?

2. How to make the following work (it's in CSS):

For example I have this:

td.player#Name {
	color: #FFFFFF;
	width: 15%;
}

and that makes the "Name" column be 15% wide and it's content to be white. Now I wanna know how to do the same but for this column:

td.player#Player State {
	color: #FFFFFF;
	width: 6%;
}

The problem is that the space after "Player" and before "State" kind of bugs the CSS and it doesn't work. Is there any 'white-space symbol' specific for CSS or any other way to make it work?

Link to comment

I fixed it the following way:

In the scoreboard.js file there is

var columnName = columns[i].friendlyName.htmlEntities();

After a few searches around the net I figured out how to fix it by using the javascript replace method from the function "htmlEntities" and made another function called "htmlEntitiesFix" which is literally the same only with an extra

.replace(/>/g,'>').replace(/ /,'_')

at the end. This way all spaces in the column name (note: not in the rows, just columns) get replaced by an underscore "_". So now in the .css I easily do this

td.player#Player_State {
	color: #FFFFFF;
	width: 4%;
}

and there's no problems at all. Yeah, sure there is an underscore but that's seen only in the web scoreboard and only in 3 of the column names so it's no big deal at all.

But I still cannot figure out why it keeps asking everybody for their in-game username and password when they visit the link to view the scoreboard: http://www.classicracing.tk/scoreboard.html

At my race clan's site (http://www.fullysik.net) the scoreboard is embedded into the home page the same way (I asked my boss to give me the SiK site's files :P) so I don't think it's a script problem. Maybe some setting somewhere? That's the last and actually the biggest problem that I have had since the start with the web scoreboard.

PS: Also in webadmin all resources are in the "Everyone" under "Groups" but t still wants authentication (SiK's owner told me that this can be a problem if it isn't in that group).

Link to comment
8 hours ago, pa3ck said:

Might be useless, but have you look at this yet: 


include( "mta_sdk.php" );
$mtaServer = new mta("example.com", 33004, "myUsername", "myPassword" );
$mtaServer->getResource("someResource")->call("someFunction");

Source: https://wiki.multitheftauto.com/wiki/PHP_SDK

Um, I searched for this and there is nothing like it anywhere in the 'resources' folder according to Notepad++ :|

Link to comment
1 hour ago, pa3ck said:

That should be in the PHP when you create the "mta instance" and call some resource functions. In your PHP code search for "new mta" and see if it passes your MTA credentials. 

Oh in that case, no. It's not a php script that I use, just a simple iframe in a html.

Link to comment
3 hours ago, kikos500 said:

I'm not sure about it but i think this what you are searching for

https://wiki.multitheftauto.com/wiki/Server_mtaserver.conf

check the auth_serial_http part

i searched in most mta files now i still can't find anything related to login so i think you can turn it off from mta server configuration file

I changed it from '1' to '0' and restarted the server but nothing changed... it's still asking for username and password every time i visit the link. 

Link to comment
  • 11 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...