[Ajuda] Dialogo bugado - 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: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Dialogo bugado (
/showthread.php?tid=580133)
Dialogo bugado -
JoshNudock - 02.07.2015
Olб, nгo estou conseguindo fazer esse diбlogo, alguйm pode me ajudar? O Que eu fiz?
PHP код:
if (strcmp(cmd, "/lideres", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
if (PlayerInfo[playerid][pAdmDuty] != 0 && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new ttext[20];
if (PlayerInfo[i][pLider] == 1)
{
ttext = "Polнcia Militar 1";
}
else if (PlayerInfo[i][pLider] == 1)
{
ttext = "Polнcia Militar 2";
}
else if (PlayerInfo[i][pLider] == 2)
{
ttext = "Polнcia Civil";
}
else if (PlayerInfo[i][pLider] == 3)
{
ttext = "Exйrcito";
}
else if (PlayerInfo[i][pLider] == 4)
{
ttext = "Departamento Mйdico";
}
else if (PlayerInfo[i][pLider] == 5)
{
ttext = "Varrios Los Aztecas";
}
else if (PlayerInfo[i][pLider] == 6)
{
ttext = "GRI";
}
else if (PlayerInfo[i][pLider] == 7)
{
ttext = "Governo";
}
else if (PlayerInfo[i][pLider] == 8)
{
ttext = "Assassinos";
}
else if (PlayerInfo[i][pLider] == 9)
{
ttext = "San News Repуrter";
}
else if (PlayerInfo[i][pLider] == 10)
{
ttext = "Poder Judiciбrio";
}
else if (PlayerInfo[i][pLider] == 12)
{
ttext = "Los Santos Vagos";
}
else if (PlayerInfo[i][pLider] == 13)
{
ttext = "SEMNOME2";
}
else if (PlayerInfo[i][pLider] == 14)
{
ttext = "Asphalt King";
}
else if (PlayerInfo[i][pLider] == 15)
{
ttext = "Grove Street";
}
else if (PlayerInfo[i][pLider] == 16)
{
ttext = "Front Yard Ballas";
}
else if (PlayerInfo[i][pLider] == 17)
{
ttext = "Street King";
}
if (PlayerInfo[i][pLider] >= 1)
{
new lideres[90000000];
for (new a = 0; a < MAX_DIALOG; a++) //como posso definir isso? MAX_DIALOG
{
format(lideres, sizeof a, "Lider [%s]: %s", GetPlayerNameRP(playerid), ttext);
strcat(a, lideres, sizeof a);
//quero fazer um loop de dialogo, mais como eu faзo? estou com duvida, era pra mostrar todos os lideres online, mais tб mostrando apenas 1(1 linha)
}
}
ShowPlayerDialog(playerid, 120, DIALOG_STYLE_LIST, "Lнderes online", dialog1, "Fechar", "");
}
}
return 1;
}
Re: Dialogo bugado -
#Luca[S]. - 02.07.2015
PHP код:
if (strcmp(cmd, "/lideres", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
if (PlayerInfo[playerid][pAdmDuty] != 0 && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new ttext[20];
switch(PlayerInfo[i][pLider])
{
case 1: ttext = "Polнcia Militar 1";
case 2: ttext = "Polнcia Civil";
case 3: ttext = "Exйrcito";
case 4: ttext = "Departamento Mйdico";
case 5: ttext = "Varrios Los Aztecas";
case 6: ttext = "GRI";
case 7: ttext = "Governo";
case 8: ttext = "Assassinos";
case 9: ttext = "San News Repуrter";
case 10: ttext = "Poder Judiciбrio";
case 12: ttext = "Los Santos Vagos";
case 13: ttext = "Asphalt King";
case 14: ttext = "Asphalt King";
case 15: ttext = "Grove Street";
case 16: ttext = "Front Yard Ballas";
case 17: ttext = "Street King";
}
new lideres[1000];
for(new i; i < MAX_PLAYERS; i++)
{
if (PlayerInfo[i][pLider] >= 1)
{
if(!IsPlayerConnected(i)) continue;
format(lideres, sizeof(lideres), "%sLider [%s]: %s\n", lideres, GetPlayerNameRP(playerid), ttext);
}
}
ShowPlayerDialog(playerid, 120, DIALOG_STYLE_LIST, "Lнderes online", dialog1, "Fechar", "");
}
}
return 1;
}
Re: Dialogo bugado -
Cleyson - 02.07.2015
Nгo testei, mais acho que fiz certo, confere ai:
PHP код:
if (strcmp(cmd, "/lideres", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
if (PlayerInfo[playerid][pAdmDuty] != 0 && PlayerInfo[playerid][pAdmin] <= 5) return SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new str[25], sstr[500];
if(IsPlayerConnected(i) && PlayerInfo[i][pLider] >= 1)
{
format(str, sizeof(str), "Lider [%s]: %s\n", GetPlayerNameRP(i), GetLider(i));
strcat(sstr, str);
}
}
ShowPlayerDialog(playerid, 120, DIALOG_STYLE_LIST, "Lнderes online", sstr, "Fechar", "");
return 1;
}
stock GetLider(playerid)
{
new ttext[20];
switch(PlayerInfo[playerid][pLider])
{
case 1: ttext = "Polнcia Militar 1";
case 2: ttext = "Polнcia Civil";
case 3: ttext = "Exйrcito";
case 4: ttext = "Departamento Mйdico";
case 5: ttext = "Varrios Los Aztecas";
case 6: ttext = "GRI";
case 7: ttext = "Governo";
case 8: ttext = "Assassinos";
case 9: ttext = "San News Repуrter";
case 10: ttext = "Poder Judiciбrio";
case 12: ttext = "Los Santos Vagos";
case 13: ttext = "Asphalt King";
case 14: ttext = "Asphalt King";
case 15: ttext = "Grove Street";
case 16: ttext = "Front Yard Ballas";
case 17: ttext = "Street King";
}
return ttext;
}