Raised This Month: $ Target: $400
 0% 

Basic Donator Interface


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 14:43   Basic Donator Interface
Reply With Quote #1

Note: This plugin has moved
The new thread can be found here:
http://forums.alliedmods.net/showthread.php?t=145542


Information here left for thread legacy

Natives:
PHP Code:
/**
 * 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);

/**  
 * Sets a clients donator level
 *
 * @param iClient        Client
 * @param iLevel        Donator level
 * @return                Nothing
 */
native SetDonatorLevel(iClientiLevel);

/**  
 * 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[]);

/**  
 * Returns a clients connect message
 
 * @param iClient        Client
 * @return                Clients connect message
 */
native GetDonatorMessage(iClient, const String:szMessage[], iLength);

/**  
 * 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.
__________________

Last edited by toazron1; 12-17-2010 at 12:13.
toazron1 is offline
Send a message via AIM to toazron1
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode