Jump to content
  • 0

Problema /admins


Hall

Question

Problema intalnita (descriere): Playeri nu pot da /admins (nu apare nimic in chat cand acestia tasteaza), in schimb daca un admin da apare.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu): 

CMD:admins(playerid,params[])
{
	if(PI[playerid][pHelper] == 0 && PI[playerid][pAdmin] == 0 && PI[playerid][pVIP] == 0) return 1;
 	new admrank[32];
	for(new i; i < GetMaxPlayers(); i++)
	{
		if(!IsPlayerConnected(i)) continue;
		if(PI[i][pAdmin] == 0) continue;
		switch(PI[i][pAdmin])
		{
			case ADM_MODER: admrank = "{FFCC00}Asistent";
			case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
			case ADM_ADMIN: admrank = "{FFCC00}Administrator";
			case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
			case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
			case ADM_GRAND: admrank = "{FF0000}Developer";
		}
		CMDstr = "";
		format(CMDstr,144,"%s[%d] - %s",Name(i),i,admrank);
		SendClientMessage(playerid,0x99CCFFFF,CMDstr);
	}
	return 1;
}


Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: Da.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
if(PI[playerid][pHelper] == 0 && PI[playerid][pAdmin] == 0 && PI[playerid][pVIP] == 0) return 1;

sterge aceasta restrictie, adica comanda ta va fi asa

CMD:admins(playerid,params[])
{
	new admrank[32];
	for(new i; i < GetMaxPlayers(); i++)
	{
		if(!IsPlayerConnected(i)) continue;
		if(PI[i][pAdmin] == 0) continue;
		switch(PI[i][pAdmin])
		{
			case ADM_MODER: admrank = "{FFCC00}Asistent";
			case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
			case ADM_ADMIN: admrank = "{FFCC00}Administrator";
			case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
			case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
			case ADM_GRAND: admrank = "{FF0000}Developer";
		}
		CMDstr = "";
		format(CMDstr,144,"%s[%d] - %s",Name(i),i,admrank);
		SendClientMessage(playerid,0x99CCFFFF,CMDstr);
	}
	return 1;
}

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Salut, incearca asa:

 

CMD:admins(playerid,params[])
{
     new admrank[32], CMDstr[64];
    for(new i; i < GetMaxPlayers(); i++)
    {
        switch(PI[pAdmin])
        {
            case ADM_MODER: admrank = "{FFCC00}Asistent";
            case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
            case ADM_ADMIN: admrank = "{FFCC00}Administrator";
            case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
            case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
            case ADM_GRAND: admrank = "{FF0000}Developer";
        }
        SendClientMessage(playerid,-1,"[______ ** Admini Online ** ______]");
        if(PI[pAdmin] >= 1)
        {
            format(CMDstr, 144, "%s[%d] - %s", Name(i), i, admrank);
            SendClientMessage(playerid,0x99CCFFFF,CMDstr);
        } else {
            SendClientMessage(playerid,0x99CCFFFF,"Nu sunt admini online !");
        }
        SendClientMessage(playerid,-1,"---------------------------------------");
    }
    return 1;
}
Edited by StarK*
Link to comment
Share on other sites

  • 0
9 minutes ago, StarK* said:

Salut, incearca asa:

 

CMD:admins(playerid,params[])
{
     new admrank[32], CMDstr[64];
    for(new i; i < GetMaxPlayers(); i++)
    {
        switch(PI[pAdmin])
        {
            case ADM_MODER: admrank = "{FFCC00}Asistent";
            case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
            case ADM_ADMIN: admrank = "{FFCC00}Administrator";
            case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
            case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
            case ADM_GRAND: admrank = "{FF0000}Developer";
        }
        SendClientMessage(playerid,-1,"[______ ** Admini Online ** ______]");
        if(PI[pAdmin] >= 1)
        {
            format(CMDstr, 144, "%s[%d] - %s", Name(i), i, admrank);
            SendClientMessage(playerid,0x99CCFFFF,CMDstr);
        } else {
            SendClientMessage(playerid,0x99CCFFFF,"Nu sunt admini online !");
        }
        SendClientMessage(playerid,-1,"---------------------------------------");
    }
    return 1;
}

