View Full Version : Session Info, Lap Times info and Chat Commands Lua Addons

27-10-2015, 22:41
Well, i've been working on a few addons that provides more information for the Players.

So here is my contribution so far:

1) Session Info Addon (sessionInfo):

One of the main problems that i've noticed is the lack of info when you join a server. You always have to load the game to know exactly what is the current Stage and what's the time left.
So this Addon Prints the Session info to the player that just joined the Lobby. It works pretty much like the sms_motd Addon.

Example when joining in Lobby state:


Download: 220939

2) Lap Times Addon (lapTime):

Other things that i thought could be usefull is to print certain events on the Chat (not the better way, but since we can't access the Crew chief info, it's the only thing we got).
This Addon prints info when 3 events happen:

2.1) On Qualy, if you set a Valid Lap and your new position is 1, 2 or 3 (prints "Position , Player Name and Lap Time ")



2.2) On Race, when the first 3 players completes a lap (prints "Position , Player Name and Lap Time ")
2.3) On Race, when a Lap completed is the Fastest Lap of the current stage (prints "Player Name and Lap Time").



Download: 220943

3) Chat Commands Addon (chatCommands):

4 avaible commands: /ping, /pingAll, /currentSession and /kick "player_name".

Another usefull information, at least for leagues and private race is the player's ping.
With this Addon you can write the commands /ping and /pingAll to view your Ping and all player's ping.

Also implemented is the /currentSession, which returns the Current session Info just like the Session Info Addon.

All of the 3 commands are returned only to the player who entered the command through the Chat box.

Another avaible command is the /kick "player_name". This command is only avaible to the host of the session.
The player name need's to be inside the quotes and exactly like it's listed on the lobby screen, or it won't recognise.



Download: 220941

4) Kick cars not moving (kickCarsNotMoving)*:

I was actually not going to share this one, since it's a really simplistic way to achieve the objective (kick the players which cars are actually not moving) and only works for the cars that actually don't get to the 1st sector of the track.
If someone stop his car after completing the 1st lap, this addon won't do anything.

The logic here is:
When the player who is in First position cross the Sector number 2 off the track, the addon checks if every other player has already crossed Sector number 1. If not, it kicks the player.
Like i said, it's quite simple and sure not the better way to achieve the complete objective.
But on the tests that i made on the public sessions, it worked fairly well for those players that just doesn't move when the race starts (when you get to complete the 1st lap, you're not gonna see those cars standing on the starting grid).
It will print on the Chat the players the got kicked for this reason.

Download: 220942

And that's it.

Installation steps:
1) Download the Addon .rar file.
2) Extract the folder from the Addon on the 'lua' folder (usually C:\Program Files (x86)\Steam\steamapps\common\Project CARS Dedicated Server\lua)
3) Inside the folder will be the 3 necessary files for the Addon.
4) Edit your server.cfg file and on the "LuaApi configuration", find the "luaApiAddons : [" and add the Addon name. (Ex.: "sms_stats", "egb_chatCommands", "egb_sessionInfo",] )

I'm actually gonna give some time from the game now.
The currently championship i'm participating ends on Thursday and it became quite impossible to hold the players with all the bugs (mostly replay problems and results data) and limitations from the MP. We Started with 24 players a month ago and now we have only 9.
I've tried to make a few more ellaborated addons (vote system and an actual kick cars that are not moving - get the car's position), but the effort to acomplish those are quite heavy, at least for me (haven't programmed anything in the last 6 years).

If you guys need some changes or find any bug's, please let me now.
Fell free to make any changes you like as well. Only thing i ask is to share with us !

28-10-2015, 22:23
Good Work mate. It is possible to addon to announce every lap of every driver?

29-10-2015, 15:04
Good Work mate. It is possible to addon to announce every lap of every driver?

Sure is.
My initial implementation was doing exactly like this.
But when I ran a server to test, it proved to be quite spammy.
Also, the chat letter and colour from server messages is dark and the size and time to be displayed on screen doesn't help much.

Anyway, if you still want it, I can do a separate version to print for all drivers. Just let me know.

12-03-2016, 17:44
thanks for this :)

24-04-2016, 16:17
Testing it right now, very good job! Hope you'll continu to provide good stuffs.

26-04-2016, 10:51
i'm verry thank you!
We run all your tools at ouer Malzbierbude.de Servers, they are working verry well!
I raised the laptime player count up to 5, the users ask for it, maybe i try 10 next time...this and cars not moving are the best addons for us atm!

Ceep up this good work!