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

buffer on showmotd panel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-05-2015 , 12:44   buffer on showmotd panel
Reply With Quote #1

Hey, On ShowMOTDPanel(client, "Title", "url", "%s", MOTDPANEL_TYPE_URL);
How can I store the buffer? (%s)
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 08-05-2015 , 12:51   Re: buffer on showmotd panel
Reply With Quote #2

Using Format previously (?)
Or what you mean exactly?
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 08-05-2015 at 12:52.
Franc1sco is offline
Send a message via MSN to Franc1sco
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-05-2015 , 13:22   Re: buffer on showmotd panel
Reply With Quote #3

Quote:
Originally Posted by Franc1sco View Post
Using Format previously (?)
Or what you mean exactly?
I did char buffer[4096];
GetCmdArgString(buffer, sizeof(buffer)) and i want the arg will be in %s but on showmotdpanel function there is no place to store it..
__________________
SourcePawn, C# and C++ Programmer.

My plugin list

Last edited by TheUnderTaker; 08-05-2015 at 13:22.
TheUnderTaker is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 08-05-2015 , 13:58   Re: buffer on showmotd panel
Reply With Quote #4

Quote:
Originally Posted by TheUnderTaker View Post
I did char buffer[4096];
GetCmdArgString(buffer, sizeof(buffer)) and i want the arg will be in %s but on showmotdpanel function there is no place to store it..
You have to generate the URL first, and then use the variable that contains the final URL in your MOTD command.

For example, define your "dynamic" URL in the top of your script:
Code:
#define URL_FORMAT "https://steamcommunity.com/profiles/%s"
Then generate the URL like this:
Code:
decl String:steamID64[32];
if (GetClientAuthId(client, AuthId_SteamID64, steamID64, sizeof(steamID64))) {
  decl String:FinalURL[256];
  Format(FinalURL, sizeof(FinalURL), URL_FORMAT, steamID64);
  ShowMOTDPanel(client, "Title", FinalURL, MOTDPANEL_TYPE_URL);
}
And the command will open the user's own profile in the MOTD window.

If this is not good enough, please explain 100% exactly what you are trying to do and why, exactly as @Franc1sco said.
__________________
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
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-05-2015 , 14:21   Re: buffer on showmotd panel
Reply With Quote #5

Quote:
Originally Posted by arne1288 View Post
You have to generate the URL first, and then use the variable that contains the final URL in your MOTD command.

For example, define your "dynamic" URL in the top of your script:
Code:
#define URL_FORMAT "https://steamcommunity.com/profiles/%s"
Then generate the URL like this:
Code:
decl String:steamID64[32];
if (GetClientAuthId(client, AuthId_SteamID64, steamID64, sizeof(steamID64))) {
  decl String:FinalURL[256];
  Format(FinalURL, sizeof(FinalURL), URL_FORMAT, steamID64);
  ShowMOTDPanel(client, "Title", FinalURL, MOTDPANEL_TYPE_URL);
}
And the command will open the user's own profile in the MOTD window.

If this is not good enough, please explain 100% exactly what you are trying to do and why, exactly as @Franc1sco said.
Yes i wanted it, thank you i will try when i back.

Edit: Didn't work on my format, I maked command that when you type !google X It google for you something but it googled %s.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list

Last edited by TheUnderTaker; 08-06-2015 at 02:38.
TheUnderTaker is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-06-2015 , 16:20   Re: buffer on showmotd panel
Reply With Quote #6

PHP Code:
#define URL_FORMAT "https://steamcommunity.com/profiles/{PROFILE}"
//...
ReplaceStringEx(FinalURLsizeof(FinalURL), "{PROFILE}"steamID64); 
__________________
11530 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 19:48.


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