AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   command help (https://forums.alliedmods.net/showthread.php?t=194101)

SPT1 08-25-2012 09:17

command help
 
how will i let it work
if anyone says /commands and /command
or /commandaaaaa
now it only works if anyone says /command
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /command""command_say");
}
public 
command_say(id)
{
 
show_motd(id"command.txt")



Torge 08-25-2012 09:20

Re: command help
 
Just add:

PHP Code:

register_clcmd("say /commands""command_say"); 


SPT1 08-25-2012 09:21

Re: command help
 
no check it again
i need it to detect like
/commandabdaf
or anything else afetr /command
then also the motd will come

Torge 08-25-2012 09:25

Re: command help
 
As much as I can understand you mean that it don't work?

PHP Code:

register_clcmd("say /commands""commands_say");

public 
commands_say(id)
{
show_motd(id"command.txt")



grs4 08-25-2012 09:25

Re: command help
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "311313"
#define VERSION "1.0"
#define AUTHOR "grs4"

new command[] = "/command"
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""say")
}
public 
say(id)
{
    new 
szTxt[128]
    
read_args(szTxt127)
    
remove_quotes(szTxt)
    if(
containi(szTxtcommand))
    {
        
command_say(id);
    }
}
public 
command_say(id)
{
    
show_motd(id"command.txt")


Is that it ?

SPT1 08-25-2012 09:27

Re: command help
 
yes it doesn't works if anyone type /command
if i put
PHP Code:

register_clcmd("say /commands""commands_say"); 

then /command doesn't works
but if i make it like this
PHP Code:

register_clcmd("say /command""commands_say"); 

then /commands doesn't work

Torge 08-25-2012 09:31

Re: command help
 
Well, I tested it and it works fine... Did you forgot to create command.txt in your cstrike folder ?

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /command""command_say");
    
register_clcmd("say /commands""command_say");
}
public 
command_say(id)
{
 
show_motd(id"command.txt")



SPT1 08-25-2012 09:42

Re: command help
 
Quote:

Originally Posted by Torge (Post 1782311)
Well, I tested it and it works fine... Did you forgot to create command.txt in your cstrike folder ?

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /command""command_say");
    
register_clcmd("say /commands""command_say");
}
public 
command_say(id)
{
 
show_motd(id"command.txt")



thanks

fysiks 08-25-2012 12:06

Re: command help
 
Quote:

Originally Posted by Torge (Post 1782311)
Well, I tested it and it works fine... Did you forgot to create command.txt in your cstrike folder ?

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /command""command_say");
    
register_clcmd("say /commands""command_say");
}
public 
command_say(id)
{
 
show_motd(id"command.txt")



That is still not what he asked for. I don't understand why he said thanks. The closest one to the correct code according to the actual request was posted by grs4.

SPT1 08-25-2012 14:11

Re: command help
 
Quote:

Originally Posted by fysiks (Post 1782429)
That is still not what he asked for. I don't understand why he said thanks. The closest one to the correct code according to the actual request was posted by grs4.

that one didn't work


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

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