SA-MP Forums Archive
Y_INI Cars Don't Load - 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: Y_INI Cars Don't Load (/showthread.php?tid=468252)



Y_INI Cars Don't Load - UnknownGamer - 07.10.2013

pawn Код:
forward LoadCar(playerid);
public LoadCar(playerid)
{
    new file[26], count, sname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sname, sizeof(sname));
    for(new idx; idx < sizeof(CarInfo) ; idx++)
    {
        format(file, sizeof(file),"LARP/Vehicles/%d-%s.ini", idx, sname);
        if(fexist(file))
        {
            count++;
            INI_ParseFile(file, "LoadVehicles_veh", .bExtra = true, .extra = idx);
            printf("%s Loaded Car ID %d", sname, idx);
        }
    }
    printf("[SCRIPT]: Loaded %s %d Owned Vehicles [Y_INI].", sname, idx);
    return 1;
}
What code did I do wrong there

pawn Код:
format(file, sizeof(file),"LARP/Vehicles/%d-%s.ini", idx, sname);
        if(fexist(file))
        {
            count++;
            INI_ParseFile(file, "LoadVehicles_veh", .bExtra = true, .extra = idx);
            printf("%s Loaded Car ID %d", sname, idx);
        }
It's not printing that at all. So It's not getting the file correctly?


Re: Y_INI Cars Don't Load - TonyII - 07.10.2013

Does the file LARP/Vehicles exist?


Re: Y_INI Cars Don't Load - Scrillex - 07.10.2013

I bet problem is in %d-%s


Re: Y_INI Cars Don't Load - TonyII - 07.10.2013

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
I bet problem is in %d-%s
%d stands for ID and the %s stands for the name, can't see anything wrong with that.


Re: Y_INI Cars Don't Load - UnknownGamer - 08.10.2013

-FIXED!!-

String was too short. [26];