26.01.2018, 07:03
Код:
stock LoadPics() { new str[256]; for(new i= 1; i < MAX_WEAPS; i++) { if(PicIDTaken[i] == 0) continue; format(str, sizeof(str), "p%d", i); WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfiles, str), "PickupModel"); WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfiles, str), "X"); WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfiles, str), "Y"); WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfiles, str), "Z"); WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfiles, str), "Int"); WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfiles, str), "World"); WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfiles, str), "Ammo"); WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfiles, str), "Type"); WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld], WeapPic[i][wInt], -1, 70.0); //CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0); PicIDTaken[i] = 1; } return 1; }
you're doing a check for if pickup exist before even loading them? lol
PHP код:
stock LoadPics()
{
new str[256];
for(new i= 1; i < MAX_WEAPS; i++)
{
format(str, sizeof(str), "p%d", i);
if(!fexist(AddDirFile(dir_pickupfiles, str)))
continue;
WeapPic[i][wPickupM] = dini_Int(AddDirFile(dir_pickupfiles, str), "PickupModel");
WeapPic[i][wX] = dini_Float(AddDirFile(dir_pickupfiles, str), "X");
WeapPic[i][wY] = dini_Float(AddDirFile(dir_pickupfiles, str), "Y");
WeapPic[i][wZ] = dini_Float(AddDirFile(dir_pickupfiles, str), "Z");
WeapPic[i][wInt] = dini_Int(AddDirFile(dir_pickupfiles, str), "Int");
WeapPic[i][wWorld] = dini_Int(AddDirFile(dir_pickupfiles, str), "World");
WeapPic[i][wAmmo] = dini_Int(AddDirFile(dir_pickupfiles, str), "Ammo");
WeapPic[i][wType] = dini_Int(AddDirFile(dir_pickupfiles, str), "Type");
WeapPic[i][wPickup] = CreateDynamicPickup(WeapPic[i][wPickupM], WeapPic[i][wType], WeapPic[i][wX], WeapPic[i][wY], WeapPic[i][wZ], WeapPic[i][wWorld], WeapPic[i][wInt], -1, 70.0);
//CreateDynamic3DTextLabel(str, COLOR_YELLOW, WeapPic[idx][wX], WeapPic[idx][wY], WeapPic[idx][wZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
PicIDTaken[i] = 1;
}
return 1;
}