їAlguien me explica este cуdigo? - 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: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: їAlguien me explica este cуdigo? (
/showthread.php?tid=581580)
їAlguien me explica este cуdigo? -
Ecologic - 14.07.2015
PHP код:
// original: https://sampforum.blast.hk/showthread.php?tid=568319
if(listitem == 1)
{
new query[80], Cache: weapons;
mysql_format(SQLHandle, query, sizeof(query), "SELECT WeaponID, Ammo FROM houseguns WHERE HouseID=%d ORDER BY WeaponID ASC", id);
weapons = mysql_query(SQLHandle, query);
new rows = cache_num_rows();
if(rows) {
new list[512], weapname[32];
format(list, sizeof(list), "#\tWeapon Name\tAmmo\n");
for(new i; i < rows; ++i)
{
GetWeaponName(cache_get_field_content_int(i, "WeaponID"), weapname, sizeof(weapname));
format(list, sizeof(list), "%s%d\t%s\t%s\n", list, i+1, weapname, convertNumber(cache_get_field_content_int(i, "Ammo")));
}
ShowPlayerDialog(playerid, DIALOG_HOUSE+10, DIALOG_STYLE_TABLIST_HEADERS, "House Guns", list, "Take", "Back");
}else{
SendClientMessage(playerid, 0xE74C3CFF, "You don't have any guns in your house.");
}
cache_delete(weapons);
}
quiero hacer un dialog en el que aparezca una lista, y el nъmero de items de una lista sea segъn lo que estй almacenado, con este cуdigo se ejecuta, pero no sй como sacar eso, alguien me explica el cуdigo? ;n;