PDA

View Full Version : [ASA]: Advanced SQL Advertisements - UPDATE(19/5/2016)


oxygen935
03-01-2014, 08:36
Advanced SQL Advertisements
Description:
I search in forums for something like this but nothing found. So i decided to make one! :P
With this plugin you can add some advertisements(dhud/chat/hud) into SQL and then to show them in-game. It's a simple plugin which will make your life easier for communities. It's a better way not to write the same things in .ini files.

UPDATE 1.2: Now u can handle the Advertisements by servers

Admin Commands:

-asa_add_adv "type: chat/hud/dhud" "message" "servers with commas|all" "red" "green" "blue"
It adds an advertisement in SQL
NOTE1: If the type is chat there is no need to add red, green,blue.
NOTE2: Red, Green, Blue is values 0-255.
NOTE3: You can use colorchat: !g for green color, !t for team color and !n for yellow color.
Examples:
asa_add_adv "chat" "kappa" "127.0.0.1:27015"
asa_add_adv "hud" "kappakeppo" "127.0.0.1:27015,127.0.0.1:27016" "255" "0" "0"
asa_add_adv "dhud" "kappakeppos" "all" "255" "255" "0"

-asa_del_adv "type: chat/hud/dhud" "message" "servers with commas|all"
Deletes the advertisement from SQL with this type & name.
NOTE: Same way to add server with the above

-asa_show_advs
Shows all advertisements in console

-asa_reload_advs
Reloads all advertisements

-say /advs
Opens a menu with all advertisements


Cvars:
No CVARS Needed.

Plugin Customization:

#define MAX_CHAT_MESSAGES 20 //Max chat messages in sql
#define MAX_HUD_MESSAGES 20 //Max hud messages in sql
#define MAX_DHUD_MESSAGES 20 //Max dhud messages in sql
#define MAX_SERVERS 20 //Max Servers in sql

#define ADMIN_FLAG ADMIN_BAN //Admin flag for commands

#define USE_PREFIX //define this if u don't want chat prefix

new Host[] = ""
new User[] = ""
new Pass[] = ""
new DB[] = ""

new const Float:MIN_TIME_CHAT = 60.0
new const Float:MAX_TIME_CHAT = 80.0
new const Float:MIN_TIME_HUD = 120.0
new const Float:MAX_TIME_HUD = 160.0

#if defined USE_PREFIX
new const saychatprefix[] = { "!g[!nAdvanced SQL Advs!g]!n" }
#endif

Changelog:

1.0 - Release
1.2 - Control Servers' Advertisements, make Advertisements only for some servers

TO DO:

Add VB|Php Script for control advertisements via website(NOT DONE!)
Make the advertisements to be controllable via menu(NOT DONE!)

Installation:
Just add mysql, compile and add to plugins.ini.
No need any module or something like this.

ArabicMan
03-01-2014, 09:33
Good job

jingojang
03-01-2014, 14:29
You made my life a bit easier actually. I have not tested it yet but if it works as expected, great job.

oxygen935
03-01-2014, 18:41
Thanks a lot guys.

Plugin has beed tested and works Fine!

Groven
03-01-2014, 19:25
Nice man!

hornet
03-03-2014, 02:22
It's a simple plugin

So what makes it advanced? :D

oxygen935
03-03-2014, 05:11
So what makes it advanced? :D

I think cause u can add chat, hud and dhud advertisements and also you can save them in MySQL DataBase. So this plugin is the best solution for communities with a lot of servers ;)

jonnzus
03-04-2014, 13:04
I thought that I should try to make something like this but I didn't have motivation to study amxx. Great work :)
Maybe you should add option that some advertisement can be disabled for specific ip..?

oxygen935
03-04-2014, 14:56
Yeah, i actually thought about this and i am working on this right now.
Will be updated soon.

The obly thing that i really need some help is on the web part, cause i don't know a lot about html and php.

Balage74
10-21-2015, 21:08
nice plugin, you can expand this with autoresponder and conditions function ? (like this:https://forums.alliedmods.net/showthread.php?t=27814&highlight=autoresponder)
conditions:map, playersnum, adminflags?

oxygen935
10-22-2015, 06:55
nice plugin, you can expand this with autoresponder and conditions function ? (like this:https://forums.alliedmods.net/showthread.php?t=27814&highlight=autoresponder)
conditions:map, playersnum, adminflags?

i'm gonna do it when i have some free time.

Mark.uG
11-26-2015, 10:00
Little more of a way to define what ads go on what servers this will go on all of my servers.

oxygen935
05-19-2016, 07:03
Little more of a way to define what ads go on what servers this will go on all of my servers.

Done my friend!