19.05.2015, 08:31
Hello,
Today I have a problem I explain:
My load is not executes if id 1 is not present, and even if eg id 1 and present but is followed by the id 20, so the id 20 is not going to charge this but only id 1.
Here is my code:
Sincerely,
Drek.
Today I have a problem I explain:
My load is not executes if id 1 is not present, and even if eg id 1 and present but is followed by the id 20, so the id 20 is not going to charge this but only id 1.
Код:
SA-MP MySQL plugin R5 Copyright © 2008-2010, G-sTyLeZzZ
pawn Код:
public Shop_load()
{
new Requete[504], fields[57][MAX_PLAYER_NAME], row[320];
format(Requete, sizeof(Requete), "SELECT COUNT(*) FROM shop");
mysql_query(Requete);
mysql_store_result();
mysql_fetch_row(row);
Total_shop = strval(row);
mysql_free_result();
for(new i=1; i<=Total_shop; i++)
{
format(Requete, sizeof(Requete), "SELECT * FROM shop WHERE id=%d", i);
mysql_query(Requete);
mysql_store_result();
mysql_fetch_row(row);
split(row, fields, '|');
Shop_infos[i][shopX] = floatstr(fields[1]); printf("> %f !shopX", Shop_infos[i][shopX]);
Shop_infos[i][shopY] = floatstr(fields[2]);
Shop_infos[i][shopZ] = floatstr(fields[3]);
Shop_infos[i][shopXexit] = floatstr(fields[4]);
Shop_infos[i][shopYexit] = floatstr(fields[5]);
Shop_infos[i][shopZexit] = floatstr(fields[6]);
Shop_infos[i][shopCaisse] = strval(fields[7]);
Shop_infos[i][shopInterieur] = strval(fields[8]);
Shop_infos[i][shopLock] = strval(fields[9]);
mysql_free_result();
}
printf("> %d shop load !", Total_shop);
return 1;
}
Drek.