Saving Players
#1

Hey,

I was wondering if this stock function would save the player correctly or just ruin the file
pawn Код:
stock SavePlayer(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    new name[MAX_PLAYER_NAME];
    INI_SetTag(File,"Account Info");
    INI_WriteInt(File,"Username",GetPlayerName(playerid,name,MAX_PLAYER_NAME));
    INI_WriteInt(File,"Password",udb_hash(inputtext));
    INI_WriteInt(File,"Administrator",0);
    INI_WriteInt(File,"Donator",0);
    INI_SetTag(File,"Banned Info");
    INI_WriteInt(File,"Cheater",0);
    INI_WriteInt(File,"Banned",0);
    INI_WriteInt(File,"Muted",0);
    INI_SetTag(File,"Other Info");
    INI_WriteInt(File,"Times Robbed",0);
    INI_WriteInt(File,"Robbed",0);
    INI_WriteInt(File,"Wanted Levels Gained",0);
    INI_WriteInt(File,"Kills",0);
    INI_WriteInt(File,"Deaths",0);
    INI_WriteInt(File,"Score",0);
    INI_WriteInt(File,"Cash",15000);
    INI_SetTag(File,"Float Info");
    INI_WriteFloat(File,"Armour",0);
    INI_WriteFloat(File,"Health",100);
    INI_Close(File);
}
Basically i need it to update the players file, this is so if the player crashes it will stop the loss of information so much.

Thanks
Reply


Messages In This Thread
Saving Players - by xMichaelx - 04.12.2011, 23:09
Re: Saving Players - by English-Conceptz - 04.12.2011, 23:15
Re: Saving Players - by WLSF - 04.12.2011, 23:20

Forum Jump:


Users browsing this thread: 2 Guest(s)