/** * Register a menu item. * * @param name Name of the menu item. * @param func Callback for menu items. * @return Menu item ID. */ native DonatorMenu_RegisterItem(const String:name[], DonatorMenuCallback:callback);
/** * Get a clients donator level, -1 if invalid * * @param iClient Client * @return Donator level */ native GetDonatorLevel(iClient);
/** * Returns True if a client is a donator, -1 if invalid * * @param iClient Client * @return bool */ native bool:IsClientDonator(iClient);
/** * Returns True if a steamid is a donator, -1 if invalid * * @param iClient Client * @return bool */ native bool:FindDonatorBySteamId(const String:szSteamId[]);
/** * Sets a donators connect message * * @param iClient Client * @param szMessage Message to show on donator connect * @return Nothing */ native SetDonatorMessage(iClient, const String:szMessage[]);
Forwards:
PHP Code:
/** * Forwards when a donator connects. * * @param iClient Client * @noreturn */ forward OnDonatorConnect(iClient);
/** * Forwards for everyone (right after OnPostAdminCheck) * * @param iClient Client * @noreturn */ forward OnPostDonatorCheck(iClient);
Usage
For example, if you wanted to make donators immune to the auto team balance in gScramble you can add an IsClientDonator(client) check into the IsValidTarget(...) check to skip a player who is a donator.
Another feature is a centralized menu for plugins to register with which can minimize the amount of commands a player has to remember. This menu can be access by typing whatever CHAT_TRIGGER is set to (defaults !donators).
To register a menu with the core:
PHP Code:
public OnAllPluginsLoaded() { DonatorMenu_RegisterItem("MENU TITLE", MenuCallback); }
See one of the attached plugins for an example of a fully functional example.