Y_INI Cars Don't Load
#1

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?
Reply
#2

Does the file LARP/Vehicles exist?
Reply
#3

I bet problem is in %d-%s
Reply
#4

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.
Reply
#5

-FIXED!!-

String was too short. [26];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)