Mi-a dat urmatoarele erori si warning-uri : http://prntscr.com/a1s66o

Mister, multumesc pentru incercare dar nu a mers.

Link to comment
Share on other sites

  • 0
CMD:admins(playerid,params[])
{
    new admrank[32], CMDstr[64];
    for(new i; i < GetMaxPlayers(); i++)
    {
        switch(PI[i][pAdmin])
        {
            case ADM_MODER: admrank = "{FFCC00}Asistent";
            case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
            case ADM_ADMIN: admrank = "{FFCC00}Administrator";
            case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
            case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
            case ADM_GRAND: admrank = "{FF0000}Developer";
        }
        SendClientMessage(playerid,-1,"[______ ** Admini Online ** ______]");
        if(PI[pAdmin] >= 1)
        {
            format(CMDstr, sizeof(CMDstr), "%s[%d] - %s", Name(i), i, admrank);
            SendClientMessage(playerid, 0x99CCFFFF, CMDstr);
        } else {
            SendClientMessage(playerid,0x99CCFFFF,"Nu sunt admini online !");
        }
        SendClientMessage(playerid,-1,"---------------------------------------");
    }
    return 1;
}

 

Edited by StarK*
Link to comment
Share on other sites

  • 0
1 minute ago, StarK* said:
CMD:admins(playerid,params[])
{
     new admrank[32], CMDstr[64];
    for(new i; i < GetMaxPlayers(); i++)
    {
        switch(PI[pAdmin])
        {
            case ADM_MODER: admrank = "{FFCC00}Asistent";
            case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
            case ADM_ADMIN: admrank = "{FFCC00}Administrator";
            case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
            case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
            case ADM_GRAND: admrank = "{FF0000}Developer";
        }
        SendClientMessage(playerid,-1,"[______ ** Admini Online ** ______]");
        if(PI[pAdmin] >= 1)
        {
            format(CMDstr, sizeof(CMDstr), "%s[%d] - %s", Name(i), i, admrank);
            SendClientMessage(playerid, 0x99CCFFFF, CMDstr);
        } else {
            SendClientMessage(playerid,0x99CCFFFF,"Nu sunt admini online !");
        }
        SendClientMessage(playerid,-1,"---------------------------------------");
    }
    return 1;
}

 

Aceleasi erori / warning-uri

Link to comment
Share on other sites

  • 0

CMD:admins(playerid,params[])
{
  new admrank[32];
  for(new i; i < GetMaxPlayers(); i++)
  {
    switch(PI[i][pAdmin])
    {
      case ADM_MODER: admrank = "{FFCC00}Asistent";
      case ADM_SUPER_MODER: admrank = "{FFCC00}Moderator";
      case ADM_ADMIN: admrank = "{FFCC00}Administrator";
      case ADM_SUPER_ADMIN: admrank = "{009900}Administrator";
      case ADM_GRAND_ADMIN: admrank = "{009900}Manager";
      case ADM_GRAND: admrank = "{FF0000}Developer";
    }
    
		SendClientMessage(playerid,-1,"[______ ** Admini Online ** ______]");
    if(PI[i][pAdmin] >= 1)
    {
			new strText[80];
      format(strText, sizeof(strText), "%s[%d] - %s", Name(i), i, admrank);
      SendClientMessage(playerid, 0x99CCFFFF, strText);
    } else {
      SendClientMessage(playerid,0x99CCFFFF,"Nu sunt admini online !");
    }
    SendClientMessage(playerid,-1,"---------------------------------------");
  }
    return 1;
}

poftim, asta nu contine erori !

  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.