Dini issue
#5

Код:
enum PlayerStats
{
    FavSkin
}
pStats[MAX_PLAYERS][PlayerStats];
Код:
public OnPlayerConnect(playerid)
{
    new file[256];
    format(file, sizeof file, "Stats/%s.ini", PlayerName(playerid));

    if(!dini_Exists(file))
    {
        dini_Create(file);
        dini_IntSet(file, "FavSkin", 300);
        return 1;
    }
    if(dini_Exists(file))
    {
        if(dini_Int(file, "FavSkin") < 300)
	pStats[playerid][FavSkin] = dini_Int(file, "FavSkin");
        return 1;
    }
}

public OnPlayerSpawn(playerid)
{
    new file[256];
    format(file, sizeof file, "Stats/%s.ini", PlayerName(playerid));
    if(dini_Exists(file))
    {
        SetPlayerSkin(playerid, pStats[playerid][FavSkin]);
    }
    return 1;
}

CMD:favouriteskin(playerid, params[])
{
    #pragma unused params
    if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
    new file[256];
    format(file, sizeof file, "Stats/%s.ini", PlayerName(playerid));
    dini_IntSet(file, "FavSkin", GetPlayerSkin(playerid));
    pStats[playerid][FavSkin] = GetPlayerSkin(playerid);
    SendClientMessage(playerid, COLOR_PINK, "You Have Successfully Saved Your Skin.");
    return 1;
}
Reply


Messages In This Thread
Dini issue - by Ananisiki - 19.03.2014, 16:42
Re: Dini issue - by MP2 - 19.03.2014, 16:55
Re: Dini issue - by Ananisiki - 20.03.2014, 05:05
Re: Dini issue - by MythicalMarauder - 20.03.2014, 07:17
Re: Dini issue - by VishvaJeet - 20.03.2014, 07:29
Re: Dini issue - by Ananisiki - 20.03.2014, 11:55
Re: Dini issue - by Sascha - 20.03.2014, 12:11
Re: Dini issue - by VishvaJeet - 20.03.2014, 12:49
Re: Dini issue - by Ananisiki - 20.03.2014, 13:01
AW: Dini issue - by Macronix - 20.03.2014, 13:29

Forum Jump:


Users browsing this thread: 1 Guest(s)