Can someone help me with this?
#1

Hi all
I need some help with get how many times you have visit the server.
I have done somthing like this
OnPlayerConnect:
pawn Код:
AccountInfo[playerid][Visits]++;
But it doesn't count it just says Visits: 0 in my game
Tell me if you need more info about the code

//Sry for bad english but I hope you know my problem :P
Reply
#2

Nobody knows the problem??

And sorry for dubble post :P
Reply
#3

Are you saving the times the player connects inside a folder, that way it won't reset everytime he connects?
Reply
#4

Quote:
Originally Posted by Swift_
Are you saving the times the player connects inside a folder, that way it won't reset everytime he connects?
No im saving it to the players account file :P
And I have also tryed to do:
pawn Код:
AccountInfo[playerid][Visits] += 1;
But it didnt work
Reply
#5

Ok, well if you don't mind, can you show some more code? Such as how you save and load the player files.
Reply
#6

Quote:
Originally Posted by Swift_
Ok, well if you don't mind, can you show some more code? Such as how you save and load the player files.
Ok
pawn Код:
enum Info
{
    Visits,
};
new AccountInfo[MAX_PLAYERS][Info];

//Onplayerregister:
format(file, sizeof file, "Visits: %d\n\r", AccountInfo[playerid][Visits]);
{   fwrite(account, file); }

//OnPlayerUpdateAccount:
format(file, sizeof file, "Visits: %d\n\r", AccountInfo[playerid][Visits]);
{   fwrite(account, file); }


//Onplayerlogin:
if (strfind(passres, "Visits") != -1)
{
value = GetFileValue(pass);
AccountInfo[playerid][Visits] = strval(value);
}

//Onplayerconnect:
AccountInfo[playerid][Visits] ++;

//And my function to see the stats:

format(str, 128, "Visits: %d", AccountInfo[playerid][Visits]);
SendClientMessage(playerid, 0xADFF2FAA, str);
It is just the saving stuff I have alot of more codes but I hope you get how it is build :P
Reply
#7

Anyone knows how to fix it?
Reply
#8

I dont want to help you, because you're a fjеrtizz and I dont like fjortisar.

I would help you but im not that good with Enums. :P
Reply
#9

Quote:
Originally Posted by Klutty
I dont want to help you, because you're a fjеrtizz and I dont like fjortisar.

I would help you but im not that good with Enums. :P
hahaha just because my name is Fj0rtiz doesn't mean that i am a fjortis :P
Well anyway.. the only problem is that it doesnґt count how many times you have visit the server
Reply
#10

value = GetFileValue(pass);

Summat to do with passwords?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)