SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 13/12/2018, 12:42 PM   #1
Hake
Little Clucker
 
Hake's Avatar
 
Join Date: Dec 2018
Posts: 11
Reputation: 0
Default Comando /Admins

Olá! criei um /admins no improviso e gostaria de adicionar um comando onde se o adm ficar ausente,mostrasse no dialog o "Ausente". Ele apenas mostra o "online" o tempo inteiro. Obrigado a quem ajudar!!!

PHP Code:
dcmd_admins(playerid,params[]) {
#pragma unused params
//Alertar admins para quem digitar o comando /admins
if(PlayerInfo[playerid][Level] < 1){
new 
pname[MAX_PLAYER_NAME],SACSB[100];GetPlayerName(playeridpnameMAX_PLAYER_NAME);
format(SACSBsizeof(SACSB), "| CMDS-LOG | %s[%i] digitou /ADMINS"pnameplayerid);
CallRemoteFunction("MessageToAdmins","is",yellow,SACSB);}
//Estrutura do comando /admins
new Adms[650],ADMsDialog[810],ADMsDialog2[810],Name[MAX_PLAYER_NAME],level,admscount;
for(new 
i,GetMaxPlayers();a;i++)
{
    if(
IsPlayerConnected(i))
    {
        if(
PlayerInfo[i][Level] > 0)
        {
        if(
PlayerInfo[i][Level] == 1)
            {
                if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
                    
level PlayerInfo[i][Level];
                    
GetPlayerName(iNamesizeof(Name));
                    if(
admscount 15format(Admssizeof(Adms), "%s\t{FFFF00}Ajudante\t{00FF00}Online\n%s",Name,Adms);
                    
admscount++;
              }
            }
        if(
PlayerInfo[i][Level] == 2)
            {
                if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
                    
level PlayerInfo[i][Level];
                    
GetPlayerName(iNamesizeof(Name));
                    if(
admscount 15format(Admssizeof(Adms), "%s\t{FF8C00}Moderador(a)\t{00FF00}Online\n%s",Name,Adms);
                    
admscount++;
              }
            }
             if(
PlayerInfo[i][Level] == 3)
            {
                if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
                    
level PlayerInfo[i][Level];
                    
GetPlayerName(iNamesizeof(Name));
                    if(
admscount 15format(Admssizeof(Adms), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}Online\n%s",Name,Adms);
                    
admscount++;
              }
            }
      
           if(
PlayerInfo[i][Level] == 4)
            {
                if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
                    
level PlayerInfo[i][Level];
                    
GetPlayerName(iNamesizeof(Name));
                    if(
admscount 15format(Admssizeof(Adms), "%s\t{008bce}Administrador(a)\t{00FF00}Online\n%s",Name,Adms);
                    
admscount++;
              }
            }

            if(
PlayerInfo[i][Level] == 5)
            {
                if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
       
GetPlayerName(iNamesizeof(Name));
                    if(
admscount 15format(Admssizeof(Adms), "%s\n%s\t{32CD32}Staff\t{00FF00}Online\n",Adms,Name);
                    
admscount++;
                }
            }
            else
            {
             if(
AdmHidden[i] == false || PlayerInfo[playerid][Level] > 0)
                {
                    
level PlayerInfo[i][Level];
                    
GetPlayerName(iNamesizeof(Name));
                 
//   if(admscount < 15) format(Adms, sizeof(Adms), "{1E90FF}%s[%i] \tNível: %i \t{00FF00}Online\n%s",Name,i,level,Adms);
                    
admscount++;
                }
            }
        }
    }
}
if(
admscount 0)
format(ADMsDialogsizeof(ADMsDialog), "{FFFFFF}Admin\t{FFFFFF}Cargo\t{FFFFFF}Status\n%s",Adms);
else
format(ADMsDialog2sizeof(ADMsDialog2), "{FF0000}Infelizmente a equipe da administração não está online no momento!",Adms);
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_TABLIST_HEADERS,"Admins",ADMsDialog,"Fechar","");
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"Admins",ADMsDialog2,"Fechar","");
return 
1;} 
Hake is offline   Reply With Quote
Old 13/12/2018, 01:41 PM   #2
JeffSantos2
Big Clucker
 
JeffSantos2's Avatar
 
Join Date: Sep 2013
Location: Curitiba-PR-BR
Posts: 62
Reputation: 11
Default Re: Comando /Admins

Tente isso.

