Welcome Message plugin

Discussion in 'Plugins' started by Tygernoot, Mar 11, 2012.

  1. KAMPFBIBER81

    KAMPFBIBER81 Registered

    Joined:
    Dec 12, 2012
    Messages:
    34
    Likes Received:
    4
  2. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    WelcomePlugin v1.3

    -- Changes in v1.3 -- build by Gerald Jacobson
    - Add a WecomePlugin.ini file to put in the data profile directory
    - Allows you to set mass for given driver as soon as they join the server

    Here an example to set the mass penality to 52kg for Gerald Jacobson
    Code:
    [Gerald Jacobson]
    mass=52
    
     
  3. Mee

    Mee Registered

    Joined:
    Oct 4, 2010
    Messages:
    154
    Likes Received:
    13
    One modification I'd like to see on this: if a driver doesn't need extra weight (in our league, it's only the top 5), can the execution of the /setmass command be skipped?

    Other than this, it works like a charm!
     
  4. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    How do you see the ini file ? as i think this weight penaly is apply to the top 5 of the previous race and not the current rank in the session. So it is like you edit the ini by setting the 5 names and there penalities.

    So please tell me how you think it should be.
     
  5. Mee

    Mee Registered

    Joined:
    Oct 4, 2010
    Messages:
    154
    Likes Received:
    13
    The ini would have:

    Code:
    [Driver 1]
    mass=50
    
    [Driver 2]
    mass=40
    ...
    [Driver 5]
    mass=10
    /stop
    
    This mass is indeed from the previous race/standing in the championship, not from a current or previous session.
    So when someone joins the server in practice the following days/weeks, the plugin checks if the name is in the WelcomePlugin.ini. If it is, it applies the given mass. If it isn't, it just does nothing.

    Looking at your code, it think it's just a case of adding an if-statement:
    Code:
    int mass = GetPrivateProfileInt(strDriver.c_str(), "mass", 0, iniConfigFilename.c_str());
    [COLOR="#FF0000"]if(mass != 0)
    {[/COLOR]
         std::ostringstream oss;
         oss << "/setmass " << mass << " " << strDriver.c_str();
         m_MessageQueue.push_back(oss.str());
    [COLOR="#FF0000"]}[/COLOR]
    :)
     
  6. TPG

    TPG Registered

    Joined:
    Mar 12, 2014
    Messages:
    409
    Likes Received:
    2
    Thank you for this plugin Gerald, it works great..
     
  7. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Indeed, i forgot the "if".

    WelcomePlugin v1.4

    -- Changes in v1.4 -- build by Gerald Jacobson
    - Avoid to send /setmass command when there is no mass to apply
     
  8. Mee

    Mee Registered

    Joined:
    Oct 4, 2010
    Messages:
    154
    Likes Received:
    13
    Fantastic, thanks a lot!
     
  9. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    Thank you for this plugin- the setmass thing is as valuable as the Welcome text itself.

    I'm very confused by the commands for mass though.

    If I do not want to set extra mass for someone, do I simply do nothing?

    If I want to add mass to a particular driver, is it still like this?
    [Driver 1]
    mass=50
     
  10. Mee

    Mee Registered

    Joined:
    Oct 4, 2010
    Messages:
    154
    Likes Received:
    13
    Yes and yes :).
     
  11. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    thank you
     
  12. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    I was just testing this on my server and v1.4 does not work to set the mass penalty. Before each line there is a /w command and I think that is negating the command to apply weight. I can still manually apply weight. View attachment 14090

    This is what comes up once the plugin loads.

    Many of our drivers have the [VSCR] tag on their name- could that cause a problem?
     
  13. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    I just tried to have the lines to set the mass penalty only and it didn't help. (no welcome message and only 1 person getting the mass for a total of 2 lines)
     
  14. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    You're doing it wrong mate.

    The
    [Richard Goodwin]
    Mass = 32

    Goes in to the INI file included in the download. This is then placed inside the server player data folder.

    I don't know the correct name for it.....the one where the multiplayer json file is.

    Edit: I dunno if the prefix is causing the issue. Just assuming you're doing it in the wrong file.
     
  15. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    :eek: OK, I was putting the lines in the WelcomeText.txt instead of the WelcomePlugin.ini

    But it still doesn't work. I added the weight penalty for myself and entered my server and nothing happens. Is there a limit to the number of people who can get a penalty? Could the [VSCR] tag mess up the command? Will the text come up in the chat box saying that the weight penalty has been applied? It does when I manually add weight to a car.
     
  16. Mee

    Mee Registered

    Joined:
    Oct 4, 2010
    Messages:
    154
    Likes Received:
    13
    Yes, the text shows up.

    Having those square brackets [ ] between the other brackets may well be the problem.
     
  17. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    Is there a way around that? A lot of groups use tags and it is common to use brackets.
     
  18. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Hello,
    WelcomePlugin v1.5

    -- Changes in v1.5 -- build by Gerald Jacobson
    - If the driver name contains bracket "[" or/and "]" (for those using tag prefix), in the ini section name, change those brackets by a star "*"
    Ex: if the driver is named: [GR] Gerald Jacobson
    The ini section must be:
    [*GR* Gerald Jacobson]
     
  19. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    Awesome Gerald.
     
  20. Guy Moulton

    Guy Moulton Registered

    Joined:
    Jan 12, 2012
    Messages:
    2,310
    Likes Received:
    16
    Last edited by a moderator: Aug 27, 2014

Share This Page