Saving accounts on timer
#1

So my idea is I want the player to play for 4 minutes before his/her account is saved. This is what I did, What am I doing wrong?

pawn Код:
SetTimerEx("SaveUserData", 240000, false, "d", playerid);

stock SaveUserData(playerid)
{
    new Hashpass[129];
    WP_Hash(Hashpass, sizeof(Hashpass), inputtext);

    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"User's Data");
    INI_WriteString(File,      "Password",      Hashpass);
    INI_WriteInt(File,         "Admin",         PlayerInfo[playerid][pAdmin] = 0);
    INI_WriteInt(File,         "Money",         PlayerInfo[playerid][pMoney] = 0);
    INI_WriteInt(File,         "Kills",         PlayerInfo[playerid][pKills] = 0);
    INI_WriteInt(File,         "Deaths",        PlayerInfo[playerid][pDeaths] = 0);
    INI_WriteInt(File,         "Interior",      PlayerInfo[playerid][pInterior] = 0);
    INI_WriteInt(File,         "VirtualWorld",  PlayerInfo[playerid][pVirtualWorld] = 0);
    INI_WriteInt(File,         "Skin",          PlayerInfo[playerid][pSkin] = 0);
    INI_WriteFloat(File,       "PositionX",     PlayerInfo[playerid][pPositionX] = 0);
    INI_WriteFloat(File,       "PositionY",     PlayerInfo[playerid][pPositionY] = 0);
    INI_WriteFloat(File,       "PositionZ",     PlayerInfo[playerid][pPositionZ] = 0);
    INI_WriteFloat(File,       "Angle",         PlayerInfo[playerid][pAngle] = 0);
    return 1;
}
Reply
#2

pretty sure SaveUserData has to be a public function, and you have to forward it.
Reply
#3

Nordic is right, timers only work on public functions. Also, don't forget to INI_Close.

EDIT:

Why are you setting variables to zero in the INI_Write functions?
Reply
#4

Whoops, Yea that's right.

EDIT:

Is there a problem when I set all the variables to 0 after the account is registered?
Reply
#5

This isn't working out for me. I need some help with this please. What I want is for the player to register but I don't want their account to save until 3 minutes of gameplay.
Reply
#6

Bump.
Reply
#7

You messed it up a little bit.
Explain in details what do you want to make, because I'm confused!

Q: A player joins to your server, he registers and he leaves after 2 minutes, then what?
- Will you delete his account?

Q: A players doesn't register if your reg system is with commands, what will happen?

I need some details for it.
Reply
#8

Dwane you need a vacation or Learn how to understand the words he put out.. I Know what he talking about and they done answered it.. HE WANTS TO SAVE PLAYERS STATS EVER 4 MINUTES OF GAME PLAY.... IF they Are Connected for 4 MINUTES SO you Need to REMOVE THE Registration Stuff Or Store there password Or Skip The Registration and Start a TIMER.... And when timer goes off POPUP A DIALOG TO ASK THEM IF THEY WANT TO REGISTER.... THen Store there Stats

If They Dont Well Then There User Data Wont be Stored they would start all over And Just Kill the Timer So dont ask them again... And Give them the Option TO Type /Register to call on the Registration Dialogs Or what ever you Like to Have..
Reply
#9

Okay, I will explain.

What I want is, The player registers but he leaves within the three minutes gameplay limit so then his account is deleted. The player needs to play for more than three minutes so his account can be successfully saved.
Reply
#10

Quote:
Originally Posted by Buzzbomb
Посмотреть сообщение
Dwane you need a vacation or Learn how to understand the words he put out.. I Know what he talking about and they done answered it.. HE WANTS TO SAVE PLAYERS STATS EVER 4 MINUTES OF GAME PLAY.... IF they Are Connected for 4 MINUTES SO you Need to REMOVE THE Registration Stuff Or Store there password Or Skip The Registration and Start a TIMER.... And when timer goes off POPUP A DIALOG TO ASK THEM IF THEY WANT TO REGISTER.... THen Store there Stats

If They Dont Well Then There User Data Wont be Stored they would start all over And Just Kill the Timer So dont ask them again... And Give them the Option TO Type /Register to call on the Registration Dialogs Or what ever you Like to Have..
Calm Down. He was just asking.

Anyway its possible thought variebles
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)