AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Autoresponder and Advertiser (with color and conditions!) (https://forums.alliedmods.net/showthread.php?t=27814)

MaximusBrood 04-30-2006 08:44

Autoresponder and Advertiser (with color and conditions!)
 
2 Attachment(s)
FILLFILLFIFILLMaximusBrood proudly presents:
Autoresponder/Advertiser Version 0.5

Description:

This plugin is usefull to every server:

* Display messages on random times WITH COLOR
* React on people saying things, for example,

FILLFLFwhen somone says 'cheat', the server reacts with 'To report a cheater, use teamspeak and begin your message with an @'

These two functions are controlled in a simple textfile in your configs directory.

An advertisement will display itself every 60 to 80 seconds (this is random)
This number is defined, and can be changed with constants

There is a new feature in 0.5: Conditions!
You can for example do, that a certain message will only display itself when the map is de_dust. Or when there are minimal 5 players in the server.

------------------------------------------------------------------------------

Normal Messages

If you want an advertisement that displays itselfs, just put the message on 1 line:
Quote:

Originally Posted by Example
Our webiste is: www.serverwebsite.com

------------------------------------------------------------------------------

Messages with color

Colors are only available in CounterStrike because its limited to that game DLL!

You can also insert COLOR. !t for teamcolor, !g for green color, !n for normal (yellow) color:
Quote:

Originally Posted by Example
!gOur !twebiste !gis!n: serverwebsite.com

Will give this result ingame:
Quote:

Originally Posted by Result
Our webiste is: serverwebsite.com

------------------------------------------------------------------------------

Autoresponder

The second functionality is to react on what people say.
This is also handled in the textfile, with the following syntax

Quote:

Originally Posted by Example
@cheat~To report a cheater, use amx_chat in console

Just begin your a new line with a @, and it will understand that it is a say catch.
Devide the thing that the player has to say, and what the server has to answer, with a ~ (tilde -> shift+ key left of 1)

So in this example, when someone says cheat (cheater, cheats, cheatz), the server will react with the sentence after the ~ (tilde)

You can use COLOR here too!

Quote:

Originally Posted by Example
@cheat~!gTo report a cheater, !nuse amx_chat in !tconsole

So when someone says "Z0MG Y00 CHEAT3RZ0RZ!!!11"
The server will react with:

Quote:

Originally Posted by Server
To report a cheater, use amx_chat in console

------------------------------------------------------------------------------

Conditions

Conditions are very usefull as they can make sure that certain messages are only displayed when the given conditions are met.
This too, is handled in the textfile.

The things you can control are now: (there will be more conditions later, please suggest them!)
  • Map
  • Minimum Players playing
  • Maximum Players playing
The syntax is simple, but strict.

For a normal message:
Quote:

Originally Posted by Example
%map cs_assault%~Terrorists are !g NOT !nallowed to camp at the hostages!

And for the autoresponder:
Quote:

%map cs_assault%~@camper~Terrorists are !g NOT !nallowed to camp at the hostages!
For minimum players:
Quote:

Originally Posted by Example
%min_players 6%~There are 6 players in the server, so !gWeapons Arena!n is enabled!

For maximum players:
Quote:

Originally Posted by Example
%max_players 5%~There are less then 6 players in the server, so !gWeapons Arena!n is disabled!

You can also do multiple conditions, like this:
Quote:

Originally Posted by example
%map de_dust%min_players 6%~Map is dust, and there are 6 players or more, !tCSDM!n is enabled!

I think you can imagine that there are many uses for this function!
  1. Just let the plugin know you are using conditions by typing a % at the begin.
  2. Then the type of the condition; map, min_players or max_players.
  3. Then the value of the condition. I.E. de_dust for the map, or 6 for min_players.
  4. Exit the condition you are working on with a %. You can now return to step 2 to add a new condition, or end the condition list with a ~ (tilde)

------------------------------------------------------------------------------

Cvar's:

ad_react_all - Controls if it should react to all when a keyword is said. Or only to the person who actually said it. (default 1)

------------------------------------------------------------------------------

You only need to make a advertisements.ini file in your configs directory. (addons/amxmodx/configs/advertisements.ini)
A sample file is included in the zip.

Happy advertising :D

(Source file and zipfile had 15336 and 16039 views before reupload)

MaximusBrood 04-30-2006 08:44

Credits:
  • Damaged Soul and BlueRaja -> For finding the colored text solution and putting it into a plugin :D
  • Teame06 -> Who pointed me to use a max of 191 characters when printing colors
  • redParadise -> Requested the 'react only the player who triggered it' function
  • CurryKing -> Requested that messages should be displayed after each other, instead of through each other

Change Log:

V0.1
  • Pre-prelease (without say hook, color and conditions)
V0.2
  • Initial release

    V0.21
    • Fixed 191 character bug
    V0.22
    • Added option to, instead of reacting all, only react to the player who triggered it
V0.3
  • Added system where messages are not displayed simoultaniously, but wait for each other
  • Made sure plugin was broken and didn't work :oops:
V0.4/V0.5
  • Rewrote whole plugin from the ground off
    • Color is handled on load now
    • Less CPU intensive
    • Fixed color bug
    • Using fgets instead of read_file
  • Added Conditions
  • Renewed task system

Known Problems:
  • Colors are only available in CounterStrike because its limited to that game DLL
  • Because CS doens't allow me to, you can't see red color as CT and blue color as T

Charming 04-30-2006 12:20

Pictures Please, oh and + karma.

Deviance 04-30-2006 12:57

Quote:

Originally Posted by Compiler
/home/groups/amxmodx/compiler3/include/string.inc(181) : error 017: undefined symbol "szRightt"
/home/groups/amxmodx/compiler3/include/string.inc(181) : warning 215: expression has no effect
/home/groups/amxmodx/compiler3/include/string.inc(181) : warning 215: expression has no effect
/home/groups/amxmodx/compiler3/include/string.inc(181) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/compiler3/include/string.inc(181) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/compiler3/include/string.inc(181) : fatal error 107: too many error messages on one line

didn't compile for me :?

MaximusBrood 04-30-2006 12:59

The webcompiler is broken. As you can see the include file is malfunctioning, not my plugin!

Just use the normal compiler until the webcompiler is fixed :D

Deviance 04-30-2006 13:00

Quote:

Originally Posted by MaximusBrood
The webcompiler is broken. As you can see the include file is malfunctioning, not my plugin!

Just use the normal compiler until the webcompiler is fixed :D

i thougt they fixed that long time ago :P

okey gonna try...

EDIT: yeah, its the webcompiler that's the wrong :)

anyway's, gj :up:

Kensai 04-30-2006 13:29

Awesome.

SweatyBanana 04-30-2006 13:59

The screenies do load in firefox...Liar :attack:

Charming 04-30-2006 16:29

zomg... I want that knife model may i have it :D

and it didnt compile right for me either.

MaximusBrood 04-30-2006 16:58

Quote:

Originally Posted by Charming
zomg... I want that knife model may i have it :D

and it didnt compile right for me either.

Just use the compiler on your own computer.

Don't use the webcompiler. It's broken and it won't compile good for everyone.

P.S. Why is everyone giving me -karma... A week ago I had +40 karma

Deviance 04-30-2006 18:21

Quote:

Originally Posted by Charming
zomg... I want that knife model may i have it :D

http://www.fpsbanana.com/?section=vi...skins.main.597

MaximusBrood 04-30-2006 19:06

Quote:

Originally Posted by Doombringer
Quote:

Originally Posted by Charming
zomg... I want that knife model may i have it :D

http://www.fpsbanana.com/?section=vi...skins.main.597

Grrrr... you are too fast :wink:

I like that model. It has a forward stab and is very detailed :D

Deviance 04-30-2006 19:07

Quote:

Originally Posted by MaximusBrood
Quote:

Originally Posted by Doombringer
Quote:

Originally Posted by Charming
zomg... I want that knife model may i have it :D

http://www.fpsbanana.com/?section=vi...skins.main.597

I like that model. It has a forward stab and is very detailed :D

yeah indeed, its wery nice and detalied :)

