AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Basic Donator Interface (https://forums.alliedmods.net/showthread.php?t=122315)

toazron1 03-25-2010 14:43

Basic Donator Interface
 
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.

toazron1 03-25-2010 14:44

Re: Basic Donator Interface
 
Plugins using this interface:

TF2: Donator Recognition

bouncer 03-25-2010 17:58

Re: Basic Donator Interface
 
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.

toazron1 03-25-2010 18:05

Re: Basic Donator Interface
 
This reads a database to get who is a donator, it does not currently have anyway of using flags to set donators.

bouncer 03-25-2010 18:17

Re: Basic Donator Interface
 
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

toazron1 03-25-2010 18:34

Re: Basic Donator Interface
 
That is an interesting setup, but just checking "o" is far too simple for what I'm looking to accomplish with this.

Rob1991 03-25-2010 18:37

Re: Basic Donator Interface
 
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?

toazron1 03-25-2010 18:42

Re: Basic Donator Interface
 
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.

Rob1991 03-25-2010 18:54

Re: Basic Donator Interface
 
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.

toazron1 03-25-2010 19:08

Re: Basic Donator Interface
 
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.

bouncer 03-25-2010 19:11

Re: Basic Donator Interface
 
Ah I wish your other plugin with the donator thing on top of head would work simply on checking if the user has custom flag o.

Could you possibly edit that plugin and make it just work by itself without this plugin necessary please? :)

MjrNuT 03-25-2010 19:41

Re: Basic Donator Interface
 
(subscribed)

toazron1 -- Kudos on providing this asset!!

Quote:

This plugin provides a back end for other plugins to interface with, acting as a core to simplify adding donator support to existing / new plugins.
I think alot of people that have the skills will take advantage of your core plugin. It makes sense considering so many different ways server admins desire to implement their Donor system.

I'd like to suggest, if possible, that you put up some screenshots demonstrating the extent of this so far. Just might help the more visually stimulated people, but its not absolutely needed.

I look forward to other authors being able to utilize your core here.

Thanks alot!

toazron1 03-25-2010 19:53

Re: Basic Donator Interface
 
It is possible but it would need to be stripped down a little. If I can find some time tomorrow I will PM you.

toazron1 03-25-2010 20:05

Re: Basic Donator Interface
 
Quote:

Originally Posted by MjrNuT (Post 1128849)
I'd like to suggest, if possible, that you put up some screenshots demonstrating the extent of this so far. Just might help the more visually stimulated people, but its not absolutely needed.

The only screen shot would be the menu plugins can register with, but that is just a menu :)

onlyamd 03-26-2010 19:45

Re: Basic Donator Interface
 
Any possible way that you can make a cvar to impliment flags instead of having to create a sql database? All my donators get privs from reading a flag. This would be much appreciated....thanks for your efforts.

Thrawn2 03-26-2010 20:25

Re: Basic Donator Interface
 
nice work.
my suggestion/question regarding flags vs mysql. have natives allowing plugins to set who's a donator. this way you could make one plugin using a rather complex mysql setup and another which is just looking at the custom flags. and another one allowing admins to set clients temporarily by menu. or whatever someone wants. uhm, peel another layer of that core.
btw, what exactly is the donator level?

Thrawn2 03-28-2010 08:32

Re: Basic Donator Interface
 
1 Attachment(s)
A simple plugin interfacing with tLevelmod, tAttributes and this (awesome) Donator Interface to give Donators 2 Attribute Points for leveling up. (The normal attributes.bridge.levelmod is still needed.)

Grundy 04-07-2010 13:10

Re: Basic Donator Interface
 
Good idea but this plug in is far too complicated for the average server admin to use (like me).

If you want it to be more wide spread, you need to start thinking more like a server admin and less like a coder. ;P

naris 04-12-2010 23:48

Re: Basic Donator Interface
 
Quote:

Originally Posted by Grundy (Post 1142572)
Good idea but this plug in is far too complicated for the average server admin to use (like me).

If you want it to be more wide spread, you need to start thinking more like a server admin and less like a coder. ;P

Then, Look at the other plugin here --> http://forums.alliedmods.net/showthread.php?p=1128547, which IS meant for server admins such as yourself.

This plugin is MEANT for other plugin authors to use to write plugins such as that one.

HeroXx 05-03-2010 19:40

Re: Basic Donator Interface
 
Is it possible to connect this to SourceBans?

BDeep 05-05-2010 08:29

Re: Basic Donator Interface
 
I agree that this is a cool plugin, although it would be nice if someone did something for CSS. It seems that its all for TF2 :cry:.

naris 05-05-2010 23:51

