Raised This Month: $51 Target: $400
 12% 

REQ: Chat Commands Plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 11-21-2008 , 12:24   REQ: Chat Commands Plugin.
Reply With Quote #1

Hello. I need a simple plugin for admins, that would simplify the use of amxx commands. Here are the details (these commands should be typed in chat, and only admins who have acces to amx_ban command should use it):

.kick <name> - Kick Player
.ban <name> <time> - amx_ban
.banip <name> - amx_banip
.score - shows the score. (CT: x - T: x)
.ff on - mp_friendlyfire 1 (Say Friendly Fire: ON)
.ff off - mp_friendlyfire 0 (Friendly Fire: OFF)
.demo <name> - exec player 'record name.dem' *
* The demo must have in its name the map name, date and hour. (eg demo-de_dust2-13-11-08-22-40.dem)
.map <mapname> - amx_map
.start - exec war.cfg, then chat messages:
Match starts in:
5;
4; sv_restart 1;
3
2; sv_restart 1;
1; sv_restart 1;
Game is ON !
LIVE ! LIVE ! LIVE !
Good Luck and Have Fun!
A center messages, like amx_csay, but without the admin name: "Game is LIVE !"

1 second interval between messages.

.restart - Chat messages:
Match starts in:
5;
4; sv_restart 1;
3
2; sv_restart 1;
1; sv_restart 1;
Game is ON !
LIVE ! LIVE ! LIVE !
Good Luck and Have Fun!

Same thing! 1 second interval between messages.

.stop - exec warmup.cfg, sv_restart 3, then messages:
The match is over. Thanks for playing!

And that's about all. Hope I didn't ask for much. Thanks you in advance.
__________________
We live in a world where PIZZA arrives faster than the Police !
The_Ghost is offline
Send a message via Skype™ to The_Ghost
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-21-2008 , 12:37   Re: REQ: Chat Commands Plugin.
Reply With Quote #2

isnt that like at gather-network ?
__________________
xPaw is offline
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 11-21-2008 , 12:59   Re: REQ: Chat Commands Plugin.
Reply With Quote #3

yes, but they have the plugin more complicated, with irc bots and things. i like it simple and I don't think they exec the cfgs or something )
__________________
We live in a world where PIZZA arrives faster than the Police !
The_Ghost is offline
Send a message via Skype™ to The_Ghost
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 11-21-2008 , 16:17   Re: REQ: Chat Commands Plugin.
Reply With Quote #4

amx_ban standard or from amxbans?
Scherzo is offline
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 11-21-2008 , 16:22   Re: REQ: Chat Commands Plugin.
Reply With Quote #5

standard.
__________________
We live in a world where PIZZA arrives faster than the Police !
The_Ghost is offline
Send a message via Skype™ to The_Ghost
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 11-21-2008 , 16:38   Re: REQ: Chat Commands Plugin.
Reply With Quote #6

It`s piece of code. To make whole I need more instructions to be sure how it will work (showing messages etc)
Code:
#include <amxmodx>

#define PLUGIN "Chat Commands"
#define VERSION "1.0"
#define AUTHOR "R3X"

new g_cmds[][]=
{
    "kick",
    "ban",
    "banip",
    "score",
    "ff",
    "demo",
    "start",
    "restart",
    "stop"
}
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_clcmd("say", "chatFilter",ADMIN_BAN);
}
public chatFilter(id)
{
    new message[128];
    read_argv(1, message, 127);
    for(new i=0;i<sizeof(g_cmds);i++)
    {
        new cmd[33];
        formatex(cmd,32,".%s",g_cmds[i]);
        if(containi(message,cmd)==0)
        {
            callBack(id);
            return PLUGIN_HANDLED;
        }
    }
    return PLUGIN_CONTINUE;
}
getCommandId(cmd[])
{
    for(new i=0;i<sizeof(g_cmds);i++)
    {
        if(equali(cmd, g_cmds[i]))
            return i;
    }
    return -1;
}
public callBack(id)
{
    new message[128], cmd[33],arg[65], arg2[7];
    read_argv (1, message, 128);
    parse(message,cmd,32,arg,64,arg2,6) 
    replace(cmd,32,".","");
    new cID=getCommandId(cmd); 
    switch(cID)
    {
        case 0:
        {
            console_cmd(id,"kick %s", arg);
        }
        case 1:
        {
            new bantime=str_to_num(arg2);
            console_cmd(id,"amx_ban %s %d", arg, bantime);
        }
        case 2:
        {
            new bantime=str_to_num(arg2);
            console_cmd(id,"amx_banip %s %d", arg, bantime);
        }
        case 3:
        {
            //show score
        }
        case 4:
        {
            //set ff
            if(equali(arg,"on"))
            {
                console_cmd(id,"amx_cvar mp_friendlyfire 1");
            }
            else if(equali(arg,"off"))
            {
                console_cmd(id,"amx_cvar mp_friendlyfire 0");
            }
        }
        case 5:
        {
            //record demo
        }
        case 6:
        {
            //start match
        }
        case 7:
        {
            //restart match
        }
        case 8:
        {
            //stop match
        }
    }
    return PLUGIN_HANDLED;
}
For few minutes will be update with seting FF.

Last edited by Scherzo; 11-21-2008 at 16:49.
Scherzo is offline
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 11-21-2008 , 16:43   Re: REQ: Chat Commands Plugin.
Reply With Quote #7

ok. tell me where do you need help.
__________________
We live in a world where PIZZA arrives faster than the Police !
The_Ghost is offline
Send a message via Skype™ to The_Ghost
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 11-21-2008 , 16:47   Re: REQ: Chat Commands Plugin.
Reply With Quote #8

Show score:
put to chat "CT 1 0 T" or hud_saytext or how?

Record demo:
only for one player? maybe * = for all players or sth

About match:
you will create .cfg files or I should make it inside plugin?
Scherzo is offline
The_Ghost
Senior Member
Join Date: Jun 2006
Location: RoMaNiA
Old 11-21-2008 , 16:52   Re: REQ: Chat Commands Plugin.
Reply With Quote #9

score should be in chat.
demo is only for one player. (hope u can make the demo name just like the example above)
i have the .cfg files. you don't have to make them inside the plugin.
About the restart messages. between the 5,4, etc must be 1 second break. and the last 3 messages (with good luck, have fun etc) and the hud one should appear in the same time. so as for restart.
the friendly fire on and off messages should appear in chat. any other questions ?
__________________
We live in a world where PIZZA arrives faster than the Police !
The_Ghost is offline
Send a message via Skype™ to The_Ghost
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 11-21-2008 , 16:56   Re: REQ: Chat Commands Plugin.
Reply With Quote #10

If I use amx_cvar will be ok? I ask about message

Quote:
PLAYER Half-Life dedicated server: set cvar mp_friendlyfire to "0
Create new message or this is good for you?
Scherzo is offline
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 09:32.


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