SA-MP Forums Archive
Pawno Crashing Y_INI CMD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pawno Crashing Y_INI CMD (/showthread.php?tid=461421)



Pawno Crashing Y_INI CMD - UnknownGamer - 01.09.2013

pawn Код:
CMD:asellcar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new string[256], file[64], car[64], vid;
        vid = GetPlayerVehicleID(playerid);
        format(file, sizeof(file),"LARP/Users/%s.ini", CarInfo[vid][cOwner]);
        new INI:ufile = INI_Open(file);
        if(fexist(file))
        {
            if(INI_Int(ufile,"Car") == vid)
            {
                INI_WriteInt(ufile, "Car", 9999);
            }
            if(INI_Int(ufile,"Car2") == vid)
            {
                INI_WriteInt(ufile, "Car2", 9999);
            }
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            format(string, sizeof(string), "{FF0000}[AdmCmd]{FFFFFF}: You have just admin sold vehicle-id: %d.", vid);
            SCM(playerid, COLOR_WHITE, string);
            DestroyVehicle(vid);
        }
        INI_Close(ufile);
        format(car, sizeof(car),"LARP/Vehicles/%d.ini", vid);
        fremove(car);
    }
    return 1;
}
The crash has something to do with the lines:

pawn Код:
if(INI_Int(ufile,"Car") == vid)
            {
                INI_WriteInt(ufile, "Car", 9999);
            }
            if(INI_Int(ufile,"Car2") == vid)
            {
                INI_WriteInt(ufile, "Car2", 9999);
            }
Any idea?