Raised This Month: $51 Target: $400
 12% 

Solved [HELP] How can i request this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-23-2016 , 18:49   [HELP] How can i request this?
Reply With Quote #1

Code:
TestFunction(client, true, "IsAlive", clientname, float, int, something);
TestFunction(client, true, "IsDead", float, string);
TestFunction(client, false, "IsWow", something, int);
TestFunction(client, true, "IsAlive", "Bart", 1.0, 5, "wow");

stock TestFunction(client, bool: ml, String: translation[], any: ...)
{
}
How can i request the datas from "any: ..." (floats, strings, ints, etc)
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 09-16-2016 at 16:28.
PeEzZ is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 07-23-2016 , 21:56   Re: [HELP] How can i request this?
Reply With Quote #2

You're probably looking for the VFormat function. It's explained in the wiki. If you want to see a real example, the PrintToChatAll stock makes use of it.
__________________

Last edited by Impact123; 07-23-2016 at 22:16.
Impact123 is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-24-2016 , 04:25   Re: [HELP] How can i request this?
Reply With Quote #3

Yes, but i want to request for to another "any"
like this:
Code:
stock TestFunction(client, bool: ml, String: translation[], any: ...) 
{
     //some code here
     PrintToChatAll("%t" "translation", any: ...); << here
     //some code here
}
I cannot format the traslation's name, because his not work.

maybe: ?
Code:
stock TestFunction(client, bool: ml, String: translation[], any: ...) 
{
     new String: buffer[256];
     VFormat(buffer, sizeof(buffer), "%s", 4);
     PrintToChatAll("%t" "translation", buffer);
}
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 07-24-2016 at 06:28.
PeEzZ is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 07-24-2016 , 06:26   Re: [HELP] How can i request this?
Reply With Quote #4

FormatNativeString and VFormat are the only ways how to access any:...

PHP Code:
stock TestFunction(clientboolmlStringtranslation[], any: ...)
{
    new 
String:buffer[1024];
    
VFormat(buffersizeof(buffer), translation4);
    
    
PrintToChatAll(buffer);

__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-24-2016 , 07:29   Re: [HELP] How can i request this?
Reply With Quote #5

Not working with translations, this say the translation's entry name
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here
PeEzZ is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 07-24-2016 , 07:46   Re: [HELP] How can i request this?
Reply With Quote #6

Quote:
Originally Posted by PeEzZ View Post
Not working with translations, this say the translation's entry name
No, it's working e.g. -> https://github.com/KissLick/ColorVar...es.inc#L69-L91

Also:
Quote:
Originally Posted by Impact123 View Post
You're probably looking for the VFormat function. It's explained in the wiki. If you want to see a real example, the PrintToChatAll stock makes use of it.
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.

Last edited by KissLick; 07-24-2016 at 07:48.
KissLick is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-24-2016 , 07:49   Re: [HELP] How can i request this?
Reply With Quote #7

You probably want to do something like this:

PHP Code:
char str[1024];
SetGlobalTransTarget(client);
VFormat(strsizeof(str), "%t"3);
PrintToChat(client"%s"str); 
If you want to print it to everyone, then you can skip setting the target so it uses the server language.
Fyren is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-24-2016 , 08:13   Re: [HELP] How can i request this?
Reply With Quote #8

In translation file:
Code:
"CMD_Scores_Set"
{
     "#format"     "{1:s},{2:d}"
     "en"          "{1} got {2} scores"
}
Use test:
Code:
AdvMessage(client, "CMD_Scores_Set", target_name, amount);
Code:
#define PREFIX "[SM] "
new bool: AdvMessageSended;
.
.
.

AdvMessage(client, String: translation[], any: ...) 
{
    new String: buffer[256];
    VFormat(buffer, sizeof(buffer), translation, 3);
    
    if(!AdvMessageSended)
    {
        ShowActivity2(client, PREFIX, buffer);
        AdvMessageSended = true;
    }
}
I got message back in chat:
"[SM] CMD_Scores_Set"


Edit: this is look workig>
Code:
AdvMessage(client, "%t", "CMD_Scores_Set", target_name, amount);
Code:
AdvMessage(client, String: message[], any: ...)
{
    if(!AdvMessageSended)
    {
        new String: buffer[256];
        VFormat(buffer, sizeof(buffer), message, 3);
        ShowActivity2(client, PREFIX, buffer);
        AdvMessageSended = true;
    }
}
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 08-15-2016 at 16:41.
PeEzZ is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 07-24-2016 , 08:27   Re: [HELP] How can i request this?
Reply With Quote #9

Try this

PHP Code:
AdvMessage(client"%t""CMD_Scores_Set"target_nameamount); 
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 07-24-2016 , 08:32   Re: [HELP] How can i request this?
Reply With Quote #10

yes, its work now, thanks for help
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 08-15-2016 at 16:41.
PeEzZ 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 20:50.


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