21.02.2013, 22:09
Hello everybody, I would like to know how to get inside information from a file and display them in Dialog:
See how I did, but when I run the command a message appears: Unknow Command.
Any help?
See how I did, but when I run the command a message appears: Unknow Command.
Any help?
pawn Code:
#define MAX_FACCS 200
stock existe_facc(faccid)
{
new arquivo[128];
format(arquivo,sizeof(arquivo),"Faccoes/%d.reg",faccid);
return fexist(arquivo);
}
stock ler_int(faccid,posicao[])
{
new arquivo[128];
format(arquivo,sizeof(arquivo),"Faccoes/%d.reg",faccid);
return dini_Int(arquivo,posicao);
}
stock ler_str(faccid,posicao[])
{
new arquivo[128];
format(arquivo,sizeof(arquivo),"Faccoes/%d.reg",faccid);
format(arquivo,sizeof(arquivo),dini_Get(arquivo,posicao));
return arquivo;
}
//command to get informations and display in Dialog
if(strcmp(cmd, "/getinfo", true) == 0)
{
new strtext[2000];
new count = 0;
new string2[256];
for(new f; f < MAX_FACCS; f++)
{
if(gbd_existe_facc(f))// To check if Exist the file... No problems, working fine...
{
if(ler_int(f,"Ativa") == 0)//To get information from inside of the file... But here is the problem...
{
format(string2, 256, "{FFFFFF}Nome: {EEDD82}%s {FFFFFF}| ID: {EEDD82}%d {FFFFFF}| Fundador: {EEDD82}%s {FFFFFF}| Criada: {EEDD82}%d\n",
ler_str(f,"Nome"), f, ler_str(f,"Fundador"), ler_str(f,"Criada"));
strcat(strtext, string2);
count++;
}
}
}
if(count == 0)
{
format(string2, 256, "{FFFFFF}Nгo hб nenhuma Facзгo pendente de ativaзгo no momento!\n");
strcat(strtext, string2);
}
else
{
format(string2, 256, "\n\n{FFFFFF}Digite abaixo o ID da Facзгo que deseja gerenciar:\n");
strcat(strtext, string2);
}
ShowPlayerDialog(playerid, 1919, DIALOG_STYLE_INPUT,"{EEDD82}DARK STREET RP - ATIVAЗГO DE FACЗХES", strtext, "Gerenciar","Cancelar");
return PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}