30.01.2018, 03:08
(
Последний раз редактировалось akib; 30.01.2018 в 03:16.
Причина: Added mysql data image and tInfo enum and variable
)
here is my codes
Database:
its not getting data from the db
PHP код:
enum TowerEnum{
t_owner[MAX_PLAYER_NAME],
t_range,
Text3D:t_text,
Float:t_x,
Float:t_y,
Float:t_z,
Float:t_rx,
Float:t_ry,
Float:t_rz,
t_model,
t_id
}
new tInfo[MAX_TOWER][TowerEnum];
PHP код:
mysql_function_query(dbhandle, query, true, "OnTowerLoad", "");
format(query, sizeof(query), "SELECT * FROM towers");
PHP код:
public OnTowerLoad(limit)
{
new count, rows, fields;
cache_get_data(rows, fields);
for(new i; i < rows; i++)
{
for(new h; h < sizeof(tInfo); h++)
{
if(tInfo[h][t_id] == 0)
{
cache_get_field_content(i, "owner", tInfo[h][t_owner], dbhandle);
tInfo[h][t_range] = cache_get_field_content_int(i, "t_range", dbhandle);
tInfo[h][t_model] = cache_get_field_content_int(i, "t_model", dbhandle);
tInfo[h][t_x] = cache_get_field_content_float(i, "t_x", dbhandle);
tInfo[h][t_y] = cache_get_field_content_float(i, "t_y", dbhandle);
tInfo[h][t_z] = cache_get_field_content_float(i, "t_z", dbhandle);
new string[126];
format(string,sizeof(string),"%i,%f,%f,%f",tInfo[h][t_model], tInfo[h][t_x], tInfo[h][t_y], tInfo[h][t_z]);
SendClientMessageToAll(-1,string);
CreateDynamicObject(tInfo[h][t_model], tInfo[h][t_x], tInfo[h][t_y], tInfo[h][t_z], 0.0, 0.0, 0.0,200,300);
count++;
break;
}
}
}
printf("Current objects on the server: %d",CountDynamicObjects());
return 1;
}
its not getting data from the db