Raised This Month: $ Target: $400
 0% 

Advertisements Mod -- Need Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-=[SD]=-Turkey
Member
Join Date: Jul 2006
Location: Ohio, United States of A
Old 06-04-2007 , 20:19   Advertisements Mod -- Need Help
Reply With Quote #1

Hello. This is my first plugin I've actually wrote and it compiled... It works and so does the cvar I made. What it does is I've hardcoded some advertisements into it that will display every 60 seconds (or 1 minute), I want to share this plugin with others for their tsrp servers -- I forgot to mention that I made this for TSRP. The problem is, whenever it does display the advertisements, it shows all 5 of them instead of one at a time every 60 seconds.

Here is the code:

Code:
/*
==================================================================================================================
===                                  Advertisements Mod for TSRP Servers                                       ===
====                                         Version 0.1 Alpha                                                ====
==========================================================Author: -=[SD]=-Turkey a.k.a turkey2112=================
*/
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "PLUGIN"
#define VERSION "VERSION"
#define AUTHOR "AUTHOR"
 
public plugin_init() 
{
 register_plugin("Advertisements Mod", "0.1a", "turkey2112")
 register_cvar("amx_advertsenable","1")
 set_task(60.0,"advertise",0,"",0,"b")
}
public advertise()
{
 if(!get_cvar_num("amx_advertsenable")) return PLUGIN_HANDLED
 client_print(0,print_chat,"The MCPD is hiring! Apply on our forums today!") //Edit the text inside of quotes for your own adverts
 client_print(0,print_chat,"Want to save lives? Join the MCMD today! Visit our forums to apply.")
 client_print(0,print_chat,"Chase bank is looking for a new director! Do you have what it takes? Find out on our forums!")
 client_print(0,print_chat,"Need a place to stay for the night? Visit Hotel Mecklenburg! Rooms starting at only $50!")
 client_print(0,print_chat,"Good times, good drinks, good company... Come visit us at the Irish Pub!")
 return PLUGIN_HANDLED
}
__________________
If you thought my post was helpful, please add karma
-=[SD]=-Turkey is offline
Send a message via AIM to -=[SD]=-Turkey
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2007 , 21:06   Re: Advertisements Mod -- Need Help
Reply With Quote #2

Something like :

Code:
#include <amxmodx> #include <amxmisc> new g_AdTxt[][]= {     "The MCPD is hiring! Apply on our forums today!",     "Want to save lives? Join the MCMD today! Visit our forums to apply.",     "Chase bank is looking for a new director! Do you have what it takes? Find out on our forums!",     "Need a place to stay for the night? Visit Hotel Mecklenburg! Rooms starting at only $50!",     "Good times, good drinks, good company... Come visit us at the Irish Pub!" }; new g_enabled; new g_num = 0; public plugin_init() {     register_plugin( "Advertisements Mod", "0.1a", "turkey2112");     g_enabled = register_cvar( "amx_advertsenable", "1" );         set_task( 60.0, "advertise", 0, _, _,"b" ); } public advertise() {     if( !get_pcvar_num( g_enabled ) )         return;         client_print( 0, print_chat, g_AdTxt[g_num++] );         if( g_num > sizeof g_AdTxt - 1 )            g_num = 0; }
__________________
Arkshine is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 06-04-2007 , 21:33   Re: Advertisements Mod -- Need Help
Reply With Quote #3

I just made/started on a nicer one. Look a few posts down ;) arkshine
fixed it up cuz im not good w/ file io yet.
Styles is offline
Send a message via AIM to Styles
-=[SD]=-Turkey
Member
Join Date: Jul 2006
Location: Ohio, United States of A
Old 06-05-2007 , 06:50   Re: Advertisements Mod -- Need Help
Reply With Quote #4

Thank you very much ArkShine! I have put a special thanks to you in my .sma for when I release it here in a few. It's just a simple plugin really... no files to edit or anything.
__________________
If you thought my post was helpful, please add karma
-=[SD]=-Turkey is offline
Send a message via AIM to -=[SD]=-Turkey
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-05-2007 , 06:57   Re: Advertisements Mod -- Need Help
Reply With Quote #5

You want to release this??
I'm sure it will get unapproved in no time...
There are alot of advertising plugins out there which do a realy good job...so it's redundant!

greetz regalis
__________________
regalis is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-05-2007 , 10:58   Re: Advertisements Mod -- Need Help
Reply With Quote #6

I agree. You shouldn't release this.
__________________
Arkshine is offline
-=[SD]=-Turkey
Member
Join Date: Jul 2006
Location: Ohio, United States of A
Old 06-06-2007 , 06:24   Re: Advertisements Mod -- Need Help
Reply With Quote #7

I have no intentions of releasing it on the allied modders forums as I already noticed that there is a vast amount of adverts mods.
__________________
If you thought my post was helpful, please add karma
-=[SD]=-Turkey is offline
Send a message via AIM to -=[SD]=-Turkey
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 10:35.


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