Author Topic: Server coding?  (Read 1840 times)

0 Members and 1 Guest are viewing this topic.

Offline Becker-

  • Donator
  • *
  • Posts: 2470
    • View Profile
    • "The Gang joins the Army"
  • Nick: Bring back the 54th.
  • Side: Confederacy
Server coding?
« on: February 03, 2014, 07:33:06 pm »
So I'm pretty bad when it comes to looking things up, but I have been wondering for some time now, how do the EU servers get the welcome message going when you first enter the server?

We would like to use it for our group fighting server as it is a good way to get the rules out to the people so I don't have to keep yelling look at the rules! They should already have it. As well as showing the clients unique ID?

Anybody willing to share?

Thanks,
Becker

Offline Felix

  • Brigadier General
  • *
  • Posts: 283
  • Totally Not A Cat.
    • View Profile
    • Arctic Servers
  • Nick: [Arctic-Servers]_Felix
  • Side: Neutral
Re: Server coding?
« Reply #1 on: February 03, 2014, 08:40:49 pm »
Hello,

Here's a variation of what I believe your looking for which was released publicly on the forums, you could easily modify it to show in different ways or with different information as long as you have a little knowledge of the module system.

Code:
Spoiler
I just added you. BTW, i scripted it for you this time. If anybody else would like to have a welcome string popping up when a player joins a server, here is what you have to do:

Create a new string in module_strings, for example:

Below

Code
 ("mp_walloon_farm_flag_6","Redoubt"),

Add

Code
  ("welcome_message_33rd","Welcome {s3} to 33rd Official Siege Server"),

You can replace the "33rd Official Siege Server" with whatever you want, but always keep the {s3}. That's the player name.

In module_scripts get to the script  "multiplayer_server_player_joined_common" and:

Below

Code
 (player_set_slot, ":player_no", slot_player_join_time, ":player_join_time"),
 (player_set_slot, ":player_no", slot_player_first_spawn, 1),

Add:

Code
  
 (str_store_player_username, s3,":player_no"),
(str_store_string, s4, "str_welcome_message_33rd"),
  (call_script, "script_multiplayer_broadcast_message"),

That should be it! Save and compile the files, then upload them on your server. It should print a message viewable by everyone when a player joins a server.
[close]

The codes which are used on the EU GroupFighting_Server to track stats and show the welcome message only to the player were made by myself and I don't plan on sharing them anytime soon but as I said you could easily edit the above code to get a similar result, just a little bit of effort required. You could probably add me on steam if you needed a little help with that.

Kindest Regards,
Felix

Mount & Blade Series - Game Server Provider
Contact me via a method below regarding renting a server.
E-Mail: felix@arcticservers.co.uk • Steam: Felix9112  • Skype: ArcticServers •

Offline Becker-

  • Donator
  • *
  • Posts: 2470
    • View Profile
    • "The Gang joins the Army"
  • Nick: Bring back the 54th.
  • Side: Confederacy
Re: Server coding?
« Reply #2 on: February 04, 2014, 04:48:50 am »
Alright I'll definitely be adding you on steam as I am almost completely illiterate when it comes to this sort of stuff.



Update*

I broke the server. Help I need an adult!
« Last Edit: February 04, 2014, 05:09:49 am by The Becker »