Multiple lines in save fiel
#4

While I was searching, I found a good quote from ****** why the file saves more than twice or every time you execute the callback/function
Quote:
Originally Posted by ******
Посмотреть сообщение
You can't have spaces in keys.
Let me clear this out, ****** said you are not allowed to use spaces, I would suggest you to use _ Underscore instead of space

pawn Код:
forward SaveChar(playerid);
public SaveChar(playerid)
{  
    if(!IsPlayerConnected(playerid)) return 1;

    if(GetPVarInt(playerid, "prelogin") == 1)
        return print("Did not save, not logged in.");

    if(GetPVarInt(playerid, "Quiz") == 1)
        return print("Did not save, in quiz.");

    if(Connected[playerid] != 1)
        return print("Did not save, not logged in.");

    if(AdminDuty[playerid] == 1)
        return print("Did not save, admin duty.");

     // MAX_PLAYERIP 15+1 = 16 | //MAX_PLAYER_NAME = 23+1 = 24
    new
        Float:hp, Float:Position[ 3 ];
    GetPlayerHealth(playerid, hp), GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
    GetPlayerIp(playerid, PlayerInfo[playerid][pIp], 16), GetPlayerName(playerid, PlayerInfo[playerid][pName], 24);

    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Driver_License", PlayerInfo[playerid][pDLicense]);
    INI_WriteInt(File,"Commercial_License", PlayerInfo[playerid][pCLicense]);
    INI_WriteInt(File, "Tickets", PlayerInfo[playerid][pTickets]);
    INI_WriteInt(File, "Ticket_Total", PlayerInfo[playerid][pTicketstotal]);
    INI_Close(File);

    new string[100];
    format(string, 100, "%s's character has saved successfully.", GetName(playerid));
    print(string);
    return 1;
}

forward LoadUser_data(playerid, name[], value[]);
public LoadUser_data(playerid, name[], value[])
{  
    INI_Int("Driver_License", PlayerInfo[playerid][pDLicense]);
    INI_Int("Commercial_License", PlayerInfo[playerid][pCLicense]);
    INI_Int("Tickets", PlayerInfo[playerid][pTickets]);
    INI_Int("Tickets_Total", PlayerInfo[playerid][pTicketstotal]);
    return 1;
}
Reply


Messages In This Thread
Multiple lines in save fiel - by Blademaster680 - 17.12.2013, 15:52
Re: Multiple lines in save fiel - by Patrick - 17.12.2013, 15:54
Re: Multiple lines in save fiel - by Blademaster680 - 17.12.2013, 15:56
Re: Multiple lines in save fiel - by Patrick - 17.12.2013, 16:11
Re: Multiple lines in save fiel - by Blademaster680 - 17.12.2013, 16:19

Forum Jump:


Users browsing this thread: 2 Guest(s)