Re: Basic Donator Interface
 
Quote:

Originally Posted by BDeep (Post 1171299)
I agree that this is a cool plugin, although it would be nice if someone did something for CSS. It seems that its all for TF2 :cry:.

The basic donator plugin doesn't have any mod specific code in it, so it should work with any mod.

The only mod specific thing in the donator_recognition plugin are the events it hooks. However, I have modifed it to detect which mod it is running in and hook the appropriate events, so it should work just fine in CSS and DODS. It can be found in this thread: http://forums.alliedmods.net/showthread.php?t=122320

The donator.colorchat.tf2 plugin also doesn't have any mod-specific code in it, so it should work just fine in CSS or any other mod.

Thraka 05-10-2010 02:27

Re: Basic Donator Interface
 
Is it possible to attach the compiled version? The web compiler won't do it.

justincase 05-15-2010 22:52

Re: Basic Donator Interface
 
I would like a compiled version. :(

psychonic 05-25-2010 15:14

Re: Basic Donator Interface
 
The first post is missing the plugin header, possibly from being saved twice after using quick-edit.

Please repost in a new thread so that it can be approved.

Rads 05-25-2010 22:39

Re: Basic Donator Interface
 
Plugin failed to compile!

psychonic 05-26-2010 07:38

Re: Basic Donator Interface
 
Quote:

Originally Posted by Rads (Post 1191330)
Plugin failed to compile!

As do all that use custom includes. You have to compile it locally.

Mikey 05-29-2010 03:54

Re: Basic Donator Interface
 
Quote:

Originally Posted by psychonic (Post 1191572)
As do all that use custom includes. You have to compile it locally.

And how do we do this?

Rob1991 06-18-2010 09:23

Re: Basic Donator Interface
 
I cant not get this working to save my life! I have no idea what is being explained with the MySQL stuff, I know what mysql is, but no idea what to do to set this up.

Quimbo 06-20-2010 09:12

Re: Basic Donator Interface
 
Thanks for the plugin, here are some comments:

sm_reloaddonators should update the local g_bIsDonator array after completion. Right now you only do this when a player connects so changes to the DB aren't reflected immediately after sm_reloaddonators is triggered.

Would be helpful to have a DonatorsReloaded forward. Plugins which use your interface right now can only rely on OnDonatorConnected. That means changes reloaded by sm_reloaddonators aren't reflected immediately too unless the plugin iterates all players each time when a donator status has to be queried.

wawazy 08-30-2010 13:06

Re: Basic Donator Interface
 
i try compile localy failed

same when i try the web compiler

-->cannot read from file donator

maybe me im noob lol

wa

Death [GER] 09-01-2010 03:08

Re: Basic Donator Interface
 
You should maybe put the donator.inc file inside the include folder in scripting..

Thats why it wont work online, because you cant put that file there..
But localy you can

Sniper214 10-05-2010 02:36

Re: Basic Donator Interface
 
Code:

CREATE TABLE IF NOT EXISTS `donators` (
      `steamid` varchar(64) default NULL,
      `tag` varchar(128) NOT NULL,
      `level` tinyint(1) NOT NULL default '1',
    )



There should not be a comma after the '1' it will error out if there is one.

Matheus28 12-01-2010 13:51

Re: Basic Donator Interface
 
Add something like donator duration, so it removes the player donator status automatically

thatdarnkid 12-06-2010 12:11

Re: Basic Donator Interface
 
Wish I could download this, but as it's been said before, I can't seem to get the bloody thing to compile.

And it seems that nobody here knows how to compile this thing, because if anyone did, they'dve responded to the 2 or 3 other people before me who can't figure out how to compile this.

FaTony 12-06-2010 13:16

Re: Basic Donator Interface
 
Quote:

Originally Posted by thatdarnkid (Post 1364582)
Wish I could download this, but as it's been said before, I can't seem to get the bloody thing to compile.

And it seems that nobody here knows how to compile this thing, because if anyone did, they'dve responded to the 2 or 3 other people before me who can't figure out how to compile this.

At first glance I'll point you to page 123 (119 printed on page) of http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

thatdarnkid 12-06-2010 13:38

Re: Basic Donator Interface
 
Quote:

Originally Posted by FaTony (Post 1364634)
At first glance I'll point you to page 123 (119 printed on page) of http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Aaaand I don't have Adobe Reader, nor do I plan on downloading it.

toazron1 12-17-2010 12:13

Re: Basic Donator Interface
 
This has been update and reposted (since this one broke)

http://forums.alliedmods.net/showthread.php?t=145542


All times are GMT -4. The time now is 18:17.

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