Raised This Month: $ Target: $400
 0% 

Getting response from console command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 04-04-2010 , 04:44   Getting response from console command
Reply With Quote #1

So i want to create this plugin, which would exclude more maps in nominations (i don't like the fact that people always nominate the same maps in my server)
I found admin command "sm_maphistory"
and i will use it with
ServerCommand("sm_maphistory", buffer)
But how do i take response from this command wich is posted into console?
Example:
Code:
Map : Started : Played Time : Reason for ending
00. surf_rebel_resistance_final11 (Current Map)
01. surf_sand_css : 31m ago : 26m : Normal level change
02. surf_skate_pro_v2_jail : 58m ago : 27m : Normal level change
03. surf_skyworld : 1h 9m ago : 11m : Normal level change
04. surf_machine4 : 1h 55m ago : 46m : Normal level change
05. surf_10x_reloaded : 2h 22m ago : 27m : Normal level change
and so on till 20.
And how do i take only lets say five first strings? Is it even possible to exclude those maps from nominations?
Sorry guys for a lot of questions but i'm very interested in it =].
Zylius is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 04-04-2010 , 08:04   Re: Getting response from console command
Reply With Quote #2

Quote:
Originally Posted by Zylius View Post
I found admin command "sm_maphistory"
and i will use it with
ServerCommand("sm_maphistory", buffer)
But how do i take response from this command wich is posted into console?
Dont. There is no clean way to get console output. How about taking a look at how its done in the original plugin and perhaps replicating that instead? Its done with native functions that are slightly easier to work with than parsing command responses.
__________________
plop
p3tsin 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 15:45.


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