whas thinking of replacing the knife whit it on my server ;)

Guenhwyvar 05-01-2006 06:31

Looks great!

Are there more colors possible?

Let's say I have 3 ads in the advertisements.ini, are they displayed sequentially or random? Or all the ads come up every 60-80 seconds? Two possibilities:

ad1
ad2
ad3
~~60-80s pause~~
ad1
ad2
ad3

or is it

ad1
~~60-80s pause~~
ad2
~~60-80s pause~~
ad3

Can I use more than one line for one ad?

MaximusBrood 05-01-2006 07:47

Quote:

Originally Posted by pl2003
Are there more colors possible?

Unfortunately not :(
Teamcolors are there because well, each team has its own color (T = Red, CT = Blue and SPECT = white)
Green is there because Condition-Zero shows where your teammates are when they say something, in the color green.

Quote:

Originally Posted by pl2003
Let's say I have 3 ads in the advertisements.ini, are they displayed sequentially or random? Or all the ads come up every 60-80 seconds? Two possibilities:

It is:

ad1
~~60-80s pause~~
ad2
~~60-80s pause~~
ad3

Quote:

Originally Posted by pl2003
Can I use more than one line for one ad?

No you can't.

Guenhwyvar 05-01-2006 11:22

Ok, thanks for the answers. I just decided to implement it to my servers - unfortunately the plugin seems not to be compilable with 1.60 :(.

starwarsfan2001 05-01-2006 11:26

1 Attachment(s)
Hi MaximusBrood,

very nice plugin ! But I have two problems / questions:

1. Can you edit the plugin that \n in the ini-file will make a brake ingame ?
2. Is it possible to change the maximal length of writing / showing ingame ? Look at the screenshot, normally there should come more...

starwarsfan2001

Code:

advertisements.ini - reaction on serverinfo:

@serverinfo~!gALDI Sued Fun Server (www.aldi-sued-fun-server.de.vu) mit war3FT + plugins - language: German.n!tServer-IP: aldisuedfunserver.game-host.org:27016


MaximusBrood 05-02-2006 19:26

@starwarsfan

I will implement this feature later this week.
I don't have time enough to do it now. :(

Guenhwyvar 05-03-2006 04:26

And another one (remember: the plugin is working great on three servers now, I just ask for improving it!):

Is the duration, the ad is visible, adjustable?

Ooorgle.com 05-03-2006 05:17

cool plugin

rock on!

Deviance 05-03-2006 05:22

Brood, mabye you should upload the .amxx version of the plugin, so ppl'z dont need to offline-compile it? :wink:

MaximusBrood 05-03-2006 08:40

Quote:

Originally Posted by Doombringer
Brood, mabye you should upload the .amxx version of the plugin, so ppl'z dont need to offline-compile it? :wink:

Its is already there, inside the zip :)

Deviance 05-03-2006 16:48

Quote:

Originally Posted by MaximusBrood
Quote:

Originally Posted by Doombringer
Brood, mabye you should upload the .amxx version of the plugin, so ppl'z dont need to offline-compile it? :wink:

Its is already there, inside the zip :)