Code:
dcmd_admins(playerid, params[])
{
	#pragma unused params
	new string[144];
	//Alertar admins para quem digitar o comando /admins
	if(PlayerInfo[playerid][Level] < 1)
	{
		new pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
		format(string, sizeof(string), "| CMDS-LOG | %s [%i] digitou /ADMINS", pname, playerid);
		CallRemoteFunction("MessageToAdmins", "is", yellow, string);
	}
	//Estrutura do comando /admins
	new ADMsDialog[1024], Name[MAX_PLAYER_NAME];
	for(new i, a = GetMaxPlayers(); i < a; i++)
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][Level] && (AdmHidden[i] == false || PlayerInfo[playerid][Level]))
     	{
     	    GetPlayerName(i, Name, sizeof(Name));
     	    switch(PlayerInfo[i][Level])
     	    {
	         	case 1:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}Online\n", Name);
             	}
	            case 2:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}Online\n", Name);
             	}
             	case 3:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	case 4:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	
             	case 5:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}Online\n", Name);
             	}
 				default:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "{1E90FF}%s \tNível: %i \t{00FF00}AFK\n%s", Name, PlayerInfo[i][Level]);
                    else format(string, sizeof(string), "{1E90FF}%s \tNível: %i \t{00FF00}Online\n%s", Name, PlayerInfo[i][Level]);
             	}
	        }
	        strcat(ADMsDialog, string);
	    }
	}
	if(!strlen(ADMsDialog)) ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "Admins", "{FF0000}Infelizmente a equipe da administração não está online no momento!", "Fechar", "");
	else
	{
		strins(ADMsDialog, "{FFFFFF}Admin\t{FFFFFF}Cargo\t{FFFFFF}Status\n", 0);
		ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_TABLIST_HEADERS, "Admins", ADMsDialog, "Fechar", "");
	}
	return 1;
}
JeffSantos2 is offline   Reply With Quote
Old 13/12/2018, 03:14 PM   #3
Hake
Little Clucker
 
Hake's Avatar
 
Join Date: Dec 2018
Posts: 11
Reputation: 0
Default Re: Comando /Admins

Quote:
Originally Posted by JeffSantos2 View Post
Tente isso.

Code:
dcmd_admins(playerid, params[])
{
	#pragma unused params
	new string[144];
	//Alertar admins para quem digitar o comando /admins
	if(PlayerInfo[playerid][Level] < 1)
	{
		new pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
		format(string, sizeof(string), "| CMDS-LOG | %s [%i] digitou /ADMINS", pname, playerid);
		CallRemoteFunction("MessageToAdmins", "is", yellow, string);
	}
	//Estrutura do comando /admins
	new ADMsDialog[1024], Name[MAX_PLAYER_NAME];
	for(new i, a = GetMaxPlayers(); i < a; i++)
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][Level] && (AdmHidden[i] == false || PlayerInfo[playerid][Level]))
     	{
     	    GetPlayerName(i, Name, sizeof(Name));
     	    switch(PlayerInfo[i][Level])
     	    {
	         	case 1:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FFFF00}Ajudante\t{00FF00}Online\n", Name);
             	}
	            case 2:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF8C00}Moderador\t{00FF00}Online\n", Name);
             	}
             	case 3:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{FF4500}Sub-Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	case 4:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{008bce}Administrador(a)\t{00FF00}Online\n", Name);
             	}
             	
             	case 5:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}AFK\n", Name);
                    else format(string, sizeof(string), "%s\t{32CD32}Staff\t{00FF00}Online\n", Name);
             	}
 				default:
	            {
                    if(/*verificação se esta afk. Ex: GetPVarInt(i, "AFK")*/) format(string, sizeof(string), "{1E90FF}%s \tNível: %i \t{00FF00}AFK\n%s", Name, PlayerInfo[i][Level]);
                    else format(string, sizeof(string), "{1E90FF}%s \tNível: %i \t{00FF00}Online\n%s", Name, PlayerInfo[i][Level]);
             	}
	        }
	        strcat(ADMsDialog, string);
	    }
	}
	if(!strlen(ADMsDialog)) ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "Admins", "{FF0000}Infelizmente a equipe da administração não está online no momento!", "Fechar", "");
	else
	{
		strins(ADMsDialog, "{FFFFFF}Admin\t{FFFFFF}Cargo\t{FFFFFF}Status\n", 0);
		ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_TABLIST_HEADERS, "Admins", ADMsDialog, "Fechar", "");
	}
	return 1;
}
Obg! porem deu esses erros manolo:

PHP Code:
D:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4415) : warning 204symbol is assigned a value that is never used"string2"
D:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4912) : error 029invalid expressionassumed zero
D
:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4917) : error 029invalid expressionassumed zero
D
:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4922) : error 029invalid expressionassumed zero
D
:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4927) : error 029invalid expressionassumed zero
D
:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4933) : error 029invalid expressionassumed zero
D
:\Pedro\Área de Trabalho\Projetos 2018\filterscripts\ladmin4v2.pwn(4938) : error 029invalid expressionassumed zero
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase


6 Errors

Hake is offline   Reply With Quote
Old 14/12/2018, 12:56 PM   #4
JeffSantos2
Big Clucker
 
JeffSantos2's Avatar
 
Join Date: Sep 2013
Location: Curitiba-PR-BR
Posts: 62
Reputation: 11
Default Re: Comando /Admins

Mande as linhas que contem esses erros
JeffSantos2 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] comando /admins Raridade Português/Portuguese 2 22/10/2018 09:12 PM
[Ajuda] Comando /admins CLANdok Português/Portuguese 11 17/10/2013 12:21 AM
[Ajuda] Comando /admins gefe Português/Portuguese 2 04/08/2013 01:29 PM
[Ajuda] COMANDO /ADMINS xXALIEN1GENAXx Português/Portuguese 5 07/04/2013 02:04 AM
[Ajuda] Comando /admins Equipe Português/Portuguese 4 20/01/2013 10:13 PM


All times are GMT. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.