dini to y_ini
#1

Can someone help me with this i want to change these from dini to yini

pawn Код:
public OnPlayerConnect(playerid)
{
    gTeam[playerid] = 0;
    CopDuty[playerid] = 0;
    Info[playerid][Jailed] = 0;
    Info[playerid][JailTime] = 0;
    new string[128], Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Playername, sizeof(Playername));
    format(string, sizeof(string), "Police System/%s.ini", Playername);
    if(fexist(string))
    {
        gTeam[playerid] = dini_Int(string, "Team");
        Info[playerid][Jailed] = dini_Int(string, "Jailed");
        Info[playerid][JailTime] = dini_Int(string, "Jail Timer");
        SetPlayerWantedLevel(playerid, dini_Int(string, "Wanted Level"));
        if((gTeam[playerid] <= 8) && (gTeam[playerid] > 0))
        {
            Info[playerid][Arrests] = dini_Int(string, "Arrests");
            Info[playerid][Tickets] = dini_Int(string, "Tickets");
            Info[playerid][Suspected_Players] = dini_Int(string, "Suspected Players");
        }
    }
    else
    {
        dini_Create(string);
        dini_IntSet(string, "Team", gTeam[playerid]);
        dini_IntSet(string, "Jailed", Info[playerid][Jailed]);
        dini_IntSet(string, "Jail Timer", Info[playerid][JailTime]);
        dini_IntSet(string, "Wanted Level", GetPlayerWantedLevel(playerid));
        dini_IntSet(string, "Arrests", Info[playerid][Arrests]);
        dini_IntSet(string, "Tickets", Info[playerid][Tickets]);
        dini_IntSet(string, "Suspected Players", Info[playerid][Suspected_Players]);
    }
    if(Info[playerid][Jailed] == 1)
    {
        SendClientMessage(playerid, RED, "You can't escape your punishment, you are still in jail!");
        SetTimerEx("JailPlayer",3000,0,"d",playerid);
        JailTimer[playerid] = SetTimerEx("UnjailPlayer",Info[playerid][JailTime],0,"d",playerid);
    }
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new string[128], Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Playername, sizeof(Playername));
    format(string, sizeof(string), "Police System/%s.ini", Playername);
    if(fexist(string))
    {
        dini_IntSet(string, "Team", gTeam[playerid]);
        dini_IntSet(string, "Jailed", Info[playerid][Jailed]);
        dini_IntSet(string, "Jail Timer", Info[playerid][JailTime]);
        dini_IntSet(string, "Wanted Level", GetPlayerWantedLevel(playerid));
        if((gTeam[playerid] <= 8) && (gTeam[playerid] > 0))
        {
            dini_IntSet(string, "Arrests", Info[playerid][Arrests]);
            dini_IntSet(string, "Tickets", Info[playerid][Tickets]);
            dini_IntSet(string, "Suspected Players", Info[playerid][Suspected_Players]);
        }
    }
    else
    {
        dini_Create(string);
        dini_IntSet(string, "Team", gTeam[playerid]);
        dini_IntSet(string, "Jailed", Info[playerid][Jailed]);
        dini_IntSet(string, "Jail Timer", Info[playerid][JailTime]);
        dini_IntSet(string, "Wanted Level", GetPlayerWantedLevel(playerid));
        if((gTeam[playerid] <= 8) && (gTeam[playerid] > 0))
        {
            dini_IntSet(string, "Arrests", Info[playerid][Arrests]);
            dini_IntSet(string, "Tickets", Info[playerid][Tickets]);
            dini_IntSet(string, "Suspected Players", Info[playerid][Suspected_Players]);
        }
    }
    if(CopDuty[playerid] == 1)
    {
        ResetPlayerWeapons(playerid);
        CopDuty[playerid] = 0;
        return 1;
    }
    return 1;
}
------
My ENUM is
pawn Код:
enum pInfo
{
    pPass[129],
    pCash, // Game money
    pAdmin, // Is admin
    pVIP, // Is VIP
    pBanned, // Player banned
    pSkin, // Skin ID
    pKills, // Amount of KILLS
    pDeaths, // Amount of DEATHS
    pWarnings, // Player warnings
    pCrimes, // if commited any crimes
    pFines, // If fined by cops
    pDrunk, // Is drunk 0 = NO / 1 = Yes
    pSex, //Male/Female
    pWcard, // Police warrent card
    pGunLic, //Gun license
    pDrivingLic, //Driving license
    pBoatLic, //Boat license
    pFlyLic, // Pilot license
    pTruckLic, // Truck/HGV license
    pBusLic, //Bus license
    pTaxiLic, //Taxi license
    pBikeLic, // Mototbike license
    Faction,
    Rank
   
}
Reply
#2

Have you seen some Y_INI tutorials over the tutorial section? You have to convert your system yourself, nobody is going to do it for you! Right if you have any problems, you can always request for some help.

1. How to use Y_INI
2. Login - Register system Y_INI
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)