12/09/2023 00:37
tenta fazer assim meu mano
stock load_Inventory(playerid){
new string[200];
new Query[100 + 15];
format(Query, sizeof(Query), "SELECT * FROM Inventarios WHERE nome = '%s' LIMIT 1", PegarNome(playerid));
new Cache:result = mysql_query(id_conexao, Query, true);
new maxSlots = GetPlayerMaxSlots(playerid);
for(new i = 0; i != maxSlots; i++){
format(string, 45, "slot%d", i);
cache_get_value_name_int(0, string, p_Inv[playerid][i][i_slot]);
format(string, 45, "qtd%d", i);
cache_get_value_name_int(0, string, p_Inv[playerid][i][i_qtd]);
printf("%i. Item: %d | Quantidade: %d", i + 1, p_Inv[playerid][i][i_slot], p_Inv[playerid][i][i_qtd]);
}
cache_delete(result);
return 1;
}
stock load_Inventory(playerid){
new string[200];
new Query[100 + 15];
format(Query, sizeof(Query), "SELECT * FROM Inventarios WHERE nome = '%s' LIMIT 1", PegarNome(playerid));
new Cache:result = mysql_query(id_conexao, Query, true);
new maxSlots = GetPlayerMaxSlots(playerid);
for(new i = 0; i != maxSlots; i++){
format(string, 45, "slot%d", i);
cache_get_value_name_int(0, string, p_Inv[playerid][i][i_slot]);
format(string, 45, "qtd%d", i);
cache_get_value_name_int(0, string, p_Inv[playerid][i][i_qtd]);
printf("%i. Item: %d | Quantidade: %d", i + 1, p_Inv[playerid][i][i_slot], p_Inv[playerid][i][i_qtd]);
}
cache_delete(result);
return 1;
}