format
#1

Hi,

How much specifiers, or variables i can use when in format(... , BLABLA[ playerid ], ..... )
Reply
#2

Код:
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?
Reply
#3

No

I talk about limits, how much variables in format i can use
Reply
#4

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")

Reply
#5

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"
Reply
#6

How much in sscanf i can use ? not variables but specifiers

sscanf(loading,"how much?"
Reply
#7

You mean like MAX_PLAYERS 100?
e.g you can't use
Код:
 new string[500]
but you can use
Код:
 new string [ < 500 ]
You mean what is the max of that?
Reply
#8

As we heard from kastanios it's 124, but I doubt if that'd even fit inside a size of [128].
Reply
#9

But in sscanf i use about 200, but i do like that sscanf(loading,"{lllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll llllllllllllllllllllllllllllllllllllllllllllllllll lllllllllllllllllllllllllllllllllllllllllllllllll} dddd"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)