Raised This Month: $66 Target: $400
 16% 

Custom Say Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   v3x (159)
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-11-2006 , 07: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 - 5261 views - 14.1 KB)
File Type: ini say_commands.ini (130 Bytes, 3406 views)

Last edited by GHW_Chronic; 06-04-2008 at 21:32.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
uTg | bigpapajiggs
Senior Member
Join Date: Sep 2005
Location: Bellingham, WA
Old 02-11-2006 , 07:19  
Reply With Quote #2

Very nice Chronic! Definately going on my server. 5/5 on approval.
__________________
What's my confidence level? I do crossword puzzles with a pen.
uTg | bigpapajiggs is offline
Send a message via AIM to uTg | bigpapajiggs Send a message via MSN to uTg | bigpapajiggs Send a message via Yahoo to uTg | bigpapajiggs
Charming
BANNED
Join Date: Nov 2005
Location: Canada
Old 02-11-2006 , 08:01  
Reply With Quote #3

Nice job.
Charming is offline
Send a message via ICQ to Charming Send a message via AIM to Charming Send a message via MSN to Charming Send a message via Yahoo to Charming
JKB
Member
Join Date: Jan 2006
Old 02-11-2006 , 12:14  
Reply With Quote #4

nice, very usefull!
__________________
Quote:
Chuck Norris doesn't sleep. He waits.
JKB is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-11-2006 , 17:27  
Reply With Quote #5

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] ).
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-11-2006 , 18:01  
Reply With Quote #6

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.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 02-11-2006 , 18:19  
Reply With Quote #7

contain() is more efficient than containi(). In the spirit of 'most efficient'.
Brad is offline
pendragon
Senior Member
Join Date: Mar 2004
Location: In a bubble
Old 02-11-2006 , 19:23  
Reply With Quote #8

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
__________________
pendragon is offline
Send a message via ICQ to pendragon Send a message via AIM to pendragon Send a message via MSN to pendragon
JKB
Member
Join Date: Jan 2006
Old 02-12-2006 , 14:24  
Reply With Quote #9

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
__________________
Quote:
Chuck Norris doesn't sleep. He waits.
JKB is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 02-13-2006 , 02:23  
Reply With Quote #10

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.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Reply


Thread Tools
Display Modes

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 04:31.


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