08.01.2009, 12:16
Quote:
Originally Posted by hamptonin
i has my question:
how can i create example i print everything i entered in the Function like if i use: Function(1,3,2,5,4,76,9,8,0); how can i print it? |
pawn Код:
PrintDigitalArguments(...)
{
new n = numargs(), i, tmp[128];
for(i = 0; i < n; i++) format(tmp, sizeof tmp, "%s, %c", tmp, getarg(i));
printf("Function(%s)", tmp[2]);
}
Quote:
Originally Posted by hamptonin
and can i use to "text"
|
pawn Код:
#define getarray(%1,%2) \
do \
{ \
static _c = false; \
for(_c = 0; %2[_c] != 0;) %2[_c++] = false; \
for(_c = 0; getarg(%1, _c) != 0;) %2[_c] = getarg(%1, _c++); \
} \
while(%1 == -1)
pawn Код:
PrintArrayArguments(...)
{
new n = numargs(), i, tmp[128], save[16];
for(i = 0; i < n; i++)
{
getarray(i, save);
format(tmp, sizeof tmp, "%s, \"%s\"", tmp, save);
}
printf("Function(%s)", tmp[2]);
}