Problem with function: 'format'
#1

Hi, I'm having a problem with format.

I'm writing a small account script for a friends server.
The function 'format' doesn't seem to be working properly:
pawn Код:
new str[128];

format(str, 128, "%s, 0", inputtext);

print(str); // PRINT 1
printf("%s, 0", inputtext); // PRINT 2

Fini_SetStr(GetName(playerid));
"PRINT 1" : 's'
"PRINT 2" : '<password>, 0'

I don't see any problem with it
It's not the writing function [Fini] because the print is set before that, and the string appears wrong.

This is confusing and pissing me off, any help would be appreciated.
Reply
#2

Nooot sure...
pawn Код:
new str[128];

format(str, 128, "%s, 0", inputtext); // This will print everything inside the " ", why did you put , 0  ?

print(str); // PRINT 1
printf("%s, 0", inputtext);

Fini_SetStr(GetName(playerid));
And do u got inputtext defined?
Reply
#3

'inputtext' is from the callback OnDialogResponse, if I set up a print with it, it prints the password fine.

"%s, 0" - 0 is the admin level parameter, this is register dialog, admin defaults to 0
Reply
#4

Use strcat
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)