11.02.2015, 12:24
pawn Код:
stock LoadShops()
{
new file[50];
for(new i = 0; i < MAX_SHOPS; i++)
{
format(file, sizeof(file), "Shops/%d.ini", i);
if(fexist(file))
{
ShopInfo[i][Robbable] = 1;
ShopInfo[i][EnterX] = dini_Int(file, "EnterPickX");
ShopInfo[i][EnterY] = dini_Int(file, "EnterPickY");
ShopInfo[i][PickZ] = dini_Float(file, "PickZ");
ShopInfo[i][ExitPosX] = dini_Float(file, "ExitPosX");
ShopInfo[i][ExitPosY] = dini_Float(file, "ExitPosY");
ShopInfo[i][EnterPosX] = dini_Float(file, "EnterPosX");
ShopInfo[i][EnterPosY] = dini_Float(file, "EnterPosY");
ShopInfo[i][EnterPosZ] = dini_Float(file, "EnterPosZ");
ShopInfo[i][ExitX] = dini_Float(file, "ExitX");
ShopInfo[i][ExitY] = dini_Float(file, "ExitY");
ShopInfo[i][ExitZ] = dini_Float(file, "ExitZ");
ShopInfo[i][EnterFAngle] = dini_Float(file, "EnterFAngle");
ShopInfo[i][ExitFAngle] = dini_Float(file, "ExitFAngle");
ShopInfo[i][RobberyCheckX] = dini_Float(file, "RobberyCheckX");
ShopInfo[i][RobberyCheckY] = dini_Float(file, "RobberyCheckY");
ShopInfo[i][RobberyCheckZ] = dini_Float(file, "RobberyCheckZ");
ShopInfo[i][Maxmoney] = dini_Int(file, "Maxmoney");
ShopInfo[i][Minmoney] = dini_Int(file, "Minmoney");
ShopInfo[i][Interior] = dini_Int(file, "Interior");
ShopInfo[i][Mapiconid] = dini_Int(file, "Mapiconid");
ShopInfo[i][RobberyValue] = dini_Int(file, "RobberyValue");
strmid(ShopInfo[i][Name], dini_Get(file, "Name"), false, strlen(dini_Get(file, "Name")), MAX_SHOP_NAME);
strmid(ShopInfo[i][sLocation], dini_Get(file, "Location"), false, strlen(dini_Get(file, "Location")), MAX_SHOP_NAME);
ShopInfo[i][RCP] = CreateDynamicCP(ShopInfo[i][RobberyCheckX],ShopInfo[i][RobberyCheckY], ShopInfo[i][RobberyCheckZ], 2.5, i, ShopInfo[i][Interior], -1, 100.0);
ShopInfo[i][Label] = Create3DTextLabel(ShopInfo[i][Name], COLOR_WHITE, ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ], 30.0, 0, 0);
ShopInfo[i][Mapicon] = CreateDynamicMapIcon(ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ], ShopInfo[i][Mapiconid], COLOR_WHITE, 0, 0, -1, 100.0, MAPICON_LOCAL);
ShopInfo[i][PickEnter] = CreateDynamicPickup(19197, 23 ,ShopInfo[i][EnterX], ShopInfo[i][EnterY], ShopInfo[i][PickZ],0,0,-1,100.0);
ShopInfo[i][PickExit] = CreateDynamicPickup(19197, 23, ShopInfo[i][ExitX], ShopInfo[i][ExitY], ShopInfo[i][ExitZ], sid, ShopInfo[i][Interior], -1, 100.0);
sid++;
}
}
return 1;
}
pawn Код:
sid++
It's saving correctly, but not loading.