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

status command / CON_COMMAND


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
H0tt0r
SourceMod Donor
Join Date: Aug 2011
Old 09-13-2011 , 14:47   status command / CON_COMMAND
Reply With Quote #1

i´m trying to edit the status command... the poblem with this is that all ways to edit is give me the server as client wich used the command... (but i need the client that wrote "status" in console^^)

http://wiki.alliedmods.net/Commands_...d_Scripting%29
it says that some commands would not work with OnClientCommand() cause they where created with the CON_COMMAND interface...

so i tryed... (only test code to see if its working...)

// ConsoleCMD
// client -> server but A client used the command
Code:
public OnPluginStart()
{
    RegConsoleCmd("status", Command_Status)
}

public Action:Command_Status(client, args)
{
    PrintToConsole(client,"TEST")
    return Plugin_Handled
}
// CommandListener
// client -> server but A client used the command
Code:
public OnPluginStart()
{
    AddCommandListener(baninfo_status, "status");
}
public Action:baninfo_status(client, const String:command[], args)
{
    PrintToConsole(client,"TEST")
    return Plugin_Handled
}
// OnClientCommand
// not working at all... (it continue...)
Code:
public Action:OnClientCommand(client, args)
{
    new String:cmd[16]
    GetCmdArg(0, cmd, sizeof(cmd));
 
    if (StrEqual(cmd, "status"))
    {
        PrintToConsole(client,"TEST")
        return Plugin_Handled
    }
    return Plugin_Continue
}
// admin command
// client -> server but A client used the command
Code:
public OnPluginStart()
{
    RegAdminCmd("status",baninfo_status,0,"BANINFO")
}
public Action:baninfo_status(client, args)
{
    PrintToConsole(client,"TEST")
    return Plugin_Handled
}
so the question is HOW CAN I print my own status text... i want to build own status information and include baninformations...

so is this possible at all? or is there a way to UNregister the main status command?

Last edited by H0tt0r; 09-14-2011 at 03:28.
H0tt0r is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-13-2011 , 23:06   Re: status command / CON_COMMAND
Reply With Quote #2

Just create new console command, RegConsoleCmd("something", callback).
And leave status alone
__________________
Do not Private Message @me
Bacardi is offline
H0tt0r
SourceMod Donor
Join Date: Aug 2011
Old 09-14-2011 , 03:08   Re: status command / CON_COMMAND
Reply With Quote #3

yeah i know how to create a new command..

but i just want to change the original one... not so much player are using custom status commands......
noone would really ever use baninfo_status or stuff like this^^

and by the way i think its a quiet interesting topic... knowing how to...

Last edited by H0tt0r; 09-14-2011 at 10:47.
H0tt0r is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-15-2011 , 11:41   Re: status command / CON_COMMAND
Reply With Quote #4

Quote:
Originally Posted by H0tt0r View Post
yeah i know how to create a new command..

but i just want to change the original one... not so much player are using custom status commands......
noone would really ever use baninfo_status or stuff like this^^

and by the way i think its a quiet interesting topic... knowing how to...
The problem is that some stats systems use the status command. HLStatX:CE, for example.

So, if you change it, you'd break the player display, etc... of HLStatsX.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-15-2011 , 11:46   Re: status command / CON_COMMAND
Reply With Quote #5

You can't alter the status command from SM. It's not implemented the same as other commands.
psychonic is offline
DataStorm
Junior Member
Join Date: Jan 2011
Old 09-17-2011 , 16:06   Re: status command / CON_COMMAND
Reply With Quote #6

just promote your custom command via advertizements etc.
DataStorm 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 04:38.


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