Raised This Month: $ Target: $400
 0% 

ServerCommandEx not work #ServerCommandEx #NotWork #Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-14-2016 , 17:51   ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #1

Will not work
PHP Code:
public OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action:test(clientargs)
{
    new 
String:buffer[600];
    
ServerCommandEx(buffersizeof(buffer), "status");
    
PrintToServer("-%s-"buffer);

    return 
Plugin_Handled;

Work!
PHP Code:
public OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
Action:test(clientargs)
{
    
RequestFrame(frame);
    return 
Plugin_Handled;
}

public 
frame(any:data)
{
    new 
String:buffer[600];
    
ServerCommandEx(buffersizeof(buffer), "status");
    
PrintToServer("-%s-"buffer);

capiche ?
__________________
Do not Private Message @me

Last edited by Bacardi; 04-14-2016 at 18:39. Reason: forget buffers
Bacardi is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 04-14-2016 , 18:13   Re: ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #2

I think it has to do with the server already processing the command sm_test when you do ServerCommandEx

Last edited by WildCard65; 04-14-2016 at 18:14.
WildCard65 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-14-2016 , 18:41   Re: ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #3

yep, I just made this topic for those who have problem, and maybe fround this by using forum "search"
__________________
Do not Private Message @me
Bacardi is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-15-2016 , 05:49   Re: ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #4

+1 Good to know ;-)
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-15-2016 , 20:34   Re: ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #5

ServerCommandEx seems to work fine when you are executing the command (e.g. sm_test) from a client's console.

If you however run the command sm_test from the server's console, the result data is completely empty.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-15-2016 , 20:40   Re: ServerCommandEx not work #ServerCommandEx #NotWork #Help
Reply With Quote #6

true ^
Bacardi 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 12:19.


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