[Ajuda] Nгo carrega - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Nгo carrega (
/showthread.php?tid=638742)
Nгo carrega -
GustavoSouza - 05.08.2017
Carrega apenas o id 1 na tabela.
PHP Code:
new query[200], ids;
mysql_format(IDConexao, query, sizeof(query), "SELECT * FROM `Label` WHERE `ID` = '%d'", ids);
mysql_tquery(IDConexao, "SELECT * FROM Label", "CarregarLabel", "", ids);
Re: Nгo carrega -
RodrigoMSR - 05.08.2017
Passe a funзгo CarregarLabel.
Re: Nгo carrega -
GustavoSouza - 05.08.2017
PHP Code:
forward CarregarLabel(playerid);
public CarregarLabel(playerid)
{
if(cache_get_row_count())
{
cache_get_field_content(0, "Texto", LabelInfo[playerid][TextoLabel], .max_len = MAX_LABEL_TEXT);
LabelInfo[playerid][LabelX] = cache_get_field_content_float(0, "LabelX");
LabelInfo[playerid][LabelY] = cache_get_field_content_float(0, "LabelY");
LabelInfo[playerid][LabelZ] = cache_get_field_content_float(0, "LabelZ");
Create3DTextLabel(LabelInfo[playerid][TextoLabel], -1, LabelInfo[playerid][LabelX], LabelInfo[playerid][LabelY], LabelInfo[playerid][LabelZ], 40.0, 0, 0);
}
}
Re: Nгo carrega -
RodrigoMSR - 05.08.2017
Qual versгo do plugin MySQL estб utilizando?
Re: Nгo carrega -
GustavoSouza - 05.08.2017
r39-6
Re: Nгo carrega -
RodrigoMSR - 05.08.2017
O parвmetro
playerid na funзгo significa o ID da label ou do jogador? Essa funзгo й para carregar todos os resultados da tabela?
Re: Nгo carrega -
GustavoSouza - 05.08.2017
ID do label, siim para carregar todos os dados presentes na tabela.
Re: Nгo carrega -
RodrigoMSR - 05.08.2017
Tente:
PHP Code:
mysql_tquery(IDConexao, "SELECT * FROM Label", "CarregarLabel", "");
PHP Code:
forward CarregarLabel();
public CarregarLabel()
{
new rows = cache_get_row_count();
if(rows > 0)
{
for(new i = 0; i < rows; i++)
{
cache_get_field_content(i, "Texto", LabelInfo[i][TextoLabel], .max_len = MAX_LABEL_TEXT);
LabelInfo[i][LabelX] = cache_get_field_content_float(i, "LabelX");
LabelInfo[i][LabelY] = cache_get_field_content_float(i, "LabelY");
LabelInfo[i][LabelZ] = cache_get_field_content_float(i, "LabelZ");
Create3DTextLabel(LabelInfo[i][TextoLabel], -1, LabelInfo[i][LabelX], LabelInfo[i][LabelY], LabelInfo[i][LabelZ], 40.0, 0, 0);
}
}
return 1;
}
Re: Nгo carrega -
GustavoSouza - 05.08.2017
Deu certinho, vlw ^^