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.