Due to human (non-bot) spam the first contribution of a user has to be reviewed and activated manually, all further contributions do not require this.
As long as a user does not have at least one reviewed and activated contribution, the user is unable to edit his profile, set a avatar, title picture or a signature.
  • Hello,

    I'm trying to write a small mod that lets players rename their currency in Eco.
    I have managed to actually renaming the currency, but, my issue is that when you restart the server, the game seems to be generating new currency for users that don't have one named after them (Username Credits).

    So say I was on a server, I would have a currency by the name "Son_Of_Diablo Credits", if I then rename that currency to "Super Awesome Currency" and restart the server, I would then have both "Son_Of_Diablo Credits" and "Super Awesome Currency" attached to my player.

    I understand why the game does this, it's to make sure every player has their own currency, specially when new people join a server.

    But it's not really what I'm looking for.

    My code looks like the following for renaming currency:

    C#
    [ChatCommand("Renames the users Currency", ChatAuthorizationLevel.User)]
            public static void RenameCurrency(User user, string newName)
            {
                Currency currency = EconomyManager.Currency.Currencies.ToDictionary(c => c.Owner, c => c)[user.Name];
                string oldName = currency.CurrencyName;
                currency.SetName("(" + newName + ")");
                ChatManager.ServerMessageToAllAlreadyLocalized(user.Name + "has renamed their currency from " + oldName + " to " + currency.CurrencyName + "!", true);
            }

    Does anyone know if there is a way to override the generation of new currency on server start?
    Or would I have to have my mod cleaning up the currency if I want to do this?


    Thanks in advance!
    [automerge]1524014080[/automerge]
    I managed to fix the issue by using mampf's mod Asphalt-ModKit using the OnPlayerJoin event.

    This is really messy and I really don't like it.
    I tried the Initialize method of the IInitializablePlugin too, but it seems like the currency gets added both before and after that event for some reason.

    If anyone has any better suggestions please let me know!

    Updated Code:

    I chose to let the commented out lines of code stay so you can see what I have tried before hand :)

    Einmal editiert, zuletzt von Son_Of_Diablo (18. April 2018 um 03:14)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!