Raised This Month: $ Target: $400
 0% 

Return server_cmd output to string


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Salmus
Junior Member
Join Date: Dec 2007
Old 11-22-2010 , 02:50   Return server_cmd output to string
Reply With Quote #1

Hello,

I would like a little help with amxmodx scripting, I'm trying to store output of server_cmd in a string ... I just can't figure it out howto.

I was thinking at:
Code:
new data = server_cmd("echo MATCHSTRING");
new data_match[30]; copy(data_match, 29, data);

if(contain(data_match, "MATCHSTRING)) { 
[...]
}
But, data_match returns nothing, I've tried also with log_to_file(file.log, "%s", server_cmd("echo MATCHSTRING"); - but still doesn't work.


So, the main question is: how can I store return of the server_cmd into a variable ?

server_cmd("echo 123"); returns "123" - I want to store this in a variable.


Note: My server_cmd will return dynamic content, that's why I need to store it into a variable.

Last edited by Salmus; 11-22-2010 at 02:54. Reason: more infos
Salmus is offline
 


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 11:25.


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