AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   Loyalty Plugin 2.1.1 (Updated 10-31-10) (https://forums.alliedmods.net/showthread.php?t=139036)

Xsinthis 09-25-2010 15:18

Loyalty Plugin 2.1.1 (Updated 10-31-10)
 
1 Attachment(s)
Original Plugin By MikeJS, released by nightbox: http://forums.alliedmods.net/showthread.php?t=96355

/!\ Important! /!\ Upgrade instructions for 2.0.x to 2.1.x
With 2.1.x the _sourcebans has been dropped from the file, so when you add the new loyal.smx to your plugins file, you need to remove the old loyal_sourcebans.smx or else run into interferance

You *must* run the following query on your loyal table:
Code:

ALTER TABLE loyal
ADD bonus INT(8) NOT NULL

Also, the config file has been renamed to loyal.cfg, just to keep everything named the same.

About the Plugin
I've edit the original plugin to add support for servers running Sourcebans (specifically its admin handling), flatfile admin management, and cvars to allow easy customization of the plugin. Only tested with TF2 but should work with all source servers.

This plugin awards players loyalty points based on their participation on the server(10 kills = 10 assists = 10 minutes = 1 point by default) and allows users to purchase reserved slots via a !loyal command, and automatically deletes them when their time expires

This plugin works with flatfile, MySQL admins, and sourcebans.

Installation
If you are using sourcemods MySQL admins you must run the following query on the admin database:
Code:

ALTER TABLE sm_admins ADD adminuntil int(11) unsigned NOT  NULL
Sourceban users must run the following query on their sourceban database:

Code:

ALTER TABLE sb_admins ADD adminuntil int(11) unsigned NOT NULL
Add an entry in your database.cfg file for "loyal", where the loyalty points is stored. After that drop the .smx into your plugins directory, restart the server or map, and edit the cfg/sourcemod/loyal.cfg

No matter what method of admin management you chose you must create an admin group for the loyalty members, and specify it with sm_loyal_user_group. The plugin will automatically detect what admin method you use of the 3, and adjust itself to work with your current system. If you do not have have a sourcebans or admins entry in your database config file, it assumes you use flatfile. Plugin is compatible with sqlite.

Commands
sm_loyal <user> - Displays user's loyalty points. If left blank, opens up purchasing menu (!loyal)

sm_loyal_modify <user> <change> - Changes user's loyalty points by <change> amount, accepts negative numbers, requires root flag
Cvars
This plugin will automatically create loyalty.cfg in cfg/sourcemod
Code:

// Assists required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_assists "10"

// Loyalty point cost per week of reserved slot
// -
// Default: "300"
sm_loyal_cost "300"

// Kills required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_kills "10"

// What Sourcebans Server Group to add loyalty members too(if applicable)
// -
// Default: "All Servers"
sm_loyal_server_group "All Servers"

// Minutes of play required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_time "10"

// User group to add loyalty members too (Sourcebans only)
// -
// Default: "Loyal Members"
sm_loyal_user_group "Loyal Members"

// Version of Loyalty Plugin installed, do not touch
// -
// Default: "2.1.0"
sm_loyal_version "2.1.0"

TODO
- add options for point gaining disabling

Changelog
10-30-10 (2.1.1)
- Fixed typo in a SQL query (thanks ratonofx)

9-28-10(2.1.0)-Droped _sourcebans suffix
-Added automatic Sourceban checker(dropped sm_loyal_sourcebans)
-Added flatfile support
-Added fully automatic admin method detection(flatfile, sql, sourcebans)
-Added admin group use for all methods(untested for MySQL admins)
-Added bonus points column
-Added command to modify user's points
-Cleaned up minor coding issues

9-26-10(2.0.3)
- Fixed silly typo in version cvar
- Fixed error in menu selection that would allow you to select any option as long as you had enough for a week
9-25-10(2.0.2)
-Fixed an error in a query to remove outdated entries

(2.0.1)
-Added sm_loyal_version cvar for plugin tracking and general information

9-25-10(2.0.0 release)
- Plugin development taken over by Xsinthis

Enjoy!
And report any and all bugs you may find, this is the first plugin i have ever worked on so I would be surprised if it works flawlessly for everyone :P

mjmfighter 09-25-2010 21:36

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
Congrats on your first plugin, but i would like to make a feature request.

The ability to buy more than just one think. Such as buying skins, or high ping kicker ability. I think all it would have to do is instead of adding them to a group on sourcebans, just add tags to them in sourcebans.

I hope that makes sense. but congrats on ur first plugin

Xsinthis 09-25-2010 21:54

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
Well i didn't make it from scratch, but thanks :P

I'm guessing your talking about adding them individually? As in each one costs their own amount of points? Like they'd have to buy slots, skin, ping immunity would need separate purchasers? I'm sure there's other plugins to do that, and I don't think this is the appropriate plugin for that. If there's a large demand for it I'll work it into future version definatly

mjmfighter 09-25-2010 22:00

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
alrighty, thanks. time to go searching for that plugin lol

snelvuur 09-25-2010 22:12

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
Might also be nice to have the option to not create points at all. Instead give out points as a admin, through a menu.

So for instance you have a donating person, give him 5000 points or something like that and he can choose his own "rewards" that way the plugin could serve a second goal too.

Besides that, good work!

Xsinthis 09-25-2010 22:39

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
Quote:

Originally Posted by snelvuur (Post 1308865)
Might also be nice to have the option to not create points at all. Instead give out points as a admin, through a menu.

So for instance you have a donating person, give him 5000 points or something like that and he can choose his own "rewards" that way the plugin could serve a second goal too.

Besides that, good work!

hmm thats an interesting idea, though pretty much takes away from the automation of it :P

snelvuur 09-26-2010 06:17

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
The problem that i could see is that if you set a value to low, and offer reserved slots in return for instance. The people that actually donated might not be able to join the servers because there are people that earned it with loyal points. Basicly destroying a second donation of that player if he cant get in :)

