Can someone help me with this? -
Fj0rtizFredde - 16.06.2009
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
Re: Can someone help me with this? -
Fj0rtizFredde - 16.06.2009
Nobody knows the problem??
And sorry for dubble post :P
Re: Can someone help me with this? -
Grim_ - 16.06.2009
Are you saving the times the player connects inside a folder, that way it won't reset everytime he connects?
Re: Can someone help me with this? -
Fj0rtizFredde - 16.06.2009
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
Re: Can someone help me with this? -
Grim_ - 16.06.2009
Ok, well if you don't mind, can you show some more code? Such as how you save and load the player files.
Re: Can someone help me with this? -
Fj0rtizFredde - 16.06.2009
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
Re: Can someone help me with this? -
Fj0rtizFredde - 17.06.2009
Anyone knows how to fix it?
Re: Can someone help me with this? -
Klutty - 17.06.2009
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
Re: Can someone help me with this? -
Fj0rtizFredde - 17.06.2009
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
Re: Can someone help me with this? -
Weirdosport - 17.06.2009
value = GetFileValue(pass);
Summat to do with passwords?