21.07.2011, 14:56
I made this function and as compiled is working,but the caar is not added
Of course this is not all the code,but why is not working?ok so here's enum CarInfo
so what's wor ng?
pawn Код:
stock AddBuyableVehicle(FileName[],Cost,Float:vx,Float:vy,Float:vz,CarModel)
{
if(!dini_Exists("Owners.ini"))
{
dini_Create("Owners.ini");
}
CarCount ++;
new ID = CarCount;
CarInfo[ID][CarPrice] = Cost;
CarInfo[ID][vX] = vx;
CarInfo[ID][vY] = vy;
CarInfo[ID][vZ] = vz;
CarInfo[ID][Model] = CarModel;
format(CarInfo[ID][CarOwner], 24, "CarOwnerName");
if(strlen(dini_Get("Owners.ini", FileName)))
{
format(CarInfo[ID][CarOwner], 24, "%s", dini_Get("Owners.ini", FileName));
CarInfo[ID][Owned] = 1;
}
CarInfo[ID][ForSell] = 1;
}
pawn Код:
enum carinfo
{
CarNames[60],
CarOwner[24],
CarPrice,
Owned,
Float:vX,
Float:vY,
Float:vZ,
ForSell,
Model
}