okey, nice :wink:

btw, can you give me your msn?

CieGmA 05-03-2006 20:10

very nice plugin but... i've got problem ...
Code:

L 05/02/2006 - 15:51:47: [AMXX] Plugin "ad_manager.amxx" failed to load: Plugin uses an unknown function (name "fgets") - check your modules.ini.
what's that? :| I'm using AMX MOD X 1.60
please help. :)

Bo0m! 05-03-2006 21:07

Try updating your AMXX.

CieGmA 05-04-2006 11:35

yeaah :) It's working. :)
Big THX

slugger 05-04-2006 22:05

i can't compile this with the web one obviously, and i don't have another one anywhere. can someone link me or upload one for me please?

MaximusBrood 05-05-2006 06:05

Quote:

Originally Posted by slugger
i can't compile this with the web one obviously, and i don't have another one anywhere. can someone link me or upload one for me please?

The AMXX file is in the zip. If you don't want to, you don't have to compile :wink:

slugger 05-05-2006 10:42

nah i know it is. i want to change and save the 60-80 seconds randomizer but i can't compile it afterwards.

Guenhwyvar 05-05-2006 12:23

Could you make the min/max pause as cvars?

And my last question (kept unanswered :cry:):

Can I adjust the time the ad is visible?

blast_strike 05-05-2006 23:42

how can i put the ad only in "surf_" maps?

MaximusBrood 05-06-2006 05:01

Allright, its saturday now. I'm going to do newline, min/max as cvars.
And edit so it also scans for part of name.

I don't think it is possible to adjust the time the ad is visible, but I'll look into it :)

Guenhwyvar 05-06-2006 06:39

Sounds great, thank you.

I don't want to push you too much (;)), but I use your plugin as replacement for this plugin (chatresponder):
http://forums.alliedmods.net/showthread.php?t=14955
(5th post, attached sma).

Three functions of the chatresponder would be nice to be added in your plugin:

- possibility to make the response private (only displayed to the user who used the keyword) or public (the way it acts now)
- possibility to use a placeholder for names (e.g. player says "hi all", server responds "hello player, welcome!")
- Match only the whole word (e.g. (if the flag whole word is set on this): player says "ip", server responds, player says "whipped", server does not respond)

Thanx in advance!

MaximusBrood 05-06-2006 08:34

Thank you. I will rewrite my plugin once again to support this all :D

starwarsfan2001 05-06-2006 12:08

But please do it such that you can choose if exactly match words or not - I like it how it works now more than with exact match ;)

MaximusBrood 05-06-2006 12:09

Quote:

Originally Posted by starwarsfan2001
But please do it such that you can choose if exactly match words or not - I like it how it works now more than with exact match ;)

I will change the syntax totally, you can choose if you want it or not with a flag :D

Dabatos 05-06-2006 16:06

Quote:

Originally Posted by MaximusBrood
The webcompiler is broken. As you can see the include file is malfunctioning, not my plugin!

Just use the normal compiler until the webcompiler is fixed :D

huh wut do you mean? how can i get the plug in :( it wont download

MaximusBrood 05-06-2006 18:16

Quote:

Originally Posted by Dabatos
Quote:

Originally Posted by MaximusBrood
The webcompiler is broken. As you can see the include file is malfunctioning, not my plugin!

Just use the normal compiler until the webcompiler is fixed :D

huh wut do you mean? how can i get the plug in :( it wont download

You have to download the zip. The compiled file is in there.
But you can also compile the plugin yourself with your local compiler

---

@Others: New plugin is almost finished. Will complete it tomorrow, its 0:16 here.
Was playing "Colonists of Katan" with my neighbours :D

blast_strike 05-06-2006 19:07

is it possible?
%map surf_~%blablaabablablalbla

Bidybag 05-06-2006 22:59

I used amx_plugins and it says its running fine. I have this in advertisments.ini:

@hook,rope~!bTo use hook type this in the console:!n bind x +hook .!b Replace "x" with the key you want to use.

But when i type in hook or rope in the chat, nothing happens. I am using svencoop.


How do you make it say a message every 5 min as a normal text message at bottom?


All times are GMT -4. The time now is 09:00.

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