Raised This Month: $32 Target: $400
 8% 

Making use of a text-file in Sourcemod


Post New Thread Reply   
 
Thread Tools Display Modes
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 02-14-2014 , 20:50   Re: Making use of a text-file in Sourcemod
Reply With Quote #11

Your best bet would be to pass a string, and its size, as other arguments to GetHowdownValue, e.g.

PHP Code:
new String:Result[32];
if (
GetHowdownValue(blahblahResultsizeof(Result) ))
{
    
//Function was successful.
    
CPrintToChatAll("%s"Result);
}

bool:GetHowdownValue( const String:RoundName[], String:ReqValue[], String:ReturnValue[], ReturnValueSize )
{
    
//..Stuff
    //Fill ReturnValue string with things since Strings are passed by reference, not value.
    
strcopy(ReturnValueReturnValueSize"Hi");


So you could do things like use KvGetString and output the result straight into the ReturnValue string, which you can then access from back in OnPluginStart.

Alternatively, depending on what you're doing, you might be able to avoid "return strings" by just handling the string from within GetHowdownValue.

Not quite sure what a 'howdown' is, mind you... 'hoedown' maybe?
__________________

Last edited by 11530; 02-14-2014 at 20:56.
11530 is offline
wauterboi
Junior Member
Join Date: Dec 2013
Old 02-14-2014 , 22:14   Re: Making use of a text-file in Sourcemod
Reply With Quote #12

Well, what I'm looking to do is create a timer that randomly picks from the sections and loads the keyvalues (weapon indexes, name, description, perks, etc...) into the functions that will take care of them. So, for example, "Crit Soldiers!" will display on the screen, everyone will go soldier, everyone will have crits.

Perhaps I'm going about this the wrong way.

EDIT: I think I'm understanding what you're saying! Took me a while to focus on other things and chill out and come back. I'll try to make use of that tomorrow!

Last edited by wauterboi; 02-15-2014 at 04:09.
wauterboi 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 08:46.


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