Skip to content

[Request] Donate Announce

Featured Replies

Yo,

 

i've been looking for a script like when you set someone donator and he login.

 

"Announcement: Donator: %name% has been logged in.

 

:) thanks <3

if (activeChar.isHero() );
         else if (activeChar.isHero())
         {
            Announcements.getInstance().announceToAll("Hero Character " + activeChar.getName() + "  Class: " + activeChar.getClassId() + " is now online!");

check that

if (activeChar.isDonator())
{
           Announcement.getInstance().announceToAll("Donator " + activeChar.getName() + " has been logged in!");
}

To make that work you should already have Donator system implemented may donator method does not exist in your pack but use the correct one.

        if (Config.ALLOW_DONATOR_ANNOUNCE && activeChar.isDonator())
        {
            String announce = Config.DONATOR_ANNOUNCE.replaceAll("%PLAYERNAME%", activeChar.getName());
            Announcements.getInstance();
            Announcements.announceToAll(announce);
        }

 

Here is my code. Just make a boolean for ALLOW_DONATOR_ANNOUNCE + a string for DONATOR_ANNOUNCE.

 

Config must look like that :

 

# Allow announce on Donator login.

AllowDonatorAnnounce = True

# Announce on Donator login.

DonatorAnnounce = Donator %PLAYERNAME% has logged in!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.