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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 03-01-2014 , 08:36   [ASA]: Advanced SQL Advertisements - UPDATE(19/5/2016)
Reply With Quote #1

Advanced SQL Advertisements

Description:
I search in forums for something like this but nothing found. So i decided to make one!
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:
PHP Code:
-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 redgreen,blue
NOTE2RedGreenBlue is values 0-255.
NOTE3
You can use colorchat: !for green color, !for team color and !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.
NOTESame 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:
PHP Code:
#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.
Attached Files
File Type: sma Get Plugin or Get Source (advanced_sql_advs.sma - 1042 views - 22.5 KB)
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science

Last edited by oxygen935; 05-19-2016 at 07:02. Reason: Update 1.2
oxygen935 is offline
Send a message via Skype™ to oxygen935
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 03-01-2014 , 09:33   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #2

Good job
ArabicMan is offline
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 03-01-2014 , 14:29   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #3

You made my life a bit easier actually. I have not tested it yet but if it works as expected, great job.
__________________
jingojang is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 03-01-2014 , 18:41   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #4

Thanks a lot guys.

Plugin has beed tested and works Fine!
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
Groven
AlliedModders Donor
Join Date: Apr 2011
Location: Sweden
Old 03-01-2014 , 19:25   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #5

Nice man!
__________________
Groven is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 03-03-2014 , 02:22   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #6

Quote:
Originally Posted by oxygen935 View Post
It's a simple plugin
So what makes it advanced?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 03-03-2014 at 02:23.
hornet is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 03-03-2014 , 05:11   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #7

Quote:
Originally Posted by hornet View Post
So what makes it advanced?
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 ;)
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 03-04-2014 , 13:04   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #8

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..?

Last edited by jonnzus; 03-04-2014 at 13:05.
jonnzus is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 03-04-2014 , 14:56   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #9

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.
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
Balage74
Member
Join Date: Dec 2006
Old 10-21-2015 , 21:08   Re: [ASA]: Advanced SQL Advertisements
Reply With Quote #10

nice plugin, you can expand this with autoresponder and conditions function ? (like this:https://forums.alliedmods.net/showth...=autoresponder)
conditions:map, playersnum, adminflags?
__________________
Balage74 is offline
Send a message via MSN to Balage74 Send a message via Skype™ to Balage74
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 08:43.


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