View Single Post
Plugin Info:     Modification:          Category:          Approver:   v3x (159)
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-11-2006 , 06:16   Custom Say Commands
Reply With Quote #1

  • 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
Attached Files
File Type: sma Get Plugin or Get Source (GHW_Custom_Say_Commands.sma - 5905 views - 14.1 KB)
File Type: ini say_commands.ini (130 Bytes, 3746 views)

Last edited by GHW_Chronic; 06-04-2008 at 20:32.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic