stock AddLabelToFile(LabelInfo[], Float:LX, Float:LY, Float:LZ)
{
new Query[200];
format(Query, sizeof(Query), "INSERT INTO `labels` (LabelX, LabelY, LabelZ, LabelInfo) VALUES(%f, %f, %f, '%s')",
LX, LY, LZ, LabelInfo);
mysql_function_query(dbHandle, Query, true, "", "");
return 1;
}
stock AddLabelsFromFile()
{
mysql_function_query(dbHandle, "SELECT * FROM `labels`", true, "AddLabels", "");
return 1;
}
new result[100],Float:Pos[3],Info[50];
mysql_function_query(dbHandle, "SELECT * FROM `labels`", true, "AddLabels", "");
mysql_store_result();
while(mysql_fetch_row_format(result,"|"))
{
sscanf(result,"p<|>fffs[50]",Pos[0],Pos[1],Pos[2],Info);
Create3DtextLabel(Info,-1,Pos[0],Pos[1],Pos[2],30.0,0,1);
}
mysql_free_result();
forward AddLabels();
public AddLabels()
{
new result[100],Float:Pos[3],Info[128];
mysql_store_result();
while(mysql_fetch_row_format(result,"|"))
{
sscanf(result,"p<|>fffs[50]",Pos[0],Pos[1],Pos[2],Info);
CreateDynamic3DTextLabel(Info, RColors[random(sizeof(RColors))], Pos[0], Pos[1], Pos[2], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, TEXTLABELDISTANCE);
}
mysql_free_result();
}
stock AddLabelsFromFile()
{
mysql_function_query(dbHandle, "SELECT * FROM `labels`", false, "AddLabels", "");
return 1;
}
|
i did something like this , it doesn't work
Код:
forward AddLabels();
public AddLabels()
{
new result[100],Float:Pos[3],Info[128];
mysql_store_result();
while(mysql_fetch_row_format(result,"|"))
{
sscanf(result,"p<|>fffs[50]",Pos[0],Pos[1],Pos[2],Info);
CreateDynamic3DTextLabel(Info, RColors[random(sizeof(RColors))], Pos[0], Pos[1], Pos[2], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, TEXTLABELDISTANCE);
}
mysql_free_result();
}
stock AddLabelsFromFile()
{
mysql_function_query(dbHandle, "SELECT * FROM `labels`", false, "AddLabels", "");
return 1;
}
|
public AddLabels()
{
new result[100],Float:Pos[3],Info[50];
mysql_function_query(dbHandle, "SELECT * FROM `labels`", false, "", "");
mysql_store_result();
while(mysql_fetch_row_format(result,"|"))
{
sscanf(result,"p<|>fffs[50]",Pos[0],Pos[1],Pos[2],Info);
CreateDynamic3DTextLabel(Info, RColors[random(sizeof(RColors))], Pos[0], Pos[1], Pos[2], 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, TEXTLABELDISTANCE);
}
mysql_free_result();
}
|
You didn't query anything from MySQL. You can't do it like what you did.
|