[Ajuda] /admins em dialog
#1

eae galera, queria ajuda de vocкs pra colocar o comando /admins em dialog...

CMD:

Код:
	if (strcmp(cmd, "/admins", true) == 0)
	{
        if(IsPlayerConnected(playerid))
	    {
			SendClientMessage(playerid, COR_GRO, "Admins Online:");
			for(new i = 0; i <= MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 1340)
				{
                    if(admtrampando[i] == 1)
					{
     					if(PlayerInfo[i][pAdmin] == 1)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Moderador] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 2)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[2] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 3)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[3] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 4)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[4] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1337)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1338)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master+] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1339)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master++] (Trabalhando)", sendername);
							SendClientMessage(playerid, COLOR_GRAD1, string);
						}
					}
                    if(admtrampando[i] == 0)
					{
						if(PlayerInfo[i][pAdmin] == 1)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Moderador] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 2)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[2] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 3)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[3] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 4)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[4] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1337)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1338)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master+] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_WHITE, string);
						}
						else if(PlayerInfo[i][pAdmin] == 1339)
					    {
							GetPlayerName(i, sendername, sizeof(sendername));
							format(string, 256, "%s | Nivel:[Master++] (Jogando)", sendername);
							SendClientMessage(playerid, COLOR_GRAD1, string);
						}
					}
				}
			}
		}
		return 1;
	}
alguem pode mim ajudar? obg !
Reply
#2

Usa strcat + ShowPlayerDialog
Reply
#3

Quote:
Originally Posted by delete
Посмотреть сообщение
sou iniciante, nгo sei fazer isso mano.
Reply
#4

Tenta entender ! https://sampforum.blast.hk/showthread.php?tid=119297
Reply
#5

Vк se pega:
Quote:

if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 1340)
{
new dtext[128];
dtext = "";
if(admtrampando[i] == 1)
{
if(PlayerInfo[i][pAdmin] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Moderador] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[2] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[3] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 4)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[4] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1337)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master+] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1339)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master++] (Trabalhando)", sendername);
strcat(dtext,string);
}
ShowPlayerDialog(playerid,4844,DIALOG_STYLE_MSGBOX ,"Admins Online:",dtext,"Fechar","");
}
if(admtrampando[i] == 0)
{
if(PlayerInfo[i][pAdmin] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Moderador] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[2] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[3] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 4)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[4] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1337)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master+] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1339)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master++] (Jogando)", sendername);
strcat(dtext,string);
}
ShowPlayerDialog(playerid,4844,DIALOG_STYLE_MSGBOX ,"Admins Online:",dtext,"Fechar","");
}
}
}
}
return 1;
}

Reply
#6

Quote:
Originally Posted by Absolution
Посмотреть сообщение
Vк se pega:
Nгo deu certo. quando eu digito /admins nao aparece nada
Reply
#7

Tenta denovo...
Quote:

if(strcmp(cmdtext, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 1340)
{
new dtext[128];
if(admtrampando[i] == 1)
{
if(PlayerInfo[i][pAdmin] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Moderador] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[2] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[3] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 4)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[4] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1337)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master+] (Trabalhando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1339)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master++] (Trabalhando)", sendername);
strcat(dtext,string);
}
ShowPlayerDialog(playerid,4844,DIALOG_STYLE_MSGBOX ,"Admins Online:",dtext,"Fechar","");
}
if(admtrampando[i] == 0)
{
if(PlayerInfo[i][pAdmin] == 1)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Moderador] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[2] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 3)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[3] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 4)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[4] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1337)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master+] (Jogando)", sendername);
strcat(dtext,string);
}
else if(PlayerInfo[i][pAdmin] == 1339)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "%s | Nivel:[Master++] (Jogando)", sendername);
strcat(dtext,string);
}
ShowPlayerDialog(playerid,4844,DIALOG_STYLE_MSGBOX ,"Admins Online:",dtext,"Fechar","");
}
}
}
}
return 1;
}

Reply
#8

Quote:
Originally Posted by paulor
Посмотреть сообщение
strcat o primeiro parametro й o destino!
pawn Код:
COMMAND:admins(playerid, params[])
{
    new s[128], ss[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] > 0)
        {
            GetPlayerName(i, Jogador, sizeof(Jogador));
            format(ss, 128, "{FFFFFF}%s {FF00FF}[%s]", Jogador, admins(i));
            strcat(s, ss);
        }
    }
    ShowPlayerDialog(playerid, DIALOG_Admins, DIALOG_STYLE_MSGBOX, " {FF00FF}*** {FFFFFF}ADMIN'S ONLINE {FF00FF}***", s, "fechar", "");
    return true;
}
------
Reply
#9

Quote:
Originally Posted by Absolution
Посмотреть сообщение
Tenta denovo...
mesma coisa
Reply
#10

Cara estuda strcat e showplayerdialog que vocк consegue..

Sinceramente... Nгo entendo a galera que sу quer scripts mastigados..
Comecei faz pouco tempo e estou indo aprendendo aos poucos a programar, jб estou fazendo minha primeira fs e trabalhando em um GM!

O povo parece que nгo conhece o sa-mp wiki!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)