Y_INI crashes my compiler?
#1

Hey, there. I'm currently working on a vehicles system that saves/loads my vehicles from a .ini file. I'm kind of following a tutorial where pseudo(??) is being used and I'm trying to make it using Y_INI. The problem is that when I add a certain line to my code, my compiler implodes.
Here's my stock function.
pawn Код:
stock LoadVehicle(filename[36])
{
    new INI:File = INI_Open(vehiclePATH(filename));
    CreateVehicleEx(INI_Int(File, "Model"), INI_Float(File, "XSpawn"), INI_Float(File, "YSpawn"), INI_Float(File,                   "SpawnAngle", INI_Int(File, "Color1"), INI_Int(File, "Color2"),INI_Int(File, "RespawnTime"), INI_String(File, "Owner");
    INI_Close(File);
}
If I comment out that line, it compiles OK but obviously doesn't do anything..

I assume there's little help in posting the CreateVehicleEx here, but I'll do so just in case.

pawn Код:
stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
{
    new carid = GetFreeVehicleSlot();
    carData[carid][model] = modelid;
    carData[carid][xspawn] = x;
    carData[carid][yspawn] = y;
    carData[carid][zspawn] = z;
    carData[carid][anglespawn] = angle;
    carData[carid][col1] = color1;
    carData[carid][col2] = color2;
    carData[carid][respawn] = respawntime;
    carData[carid][owner] = ownername;
    validcar[carid] = true;
    CreateVehicle(modelid, x, y, z, angle, color1, color2, respawntime);
    return carid;
}
Thank you in advance!
Reply
#2

pawn Код:
stock LoadVehicle(filename[36])
{
    new INI:File = INI_Open(vehiclePATH(filename));
    CreateVehicleEx(INI_Int(File, "Model"), INI_Float(File, "XSpawn"), INI_Float(File, "YSpawn"), INI_Float(File,"SpawnAngle", INI_Int(File, "Color1"), INI_Int(File, "Color2"),INI_Int(File, "RespawnTime"), INI_String(File, "Owner");
    INI_Close(File);
}
try
Reply
#3

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
pawn Код:
stock LoadVehicle(filename[36])
{
    new INI:File = INI_Open(vehiclePATH(filename));
    CreateVehicleEx(INI_Int(File, "Model"), INI_Float(File, "XSpawn"), INI_Float(File, "YSpawn"), INI_Float(File,"SpawnAngle", INI_Int(File, "Color1"), INI_Int(File, "Color2"),INI_Int(File, "RespawnTime"), INI_String(File, "Owner");
    INI_Close(File);
}
try
Nope It still crashes.. Like I said, it's the Y_INI part, because if I add CreateVehicleEx(); without the y_ini, it compiles but of course doesn't do anything.
Reply
#4

Should I be using INI_Open, or INI_ParseFile? Could that be an issue? Also, I tried searching for a personal vehicle system for Y_INI but I don't tihnk there is a tutorial about it? Anyway, if anyone knows another way to more effectively make this system, then I would appreciate any suggestions, because this doesn't seem to work at all.
Reply


Forum Jump:


Users browsing this thread: