03.02.2019, 17:17
I'm having a ridiculous sort of question, but I was present, I'm checking how existing factions in the database.
VerificarFaccoes(playerid); It has been placed correctly on OnPlayerConnect, so far so good.
In this comes another question I am checking the active factions by the command of the board, as it would / faccoes, the command does not pull all active tables, only the first table.. https://i.imgur.com/Lt36kGk.png
Let's go to the command.
MAX_FACCOES is set to 30.
VerificarFaccoes(playerid); It has been placed correctly on OnPlayerConnect, so far so good.
PHP код:
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
stock VerificarFaccoes(playerid) {
new Query[300];
mysql_format(IDConexao, Query, sizeof(Query), "SELECT * FROM `faccoes`");
mysql_tquery(IDConexao, Query, "CarregarFaccoes", "i", playerid);
return true;
}
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
forward CarregarFaccoes(playerid);
public CarregarFaccoes(playerid) {
if(cache_num_rows() > 0) {
cache_get_value_int(0, "ID", PlayerFaccao[playerid][ID]);
cache_get_value(0, "Nome", PlayerFaccao[playerid][Nome], 24);
cache_get_value_int(0, "Tipo", PlayerFaccao[playerid][Tipo]);
cache_get_value_int(0, "Beneficio", PlayerFaccao[playerid][Beneficio]);
cache_get_value(0, "Comander", PlayerFaccao[playerid][Comander], 24);
}
return true;
}
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
Let's go to the command.
PHP код:
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
CMD:faccoes(playerid) {
if(!PlayerDiretoria[playerid][Cargo]) return false;
if(PlayerDiretoria[playerid][Cargo] < 2) return false;
new String[1000],Dialog[1000];
for(new f; f< MAX_FACCOES; f++) {
format(String, sizeof(String), "{b30059}( ID: {FFFFFF}%d{b30059} ){b30059}( Nome: {FFFFFF}%s{b30059} ){b30059}( Tipo: {FFFFFF}%s{b30059} ){b30059}( Beneficio: {FFFFFF}%s{b30059} ){b30059}( Comander: {FFFFFF}%s{b30059} )\n\n",PlayerFaccao[f][ID],PlayerFaccao[f][Nome],TipoFaccao(f),BeneficioFaccao(f),PlayerFaccao[f][Comander]);
strcat(Dialog, String, sizeof(Dialog));
}
ShowPlayerDialog(playerid, 23, DIALOG_STYLE_MSGBOX, "\t\tFACCЗХES ATIVAS", Dialog, "Fechar","");
return true;
}
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
Original Roleplay
Copyright © 2019 Todos os direitos autorais reservados.
Copyright © 2019 Todos os direitos autorais reservados.