13.11.2013, 09:00
PHP код:
#define MAX_WORK_VEHICLES 10
enum wAndmed
{
wT88ID,
wMasinaID,
wT88MasinaID,
wModelID,
wTyyp[36],
Float: wPosX,
Float: wPosY,
Float: wPosZ,
Float: wAngle,
wV2rv1,
wV2rv2
}
new T88MasinateInfo[MAX_WORK_VEHICLES][wAndmed];
forward LoadWorkVehicles();
public LoadWorkVehicles()
{
new rows, fields, string[256], number[11];
cache_get_data(rows, fields);
if(!rows)
{
print("Tцц Masinad = Tьhi.");
return 1;
}
else
{
new i = 1;
while(i < MAX_WORK_VEHICLES)
{
cache_get_row(0, 0, number), T88MasinateInfo[i][wT88ID] = strval(number);
cache_get_row(0, 1, number), T88MasinateInfo[i][wMasinaID] = strval(number);
cache_get_row(0, 2, number), T88MasinateInfo[i][wT88MasinaID] = strval(number);
cache_get_row(0, 3, number), T88MasinateInfo[i][wModelID] = strval(number);
cache_get_row(0, 4, string); format(T88MasinateInfo[i][wTyyp], 36, "%s", string);
cache_get_row(0, 5, number), T88MasinateInfo[i][wPosX] = floatstr(number);
cache_get_row(0, 6, number), T88MasinateInfo[i][wPosY] = floatstr(number);
cache_get_row(0, 7, number), T88MasinateInfo[i][wPosZ] = floatstr(number);
cache_get_row(0, 8, number), T88MasinateInfo[i][wAngle] = floatstr(number);
cache_get_row(0, 9, number), T88MasinateInfo[i][wV2rv1] = strval(number);
cache_get_row(0, 10, number), T88MasinateInfo[i][wV2rv2] = strval(number);
printf("%d", i);
if(T88MasinateInfo[i][wT88MasinaID])
{
T88MasinateInfo[i][wMasinaID] = CreateVehicle(T88MasinateInfo[i][wModelID], T88MasinateInfo[i][wPosX], T88MasinateInfo[i][wPosY], T88MasinateInfo[i][wPosZ], T88MasinateInfo[i][wAngle], T88MasinateInfo[i][wV2rv1], T88MasinateInfo[i][wV2rv2], 2);
printf("Masinad ID: %d", T88MasinateInfo[i][wMasinaID]);
}
i++;
}
print("Tцц Masinad = Laetud.");
}
return 1;
}
PHP код:
forward OnGameModeInitMysqlLoad();
public OnGameModeInitMysqlLoad()
{
new query[500];
format(query, sizeof(query), "SELECT * FROM tццmasinad");
mysql_function_query(SQL, query, true, "LoadWorkVehicles", "");
return 1;
}
Problem is that.... He create me 9 cars, but in database is only one.(All 9 is same pos and color.)