Printf doesn't work? :S
#1

Hey,

I have a problem with printf function; tmp is set to "blablabla" and this is the code:

Код:
			printf("[team] %s: %s", name, playerid, tmp); //returns: "[team] Fallout: "
			print(tmp); //returns: blablabla
it doesn't show the tmp in the first line :S
and when I print 'tmp' variable, it shows me the text 'blablabla' so it's not an empty string!

I tried to first format the string, and then sending it with print(); function but that also doesn't work :
Reply
#2

pawn Код:
printf("[team] %s (%d): %s", name, playerid, tmp);
Reply
#3

pawn Код:
printf("[team] %s (%d): %s", name, playerid, tmp);
You forgot the '%d' placeholder
Reply
#4

Try to increase the string length..(ex.: new string[256]; )..other method i don't know..because i got the same thing you have in my Administrator System, but it works.

Edit: Isn't the playerid detected with
pawn Код:
"%i"
?
Reply
#5

aaah I didn't see that it was missing :O
I thought like "wtf? I use %s and tmp isn't empty so why doesn't it just show??"

hehe
thanks!
Reply
#6

Quote:
Originally Posted by Iuri
Посмотреть сообщение
Try to increase the string length..(ex.: new string[256]; )..other method i don't know..because i got the same thing you have in my Administrator System, but it works.

Edit: Isn't the playerid detected with
pawn Код:
"%i"
?
%i or %d both possible,

I always use %i since it is an integer

oh sorry for double-posting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)