Numbers stay in 1.
#1

Well i'm creating a Registered.ini in /Logs
but when i make a second account it still 1. instead 2.

i try this

pawn Код:
new file[256], PCount = 0;
PCount++;
format(file, sizeof(file), "Server/Logs/Registered.ini");
new File:User = fopen(file, io_append);
format(string, sizeof(string), "%d. %s\r\n", PCount, GetName(playerid));
fwrite(User, string);
fclose(User);
printf("New Registered User %s, User Number %d", GetName(playerid), PCount);
+ How can i check the Registered.ini for my Player Counting?
Reply
#2

Bump
Reply
#3

Because you are creating PCount in this code, not global and with loading.
Reply
#4

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Because you are creating PCount in this code, not global and with loading.
As said you are creating variable pCount each time someone registers and setting it to 0.
pawn Код:
new PCount = 0;
Then you add 1 unit to it:
pawn Код:
PCount++;
PCount is now 1.
And then it saves it as one. Each time someone registers same process happens. To fix this add
pawn Код:
new pCount = 0;
When someone registers only
pawn Код:
PCount++;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)