Bug while (+reps) - 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: Bug while (+reps) (
/showthread.php?tid=537251)
Bug while (+reps) -
Baltimore - 14.09.2014
Olб!
Aqui eu tenho um problema com meu loop.
Eu tinha que me preocupar, entгo eu log (printf) e ele me diz que valor PosX 0.00000 em printf enquanto no meu valor banco de dados MySQL nгo й 0.
Eu tambйm consultei meus valores debug.txt eram bons, mas nгo foi o seguinte:
CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)
pawn Код:
public LoadSQLObjets()
{
new requete[1024],
Charger[35],
i;
while(i <= MAX_OBJETS) // Si i est infйrieur а 500.
{
//format(requete, sizeof(requete), "SELECT * FROM srp_players_objets WHERE LOWER(ID) = LOWER('%d') LIMIT 1", i);
format(requete, sizeof(requete), "SELECT * FROM srp_players_objets WHERE ID = '%d' LIMIT 1", i);
mysql_query(requete);
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row_format(requete, "|"))
{
mysql_fetch_field_row(Charger, "ID"); ObjetsInfo[i][ID] = strval(Charger);
mysql_fetch_field_row(Charger, "IDOBJET"); ObjetsInfo[i][IDOBJET] = strval(Charger);
mysql_fetch_field_row(Charger, "VW"); ObjetsInfo[i][VW] = strval(Charger);
mysql_fetch_field_row(Charger, "Inte"); ObjetsInfo[i][Inte] = strval(Charger);
mysql_fetch_field_row(Charger, "PosX"); ObjetsInfo[i][PosX] = floatstr(Charger);
mysql_fetch_field_row(Charger, "PosY"); ObjetsInfo[i][PosY] = floatstr(Charger);
mysql_fetch_field_row(Charger, "PosZ"); ObjetsInfo[i][PosZ] = floatstr(Charger);
mysql_fetch_field_row(Charger, "poseur"); strmid(ObjetsInfo[i][Poseur], Charger, 0, strlen(Charger), 255);
mysql_fetch_field_row(Charger, "Gilet"); ObjetsInfo[i][Gilet] = floatstr(Charger);
mysql_fetch_field_row(Charger, "Sommes"); ObjetsInfo[i][Sommes] = strval(Charger);
mysql_fetch_field_row(Charger, "VarieteArme"); ObjetsInfo[i][VarieteArme] = strval(Charger);
if(ObjetsInfo[i][IDOBJET] == 1242) // Gilet, on le mets а Z - 0.85
{
ObjetsAuSol[i] = CreateDynamicObject(ObjetsInfo[i][IDOBJET], ObjetsInfo[i][PosX], ObjetsInfo[i][PosY], ObjetsInfo[i][PosZ]-0.85, 0.0, 0.0, 0.0, ObjetsInfo[i][VW], ObjetsInfo[i][Inte], -1, 100.0);
}
else
{
ObjetsAuSol[i] = CreateDynamicObject(ObjetsInfo[i][IDOBJET], ObjetsInfo[i][PosX], ObjetsInfo[i][PosY], ObjetsInfo[i][PosZ]-1, 0.0, 0.0, 0.0, ObjetsInfo[i][VW], ObjetsInfo[i][Inte], -1, 100.0);
}
mysql_free_result();
}
i++;
}
else
{
i++;
continue;
}
if(i >= MAX_OBJETS)
{
break;
}
}
return 1; // Si i est supйrieur а 500 on arrкte.
}
Re: Bug while (+reps) -
Baltimore - 14.09.2014
Up please..
Re: Bug while (+reps) -
WooPz - 14.09.2014
eu nгo consegui entender o que vocк quer.
me parece que vocк nгo й portuguкs. sugiro que procure ajuda na бrea correspondente a seu idioma.
Re: Bug while (+reps) -
PT - 14.09.2014
Que versao MySQL usa? R6, R7?
Se for a mais recente a logica ta errada, dai o cуdigo nao pegar os valores corretamente
Re: Bug while (+reps) -
Baltimore - 14.09.2014
MySQL R5.