Problem with a string.. Saves d in front..
#1

Hello dear samp users.. I have a problem with my string saving..

Here it is how it saves..
pawn Код:
BankCardBNr = d22
BankCardPin = d168
Here is the random generation code..

pawn Код:
new  CardBNr[4], CardPin[5];
format(CardBNr, sizeof(CardBNr),"d%d%d", random(10), random(10), random(10), random(10));
                format(CardPin, sizeof(CardPin),"d%d%d%d", random(10), random(10),random(10), random(10), random(10));
Here is the saving:

pawn Код:
INI_WriteString(File,"BankCardBNr",CardBNr);
                INI_WriteString(File,"BankCardPin",CardPin);
With best regards Scrillex!
Reply
#2

Problem found... Forgot in front to set %!
Reply
#3

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Hello dear samp users.. I have a problem with my string saving..

pawn Код:
format(CardPin, sizeof(CardPin),"d%d%d%d", random(10), random(10),random(10), random(10), random(10));
!
Код:
"d%d%d%d",
That code is incorrect..

It's
pawn Код:
%d%d%d%d
Reply
#4

Quote:
Originally Posted by Prokill911
Посмотреть сообщение
Код:
"d%d%d%d",
That code is incorrect..

It's
pawn Код:
%d%d%d%d
That's what he said...

You also have 5 arguments and only 4 specifiers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)