Raised This Month: $51 Target: $400
 12% 

Basic Donator Interface


Post New Thread Reply   
 
Thread Tools Display Modes
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
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 14:44   Re: Basic Donator Interface
Reply With Quote #2

Plugins using this interface:

TF2: Donator Recognition
__________________

Last edited by toazron1; 03-25-2010 at 15:25.
toazron1 is offline
Send a message via AIM to toazron1
bouncer
Veteran Member
Join Date: Apr 2009
Old 03-25-2010 , 17:58   Re: Basic Donator Interface
Reply With Quote #3

question...
the db that u wrote about setting up named donators, thats to fetch from db all donators so it knows who's a donator in server right?

What if a client on connect is given custom flag o (our donator flag) , would this plugin then see him as a donator?

How to change all instances of your flag to my flag o?
cause I can't figure out what flag you're using.
__________________


bouncer is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 18:05   Re: Basic Donator Interface
Reply With Quote #4

This reads a database to get who is a donator, it does not currently have anyway of using flags to set donators.
__________________
toazron1 is offline
Send a message via AIM to toazron1
bouncer
Veteran Member
Join Date: Apr 2009
Old 03-25-2010 , 18:17   Re: Basic Donator Interface
Reply With Quote #5

Ah I would use it.. but I realy don't want to create new database and all that... too much.

I rather have plugin check if the user has flag o . Cause we have another plugin that automatically assigns players' flags depending on what usergroup they are in on our vbulletin site.

It basically automatically gives them admin rights depending on their usergroup on our site


So yeah... would use it gladly but unfortunetly wont I guess since it doesnt work on checking if person has flag o
__________________


bouncer is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 18:34   Re: Basic Donator Interface
Reply With Quote #6

That is an interesting setup, but just checking "o" is far too simple for what I'm looking to accomplish with this.
__________________
toazron1 is offline
Send a message via AIM to toazron1
Rob1991
Junior Member
Join Date: Mar 2010
Old 03-25-2010 , 18:37   Re: Basic Donator Interface
Reply With Quote #7

Is it possible to set this up with the following?

Premium / VIP

- VIP Skin
- Immunity to Team Swap
- Immunity to vote kick/ban/mute
- Immunity to high ping kicker
- Free defusal when CT each round
- Free HE, FLASH, SMOKE - Flash disabled for non VIP
- Set $200 at round start

Can you help me set this up? Im not sure about this plugin or how it works. Is the above possible?
Rob1991 is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 18:42   Re: Basic Donator Interface
Reply With Quote #8

Short answer: No.
Long answer: Yes, but that is not within the scope of this plugin since it is a core. You would need to make (or have someone make) a separate plugin which hooks into this one using the forwards and natives.
__________________
toazron1 is offline
Send a message via AIM to toazron1
Rob1991
Junior Member
Join Date: Mar 2010
Old 03-25-2010 , 18:54   Re: Basic Donator Interface
Reply With Quote #9

Ahh ok thanks for your reply anyway. Would it be hard to make these separate plug-ins to do this? I wouldn't know where to start.
Rob1991 is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 03-25-2010 , 19:08   Re: Basic Donator Interface
Reply With Quote #10

I don't code for any other game than TF2, but I don't think it would be hard for someone to make that and hook it into this one.
__________________
toazron1 is offline
Send a message via AIM to toazron1
Reply



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 19:54.


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