[Help] Adding +1 (OffLine) (INI_WriteInt)
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
#define USER_PATH   "/Users/%s.ini"
new off_warn;

forward OfflineWarn(name[], value[]);
public OfflineWarn(name[], value[])
{
    INI_Int("Warn",off_warn);
    return 1;
}

YCMD:offwarn(playerid, params[],help)
{
        #pragma unused help
    if(isnull(params)) SCM(playerid,-1,"/offwarn [NICK]");
    else if(!(2 < strlen(params) < MAX_PLAYER_NAME)) SendClientMessage(playerid,-1,"Error: Incorrect name lenght.");
    else
    {
        new str[60];
        off_warn = 0;
        format(str, sizeof(str),USER_PATH,params);
        if(!INI_ParseFile(str, "OfflineWarn")) SendClientMessage(playerid,-1,"Error: Account doesn't exists.");
        else
        {
            new INI:iniFile = INI_Open(str);
            INI_SetTag(iniFile,"data");
            INI_WriteInt(iniFile,"Warn",off_warn + 1);
            INI_Close(iniFile);
        }
    }
    return 1;
}
I believe its working, thanks for good path, REP+ to you, thank you very much!
Reply


Messages In This Thread
[Help] Adding +1 (OffLine) (INI_WriteInt) - by David (Sabljak) - 05.11.2015, 15:14
Re: [Help] Adding +1 (OffLine) (INI_WriteInt) - by AbyssMorgan - 05.11.2015, 15:24
Re: [Help] Adding +1 (OffLine) (INI_WriteInt) - by David (Sabljak) - 05.11.2015, 17:27
Re: [Help] Adding +1 (OffLine) (INI_WriteInt) - by Jefff - 05.11.2015, 21:12
Re: [Help] Adding +1 (OffLine) (INI_WriteInt) - by David (Sabljak) - 06.11.2015, 09:00

Forum Jump:


Users browsing this thread: 1 Guest(s)