Problem
#1

Hey,

I got a problem: When I use the following it only saves 3 of the 4 numbers. For example if I insert 1234 it only saves 123.

My Code:

Код:
format(PlayerInfo[playerid][userpin], 4, "%i", strval(inputtext));
Reply
#2

serach for enum and look in that enum for userpin.
adjust the size there to 4
Reply
#3

Quote:
Originally Posted by legodude
Посмотреть сообщение
adjust the size there to 4
Be more specific?
Reply
#4

Well 1234 is an integer so I don't need to set the size in the enum. Aswell I tested it anyways and I still got the result that it saves 123.
Reply
#5

Quote:
Originally Posted by GiS
Посмотреть сообщение
Well 1234 is an integer so I don't need to set the size in the enum. Aswell I tested it anyways and I still got the result that it saves 123.
new userpin[MAX_PLAYERS][20];
Use that? lol
Reply
#6

I don't get it why I need to add this? I got them userpin in my pInfo enum so why should I add new userpin[MAX_PLAYERS][20]??
Reply
#7

Yes, 1234 is an integer. But you're formatting PlayerInfo[playerid][userpin] which is a string.

You need to change the size from 4 to 5. This is because after the content of the string, there is another character '/0' which denotes the end of the string. It is automatically added in for you, but it needs one cell space.
Reply
#8

Solved - Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)