FreeHardSkill
Умник
что в этом паблике не так?
пишет что машины загружены но не создаются
пишет что машины загружены но не создаются
PHP:
public LoadVehs()
{
new vladname[50];
static rows, fields;
new he;
cache_get_data(rows, fields);
for(new i = 1; i<rows; i++)
{
VehInfo[i][vOwned] = cache_get_field_content_int(i, "Owned");// Занята машина - 1, свободна - 0
VehInfo[i][vOwner] = cache_get_field_content(i, "Owner",vladname);// Владелец
VehInfo[i][vModel] = cache_get_field_content_int(i, "Model");// ИД
VehInfo[i][vType] = cache_get_field_content_int(i, "Type");// ИД
VehInfo[i][vMember] = cache_get_field_content_int(i, "Member");// Принадлеожность к фракции
VehInfo[i][vPosX] = cache_get_field_content_float(i, "PosX");// Координата спауна на авторынке X
VehInfo[i][vPosY] = cache_get_field_content_float(i, "PosY");// Координата спауна на авторынке Y
VehInfo[i][vPosZ] = cache_get_field_content_float(i, "PosZ");// Координата спауна на авторынке Z
VehInfo[i][vAngle] = cache_get_field_content_float(i, "Angle");// Координата поворота спауна на авторынке
VehInfo[i][vColorOne] = cache_get_field_content_int(i, "ColorOne");// Цвет 1
VehInfo[i][vColorTwo] = cache_get_field_content_int(i, "ColorTwo");// Цвет 2
VehInfo[i][vLock] = cache_get_field_content_int(i, "Lock");// Замок: 0 - открыт | 1 - закрыт
VehInfo[i][vMoney] = cache_get_field_content_int(i, "Money");// Цена
VehInfo[i][vParkX] = cache_get_field_content_float(i, "ParkX");// Координата спауна парка X
VehInfo[i][vParkY] = cache_get_field_content_float(i, "ParkY");// Координата спауна парка Y
VehInfo[i][vParkZ] = cache_get_field_content_float(i, "ParkZ");// Координата спауна парка Z
VehInfo[i][vParkAngle] = cache_get_field_content_float(i, "ParkAngle");// Координата поворота спауна парка
VehInfo[i][vmod1] = cache_get_field_content_int(i, "mod1");// Цвет 1
VehInfo[i][vmod2] = cache_get_field_content_int(i, "mod2");// Цвет 1
VehInfo[i][vmod3] = cache_get_field_content_int(i, "mod3");// Цвет 1
VehInfo[i][vmod4] = cache_get_field_content_int(i, "mod4");// Цвет 1
VehInfo[i][vmod5] = cache_get_field_content_int(i, "mod5");// Цвет 1
VehInfo[i][vmod6] = cache_get_field_content_int(i, "mod6");// Цвет 1
VehInfo[i][vmod7] = cache_get_field_content_int(i, "mod7");// Цвет 1
VehInfo[i][vmod8] = cache_get_field_content_int(i, "mod8");// Цвет 1
VehInfo[i][vmod9] = cache_get_field_content_int(i, "mod9");// Цвет 1
VehInfo[i][vmod10] = cache_get_field_content_int(i, "mod10");// Цвет 1
VehInfo[i][vmod11] = cache_get_field_content_int(i, "mod11");// Цвет 1
VehInfo[i][vmod12] = cache_get_field_content_int(i, "mod12");// Цвет 1
VehInfo[i][vmod13] = cache_get_field_content_int(i, "mod13");// Цвет 1
VehInfo[i][vmod14] = cache_get_field_content_int(i, "mod14");// Цвет 1
VehInfo[i][vmod15] = cache_get_field_content_int(i, "mod15");// Цвет 1
VehInfo[i][vmod16] = cache_get_field_content_int(i, "mod16");// Цвет 1
VehInfo[i][vmod17] = cache_get_field_content_int(i, "mod17");// Цвет 1
VehInfo[i][vpaintjob] = cache_get_field_content_int(i, "paintjob");// Цвет 1
if(VehInfo[i][vmod1]!=0) { AddVehicleComponent(i,VehInfo[i][vmod1]); }
if(VehInfo[i][vmod2]!=0) { AddVehicleComponent(i,VehInfo[i][vmod2]); }
if(VehInfo[i][vmod3]!=0) { AddVehicleComponent(i,VehInfo[i][vmod3]); }
if(VehInfo[i][vmod4]!=0) { AddVehicleComponent(i,VehInfo[i][vmod4]); }
if(VehInfo[i][vmod5]!=0) { AddVehicleComponent(i,VehInfo[i][vmod5]); }
if(VehInfo[i][vmod6]!=0) { AddVehicleComponent(i,VehInfo[i][vmod6]); }
if(VehInfo[i][vmod7]!=0) { AddVehicleComponent(i,VehInfo[i][vmod7]); }
if(VehInfo[i][vmod8]!=0) { AddVehicleComponent(i,VehInfo[i][vmod8]); }
if(VehInfo[i][vmod9]!=0) { AddVehicleComponent(i,VehInfo[i][vmod9]); }
if(VehInfo[i][vmod10]!=0) { AddVehicleComponent(i,VehInfo[i][vmod10]); }
if(VehInfo[i][vmod11]!=0) { AddVehicleComponent(i,VehInfo[i][vmod11]); }
if(VehInfo[i][vmod12]!=0) { AddVehicleComponent(i,VehInfo[i][vmod12]); }
if(VehInfo[i][vmod13]!=0) { AddVehicleComponent(i,VehInfo[i][vmod13]); }
if(VehInfo[i][vmod14]!=0) { AddVehicleComponent(i,VehInfo[i][vmod14]); }
if(VehInfo[i][vmod15]!=0) { AddVehicleComponent(i,VehInfo[i][vmod15]); }
if(VehInfo[i][vmod16]!=0) { AddVehicleComponent(i,VehInfo[i][vmod16]); }
if(VehInfo[i][vmod17]!=0) { AddVehicleComponent(i,VehInfo[i][vmod17]); }
if(VehInfo[i][vColorOne]!=0 || VehInfo[i][vColorTwo]!=0)
{
ChangeVehicleColor(i,VehInfo[i][vColorOne],VehInfo[i][vColorTwo]);
}
if(VehInfo[i][vpaintjob]!=0) { ChangeVehiclePaintjob(i,VehInfo[i][vpaintjob]); }
if((VehInfo[i][vParkX] == 0.0 && VehInfo[i][vParkY] == 0.0 && VehInfo[i][vParkZ] == 0.0 && VehInfo[i][vParkAngle] == 0.0) || VehInfo[i][vOwned] == 0)
{
if(VehInfo[i][vType] == 1 || VehInfo[i][vType] == 3)
{
BuyableCar[i] = CreateVehicle(VehInfo[i][vModel], VehInfo[i][vPosX], VehInfo[i][vPosY], VehInfo[i][vPosZ], VehInfo[i][vAngle], VehInfo[i][vColorOne], VehInfo[i][vColorTwo], -1);
}
if(VehInfo[i][vType] == 2)
{
BuyableCar[i] = CreateVehicle(VehInfo[i][vModel], VehInfo[i][vPosX], VehInfo[i][vPosY], VehInfo[i][vPosZ], VehInfo[i][vAngle], VehInfo[i][vColorOne], VehInfo[i][vColorTwo], 600);
}
}
else if(VehInfo[i][vParkX] != 0.0 && VehInfo[i][vParkY] != 0.0 && VehInfo[i][vParkZ] != 0.0 && VehInfo[i][vParkAngle] != 0.0 && VehInfo[i][vOwned] == 1)
{
if(VehInfo[i][vType] == 1 || VehInfo[i][vType] == 3)
{
BuyableCar[i] = CreateVehicle(VehInfo[i][vModel], VehInfo[i][vParkX], VehInfo[i][vParkY], VehInfo[i][vParkZ], VehInfo[i][vParkAngle], VehInfo[i][vColorOne], VehInfo[i][vColorTwo], -1);
}
if(VehInfo[i][vType] == 2)
{
BuyableCar[i] = CreateVehicle(VehInfo[i][vModel], VehInfo[i][vParkX], VehInfo[i][vParkY], VehInfo[i][vParkZ], VehInfo[i][vParkAngle], VehInfo[i][vColorOne], VehInfo[i][vColorTwo], 600);
}
}
if(VehInfo[i][vOwned] == 0)
{
VehInfo[i][vLock] = 0;
}
LOCKEDVEH[i] = VehInfo[i][vLock];
if(!IsAVelik(i))
{
TrunkInfo[i][tBenzin] = 100;
GetVehicleParamsEx(i,engine,lightss,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(i,false,false,alarm,VehInfo[i][vLock],bonnet,boot,objective);
}
CreateVehicle(VehInfo[i][vModel],VehInfo[i][vPosX],VehInfo[i][vPosY],VehInfo[i][vPosZ],VehInfo[i][vAngle],VehInfo[i][vColorOne],VehInfo[i][vColorTwo],600);
he++;
}
printf("Машин загружено:%d",he);
return 1;
}