even if i say you need 10days of connection time to get it, then still about 50 people have it. Its hard to find the correct "balance" when to give it out.

Xsinthis 09-26-2010 10:34

Re: Loyalty Plugin 2.0 (With Sourcebans support)
 
I personally don't use paid donators, which is why i put the work into this plugin, I use it stand alone. However, most of the reserved slots systems out there (including the base sourcemod one) i believe let you set immunity preference, so you can set loyalty members to have zero immunity and like the paid donators to 1

V2.0.3
- Fixed silly typo in version cvar
- Fixed error in menu selection that would allow you to select any option as long as you had enough for a week

Xsinthis 09-28-2010 19:47

Re: Loyalty Plugin 2.1.0 (Updated 09-28-10)
 
Major Release!(2.1.0)
-Droped _sourcebans suffix
-Added automatic Sourceban checker(dropped sm_loyal_sourcebans)
-Added flatfile support
-Added fully automatic admin method detection(flatfile, sql, sourcebans)
-Added admin group use for all methods(untested for MySQL admins)
-Added bonus points column
-Added command to modify user's points
-Cleaned up minor coding issues

/!\ Important! /!\ Upgrade instructions for 2.0.x to 2.1.x
With 2.1.x the _sourcebans has been dropped from the file, so when you add the new loyal.smx to your plugins file, you need to remove the old loyal_sourcebans.smx or else run into interferance

You *must* run the following query on your loyal table:
Code:

ALTER TABLE loyal
ADD bonus INT(8) NOT NULL

Also, the config file has been renamed to loyal.cfg, just to keep everything named the same.

New list of cvars(Automatically created in cfg/sourcemod/loyal.cfg)
Code:

// Assists required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_assists "10"

// Loyalty point cost per week of reserved slot
// -
// Default: "300"
sm_loyal_cost "300"

// Kills required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_kills "10"

// What Sourcebans Server Group to add loyalty members too(if applicable)
// -
// Default: "All Servers"
sm_loyal_server_group "All Servers"

// Minutes of play required per loyalty point(Warning: Changes in this are retroactive)
// -
// Default: "10"
sm_loyal_time "10"

// User group to add loyalty members too (Sourcebans only)
// -
// Default: "Loyal Members"
sm_loyal_user_group "Loyal Members"

// Version of Loyalty Plugin installed, do not touch
// -
// Default: "2.1.0"
sm_loyal_version "2.1.0"


Harley 10-03-2010 08:33

Re: Loyalty Plugin 2.1.0 (Updated 09-28-10)
 
Nice Plugin


All times are GMT -4. The time now is 21:20.

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