AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Custom Say Commands (https://forums.alliedmods.net/showthread.php?t=24092)

GHW_Chronic 02-11-2006 06:16

Custom Say Commands
 
8 Attachment(s)
  • This is a very useful plugin for creating custom say commands.

Example:
  • Chronic says "/website" and an MOTD window with your website pops up.
  • Lord Saddler types "/Admin's AIM SN" and a text message appears to him with your AIM SN.
  • v3x says a phrase with the word war3 in it and a hud message pops up to everyone about your war3 server.

Here's how to setup the .ini file:
  • Quote:

    ***.ini SYNTAX***

    ]/command OR ]word (must have the "]" infront)
    exact OR contain
    show OR don't show
    motd
    addons/amxmodx/configs/motd1.txt OR http://blah
    log OR don't log



    ]/command OR ]word (must have the "]" infront)
    exact OR contain
    show OR don't show
    text (in chat)
    All OR CT OR T OR Axis OR Allies OR Red OR Blue OR Green OR Yellow OR Player - ETC.
    Text Print Out
    log OR don't log


    ]/command OR ]word (must have the "]" infront)
    exact OR contain
    show OR don't show
    center (middle of screen in normal text)
    All OR CT OR T OR Axis OR Allies OR Red OR Blue OR Green OR Yellow OR Player - ETC.
    Text Print Out
    log OR don't log


    ]/command OR ]word (must have the "]" infront)
    exact OR contain
    show OR don't show
    HUD
    Color
    All OR CT OR T OR Axis OR Allies OR Red OR Blue OR Green OR Yellow OR Player - ETC.
    Hud Print Out
    log OR don't log

    ***End .ini SYNTAX***




    EXAMPLES:

    ***Example 1*** - Lines do not start with the (number), it is just to show you what line we are talking about.

    (1 )]/our forums
    (2 )exact
    (3 )don't show
    (4 )motd
    (5 )http://blah/blah.php
    (6 )don't log

    will make an (4 )MOTD pop up showing (5 )"http://blah/blah.php" website.
    Only if (1 )"/our forums" is said (2 )exactly like that.
    (3 )"don't show" will then not show what the user typed.
    (6 ) does not log the that (name here) did the command.

    ***End Example 1***



    ***Example 2*** - Lines do not start with the (number), it is just to show you what line we are talking about.

    (1 )]hello
    (2 )contain
    (3 )show
    (4 )HUD
    (5 )red
    (6 )CT
    (7 )Hi.
    (8 )log

    will show a (7 )"Hi." on the (4 )HUD to all the (6 )CTs in (5 )red.
    Only if a player types the word (1 )"hello" (2 )anywhere in his sentence.
    (3 )"show" will cause the sentence or phrase the player typed to show up in chat still.
    (8 ) does log that (name here) did the command + what he typed.

    ***End Example 2***
    You can add the items on the left side to the last line and it will be replaced with whats on the right side.
    Code:

    %name    Player's Name
    %hostname Server's Name
    %ip      Server's IP
    %ping    Player's Ping
    %loss    Player's Loss
    %date    Current Date
    %time    Current Server Side Time
    %map      Current Map
    %frags    Player's Frags
    %deaths  Player's Deaths
    %authid  Player's Authid (Steamid / WonID)
    %team    Player's Team
    %text    Displays what the person typed after "/blah" (see last example)

    Example:
    ]Chuck Norris
    contain
    show
    HUD
    yellow
    All
    %name wants to know who Chuck Norris is.
    don't log



Here are the default ones in the .ini file for more examples:
  • Quote:

    ]/test
    exact
    don't show
    text
    all
    test
    log

    ]hello
    contain
    show
    hud
    pink
    All
    The Server Admins All Say Hi.
    don't log

First line of a new command must start with a "]" because that is how the script reads the .ini file.

On text/center/hud, the 2nd to last line is who you want to display the message to. All = everyone, Player = player that executed the command, CT T AXIS YELLOW etc are team names. Should work with every team name for every game. (Must be CT not Counter-Terrorist and likewise with T)

Hud message colors can be:
  • Red
  • Green
  • Blue
  • Yellow
  • Orange
  • Pink
  • Indigo
  • White

TIPS to help you use this plugin to it's full extent
  • Quote:

    ]/eat
    exact
    don't show
    text
    All
    %name is eating %text.
    don't log

    If GHW_Chronic typed "/eat a hamburger":
    That will display the following text in chat:
    GHW_Chronic is eating a hamburger.


Commands:
  • amx_say_commands_toggle - <1/on 0/off> Toggle the custom Say Commands on/off (default on)
  • client_commands - client command that displays all of your "exact"(line 2 in .ini) custom commands.


CVARs:
  • advertise_len - Time between advertisement spam (seconds) ([AMXX] Type client_commands in console to view a list of useful client commands.) (Default: 500.0) (0=off)

say_commands.ini goes into your configs folder.
log file will show up in your AMXX configs directory as say_commands_log.log

uTg | bigpapajiggs 02-11-2006 06:19

Very nice Chronic! Definately going on my server. 5/5 on approval.

Charming 02-11-2006 07:01

Nice job.

JKB 02-11-2006 11:14

nice, very usefull!

v3x 02-11-2006 16:27

Approved 'cause you mentioned my name in there. Just kidding. Good job.

A couple questions:

1) Why use containi to check a string for [ ?
Code:
if(read[0] == '[') { /* zomg */ }
2) Err .. I lie, only 1 question ( unless I forgot the other one[s] ).

GHW_Chronic 02-11-2006 17:01

Quote:

Originally Posted by v3x
1) Why use containi to check a string for [ ?
Code:
if(read[0] == '[') { /* zomg */ }

Tried that actaully, did not work. And I do not believe it really makes a difference. I love efficiency as much or more than the next guy, and I believe this is my cleanest most efficient script yet.

Brad 02-11-2006 17:19

contain() is more efficient than containi(). In the spirit of 'most efficient'. :)

pendragon 02-11-2006 18:23

This is great! I modified the hell out of EKS MOTM plugin to achieve pretty much the same thing that I can do with a quick ini fix from this plugin.

I'll give it a shot.

Thanks Chronic

JKB 02-12-2006 13:24

hmm you could add something like 'vote' instead of motd
ex say /mapchange will ask ppl if they want a mapchange

there r some things not working -> contain, motd, hud...
only chat text and center text r working here :s

GHW_Chronic 02-13-2006 01:23

Added variable replacesments for strings. This plugin is becoming REALLY customizable. I've got 1 more idea that I'll post hopefully tonight.

Look at main post for more details.


All times are GMT -4. The time now is 05:33.

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