case THREAD_UCITAJMOTORE:
{
if(szRows)
{
new temp[130];
for(new i = 0; i < cache_get_row_count(); i++)
{
cache_get_field_content(i, "Vlasnik", temp);
format(MoInfo[i][Vlasnik], 50, "%s", temp);
MoInfo[i][ID] = cache_get_field_content_int(i, "ID");
MoInfo[i][PozX] = cache_get_field_content_int(i, "PozX");
MoInfo[i][PozY] = cache_get_field_content_int(i, "PozY");
MoInfo[i][PozZ] = cache_get_field_content_int(i, "PozZ");
MoInfo[i][PozA] = cache_get_field_content_int(i, "PozA");
MoInfo[i][Model] = cache_get_field_content_int(i, "Model");
MoInfo[i][Cena] = cache_get_field_content_int(i, "Cena");
MoInfo[i][VW] = cache_get_field_content_int(i, "VW");
MoInfo[i][Interior] = cache_get_field_content_int(i, "Interior");
MoInfo[i][Zakljucan] = cache_get_field_content_int(i, "Zakljucan");
MoInfo[i][Boja1] = cache_get_field_content_int(i, "Boja1");
MoInfo[i][Boja2] = cache_get_field_content_int(i, "Boja2");
MoInfo[i][ImaVlasnika] = cache_get_field_content_int(i, "ImaVlasnika");
MoInfo[i][mOwned] = CreateVehicle_H(MoInfo[i][Model], MoInfo[i][PozX], MoInfo[i][PozY], MoInfo[i][PozZ]+0.2, MoInfo[i][PozA], 0, 0, 1000);
}
SpawnedMotora = szRows;
}
}
case THREAD_UCITAJMOTORE:
{
if(szRows)
{
new temp[130];
for(new i = 0; i < cache_get_row_count(); i++)
{
cache_get_field_content(i, "Vlasnik", temp);
format(MoInfo[i][Vlasnik], 50, "%s", temp);
MoInfo[i][ID] = cache_get_field_content_int(i, "ID");
MoInfo[i][PozX] = cache_get_field_content_float(i, "PozX");
MoInfo[i][PozY] = cache_get_field_content_float(i, "PozY");
MoInfo[i][PozZ] = cache_get_field_content_float(i, "PozZ");
MoInfo[i][PozA] = cache_get_field_content_float(i, "PozA");
MoInfo[i][Model] = cache_get_field_content_int(i, "Model");
MoInfo[i][Cena] = cache_get_field_content_int(i, "Cena");
MoInfo[i][VW] = cache_get_field_content_int(i, "VW");
MoInfo[i][Interior] = cache_get_field_content_int(i, "Interior");
MoInfo[i][Zakljucan] = cache_get_field_content_int(i, "Zakljucan");
MoInfo[i][Boja1] = cache_get_field_content_int(i, "Boja1");
MoInfo[i][Boja2] = cache_get_field_content_int(i, "Boja2");
MoInfo[i][ImaVlasnika] = cache_get_field_content_int(i, "ImaVlasnika");
MoInfo[i][mOwned] = CreateVehicle_H(MoInfo[i][Model], MoInfo[i][PozX], MoInfo[i][PozY], MoInfo[i][PozZ]+0.2, MoInfo[i][PozA], 0, 0, 1000);
}
printf("Elite Team - Server je ucitao %d motora u vlasnistvu", szRows);
SpawnedMotora = szRows;
}
}
if(GetPlayerVehicleID(playerid) != MoInfo[i][mOwned])
{
SCM(playerid, ERRORCOLOR, "[ERROR]: You're not in your vehicle.");
return 1;
}
ongamemodeinit
format(gQuery, 1500, "SELECT * FROM `Motori`"); mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "i", THREAD_UCITAJMOTORE); |