format - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: format (
/showthread.php?tid=616976)
format -
MerryDeer - 13.09.2016
Hi,
How much specifiers, or variables i can use when in format(... , BLABLA[ playerid ], ..... )
Re: format -
F1N4L - 13.09.2016
Код:
new f[50], test[50] = "test";
format(f, sizeof f, test);
Код:
new f[50], test[50] = "my name is %s", name[24];
GetPlayerName(playerid, name, 24);
format(f, sizeof f, test, name);
Код:
#define test "test"
new f[50];
format(f, sizeof f, test);
Код:
#define test "my score is %d"
new f[50];
format(f, sizeof f, test, GetPlayerScore(playerid));
This?
Re: format -
MerryDeer - 13.09.2016
No
I talk about limits, how much variables in format i can use
Re: format -
F1N4L - 13.09.2016
Quote:
Originally Posted by MerryDeer
No
I talk about limits, how much variables in format i can use
|
I believe that the only limit is the size of the string to be formatted...
@edit
Example:
The name is FORUM_SAMP (10 chars)
Quote:
new string[13];
format(string, sizeof string, "The name is %s", "FORUM_SAMP")
|
Re: format -
Konstantinos - 13.09.2016
It compiles with 124 arguments but any higher will crash the compiler. I managed to get an output though:
pawn Код:
error 045: too many function arguments
fatal error 102: table overflow: "staging buffer"
Re: format -
MerryDeer - 13.09.2016
How much in sscanf i can use ? not variables but specifiers
sscanf(loading,"how much?"
Re: format -
BrianS123 - 13.09.2016
You mean like MAX_PLAYERS 100?
e.g you can't use
but you can use
Код:
new string [ < 500 ]
You mean what is the max of that?
Re: format -
saffierr - 13.09.2016
As we heard from kastanios it's 124, but I doubt if that'd even fit inside a size of [128].
Re: format -
MerryDeer - 13.09.2016
But in sscanf i use about 200, but i do like that sscanf(loading,"{lllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllll} dddd"