lava172
Умник
PHP:
publics UploadCars()
{
new time = GetTickCount();
new rows, fields, temp[64], strfd2[150], car_new;
cache_get_data(rows, fields);
if(rows)
{
for(new f;f < rows;f++)
{
cache_get_field_content(f, "carid", temp), cInfo[f+1][carid] = strval(temp);
cache_get_field_content(f, "cModel", temp), cInfo[f+1][carid] = strval(temp);
cache_get_field_content(f, "xcx", temp), cInfo[f+1][xcx] = floatstr(temp);
cache_get_field_content(f, "xcy", temp), cInfo[f+1][xcy] = floatstr(temp);
cache_get_field_content(f, "xcz", temp), cInfo[f+1][xcz] = floatstr(temp);
cache_get_field_content(f, "xcrot", temp), cInfo[f+1][xcrot] = floatstr(temp);
cache_get_field_content(f, "parkx", temp), cInfo[f+1][parkx] = floatstr(temp);
cache_get_field_content(f, "parky", temp), cInfo[f+1][parky] = floatstr(temp);
cache_get_field_content(f, "parkz", temp), cInfo[f+1][parkz] = floatstr(temp);
cache_get_field_content(f, "pugol", temp), cInfo[f+1][pugol] = floatstr(temp);
cache_get_field_content(f, "cCoast", temp), cInfo[f+1][cCoast] = strval(temp);
cache_get_field_content(f, "cOwner", temp), strmid(cInfo[f+1][cOwner], temp, 0, strlen(temp), MAX_PLAYER_NAME);
cache_get_field_content(f, "cColor1", temp), cInfo[f+1][cColor1] = strval(temp);
cache_get_field_content(f, "cColor2", temp), cInfo[f+1][cColor2] = strval(temp);
cache_get_field_content(f, "Cuplena", temp), cInfo[f+1][Cuplena] = strval(temp);
if(cInfo[f+1][Cuplena] == 0)
{
car_new = CreateVehicle(cInfo[f+1][cModel],cInfo[f+1][xcx],cInfo[f+1][xcy],cInfo[f+1][xcz],cInfo[f+1][xcrot], cInfo[f+1][cColor1], cInfo[f+1][cColor2], 60);
f(strfd2, "{00FFFF}Продается\n Цена: {00FF00}%d", cInfo[f+1][cCoast]);
cInfo[f+1][fdtextid] = CreateDynamic3DTextLabel(strfd2,0xFFFFFFAA,0.0, 0.0, 0.0,30.0,INVALID_PLAYER_ID,car_new,0,-1,-1,-1,30.0);
}
else
{
car_new = CreateVehicle(cInfo[f+1][cModel],cInfo[f+1][parkx],cInfo[f+1][parky],cInfo[f+1][parkz],cInfo[f+1][pugol],cInfo[f+1][cColor1],cInfo[f+1][cColor2], 500);
f(strfd2, "Номер:%d\n {00FFFF}Легковой автомобиль {02FF13}Владелец: {00FF00}%s",cInfo[f+1][carid],cInfo[f+1][cOwner]);
cInfo[f+1][fdtextid] = CreateDynamic3DTextLabel(strfd2,0xFFFFFFAA,0.0, 0.0, 0.0,30.0,INVALID_PLAYER_ID,car_new,0,-1,-1,-1,30.0);
}
}
totalcar = rows;
printf("%i легковых авто было успешно загружено, потрачено на загрузку %i (ms).", totalcar,GetTickCount() - time);
}
else print("Не удалось загрузить легковые авто.");
return false;
}
Последнее редактирование:
