PDA

Просмотр полной версии : [Вопрос] Пропадает 255 мащины.



Edward Morra
15.08.2016, 20:23
Ну суть крч в название темы.

#define MAXORGCAR 500

enum tcarInfo
{
orgcID,
orgcFrac,
orgcRank,
orgcCity,
orgcModel,
Float:orgCarPos[4],
orgcColor1,
orgcColor2,
orgcInt,
orgcWorld,
Text3D:orgcNumber,
Text3D:orgcText,
orgcNumberColor,
orgcCar,
Float:orgcFuel,
bool:orgLightOnOff,
orgpLight,
Float:orgpMilage,
bool:orgcLock,
bool:orgcMax,
orgcMaxSpeed,
orgcName[50], // последний кто брал машину
}
new OrgCarInfo[MAXORGCAR][tcarInfo];



inFunction::LoadOrgCar()
{
new rows, fields;
cache_get_data(rows, fields);
new string2[30];
for(new idx = 1; idx <= rows; idx++)
{
if(idx > MAXORGCAR) break;
OrgCarInfo[idx][orgcID] = cache_get_field_content_int(idx-1,"ID",cMySQL);
OrgCarInfo[idx][orgcFrac] = cache_get_field_content_int(idx-1,"Frac",cMySQL);
OrgCarInfo[idx][orgcRank] = cache_get_field_content_int(idx-1,"Rank",cMySQL);
OrgCarInfo[idx][orgcCity] = cache_get_field_content_int(idx-1,"City",cMySQL);
OrgCarInfo[idx][orgcModel] = cache_get_field_content_int(idx-1,"Model",cMySQL);
OrgCarInfo[idx][orgCarPos][0] = cache_get_field_content_float(idx-1,"posX",cMySQL);
OrgCarInfo[idx][orgCarPos][1] = cache_get_field_content_float(idx-1,"posY",cMySQL);
OrgCarInfo[idx][orgCarPos][2] = cache_get_field_content_float(idx-1,"posZ",cMySQL);
OrgCarInfo[idx][orgCarPos][3] = cache_get_field_content_float(idx-1,"posA",cMySQL);
OrgCarInfo[idx][orgcColor1] = cache_get_field_content_int(idx-1,"Color1",cMySQL);
OrgCarInfo[idx][orgcColor2] = cache_get_field_content_int(idx-1,"Color2",cMySQL);
OrgCarInfo[idx][orgcInt] = cache_get_field_content_int(idx-1,"Int",cMySQL);
OrgCarInfo[idx][orgcWorld] = cache_get_field_content_int(idx-1,"World",cMySQL);
OrgCarInfo[idx][orgcNumberColor] = FracColors[OrgCarInfo[idx][orgcFrac]];

OrgCarInfo[idx][orgcCar] = P_AddStaticVehicleEx(OrgCarInfo[idx][orgcModel],OrgCarInfo[idx][orgCarPos][0],OrgCarInfo[idx][orgCarPos][1],OrgCarInfo[idx][orgCarPos][2],OrgCarInfo[idx][orgCarPos][3],
OrgCarInfo[idx][orgcColor1],OrgCarInfo[idx][orgcColor2],7200);
OnVehicleSpawn(OrgCarInfo[idx][orgcCar]);
LinkVehicleToInterior(OrgCarInfo[idx][orgcCar],OrgCarInfo[idx][orgcInt]);
SetVehicleVirtualWorld(OrgCarInfo[idx][orgcCar],OrgCarInfo[idx][orgcWorld]);
switch(OrgCarInfo[idx][orgcCity])
{
case 1: format(string2,sizeof(string2),"[LA%dUS]",idx);
case 2: format(string2,sizeof(string2),"[SF%dUS]",idx);
case 3: format(string2,sizeof(string2),"[LV%dUS]",idx);
case 4: format(string2,sizeof(string2),"[CA%dUS]",idx);
}
SetVehicleNumberPlate(OrgCarInfo[idx][orgcCar],string2);
OrgCarInfo[idx][orgcNumber] = CreateDynamic3DTextLabel(string2,0xAFAFAF90,0,0,0.0,15.0,INVALID_PLAYER_ID,OrgCarInfo[idx][orgcCar],1);
if(OrgCarInfo[idx][orgcFrac] == 15)
{
format(string2,sizeof(string2),"%s",OrgInfo[OrgCarInfo[idx][orgcFrac]][orgName]);
OrgCarInfo[idx][orgcText] = CreateDynamic3DTextLabel(string2,0xFFA500FF,0,0,1.25,15.0,INVALID_PLAYER_ID,OrgCarInfo[idx][orgcCar],1);
}
Fuel[idx] = VehicleParams[OrgCarInfo[idx][orgcModel]-400][vMaxFuel];
Engine[idx] = false;
Light[idx] = false;
OrgCarInfo[idx][orgLightOnOff] = false;
OrgCarInfo[idx][orgpLight] = 0;
OrgCarInfo[idx][orgpMilage] = 0;
OrgCarInfo[idx][orgcLock] = true;
OrgCarInfo[idx][orgcMax] = false;
TOTALORGCAR = idx;
}
printf(" * [Load System] : Çàãðóçêà ñèñòåìû ìàøèí ôðàêöèé ïðîøëà óäà÷íî: %d øò.",TOTALORGCAR);
return true;
}


P_AddStaticVehicleEx(model,Float:x,Float:y,Float:z,Float:a,color_1,color_2,spawntime = 99999)
{
return CreateVehicle(model, x, y, z, a, color_1, color_2,spawntime);
}