[Ajuda] /sublideres nгo funciona ?
#1

meu comando para ver sublideres nгo funciona?

dou /promover 444 ou /promover 555 e quando dou /sublideres aparece a msg Desculpas, sem sub-lнderes online
mas eu dou /membros e aparece o cara lб tal "1° sublider" tal tal "2° sublнder" mas quando dou /sublideres o sub nгo vai pro dialog




/Sublideres

Код:
CMD:sublideres(playerid)
{
    new string[128], string2[300], bool:SubOn = false;

    foreach(Player,i)
    {
        if(PlayerInfo[i][pCargo] != 444 || PlayerInfo[i][pCargo] != 555) continue;
        if(!SubOn)
        {
            strcat(string2, "ID\tNome[Cargo]\tOrganizaзгo\tTelefone\n");
            SubOn = true;
        }
       format(string, sizeof string, "%d\t%s[%d]\t%s\t%d\n", i ,NomePlayer(i), PlayerInfo[i][pCargo],GetOrgName(PlayerInfo[i][pLider]),PlayerInfo[i][pPnumber]);
        strcat(string2, string);
    }
    if(SubOn) return ShowPlayerDialog(playerid, 9955, DIALOG_STYLE_TABLIST_HEADERS, "Sub-Lideres Online", string2, "Fechar", "");
    else return SendClientMessage(playerid, 0xFF0000FF, "Desculpas, sem sub-lнderes online");
}
/Lideres
Код:
CMD:lideres(playerid)
{
    new string[128], string2[300], bool:LiderOn = false;

    foreach(Player,i)
    {
        if(PlayerInfo[i][pLider] == 0) continue;
        if(!LiderOn)
        {
            strcat(string2, "ID\tNome\tOrganizaзгo\tTelefone\n");
            LiderOn = true;
        }
        format(string, sizeof string, "%d\t%s\t%s\t%d\n", i ,NomePlayer(i) ,GetOrgName(PlayerInfo[i][pLider]),PlayerInfo[i][pPnumber]);
        strcat(string2, string);
    }
    if(LiderOn) return ShowPlayerDialog(playerid, 9955, DIALOG_STYLE_TABLIST_HEADERS, "Lideres Online", string2, "Fechar", "");
    else return SendClientMessage(playerid, 0xFF0000FF, "Desculpas, sem lнderes online");

}
/Promover
Код:
 CMD:promover(playerid, params[])
	{
	        new para1, level;
			if(sscanf(params, "ud", para1, level))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Use:  /promover [ID do Player] [Cargo(1-5)]");
				SendClientMessage(playerid, COLOR_GRAD2, "ou Use: /promover [ID do Player] [444 - 1° Sub-Lнder]");
				SendClientMessage(playerid, COLOR_GRAD2, "ou Use: /promover [ID do Player] [555 - 2° Sub-Lнder]");
				return true;
			}
			if(level != 1 && level != 2 && level != 3 && level != 4 && level != 5 && level != 444 && level != 555)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Use: /promover [ID do Player] [Cargo(1-5)]");
				SendClientMessage(playerid, COLOR_GRAD2, "ou Use: /promover [ID do Player] [444 - 1° Sub-Lнder]");
				SendClientMessage(playerid, COLOR_GRAD2, "ou Use: /promover [ID do Player] [555 - 2° Sub-Lнder]");
				return true;
			}
			if (PlayerInfo[playerid][pLider] > 0 || PlayerInfo[playerid][pCargo] > 99)
			{
			    if(IsPlayerConnected(para1))
			    {
			    	GetPlayerName(para1, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					if(PlayerInfo[playerid][pLider] == 0)
					{
					    if(level > 4)
						{
						   	SendClientMessage(playerid, COLOR_GREY, "Sub-Lideres sу podem Promover atй o Cargo 4!");
							return 1;
						}
						if(playerid == para1)
						{
						    SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se Promover!");
							return 1;
						}
					}
			        if(PlayerInfo[para1][pCargo] == 6 && PlayerInfo[playerid][pCargo] == 6)
					{
						SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode promover um Lнder!");
						return 1;
					}
					if(PlayerInfo[para1][pCargo] == level)
					{
						SendClientMessage(playerid, COLOR_GREY, "Este membro jб tem este Cargo!");
						return 1;
					}
					if(GetPlayerOrg(para1) == PlayerInfo[playerid][pLider])
					{
					    new string[128],cargo[128];
					    if(level == 1) { cargo = "Cargo 1"; }
						else if(level == 2) {cargo = "Cargo 2";}
						else if(level == 3) {cargo = "Cargo 3";}
						else if(level == 4) {cargo = "Cargo 4";}
						else if(level == 5) {cargo = "Cargo 5";}
						else if(level == 6) {cargo = "Cargo 6";}
						else if(level == 444) {cargo = "1° Sub-Lнder";}
						else if(level == 555) {cargo = "2° Sub-Lнder";}

						if(level > PlayerInfo[para1][pCargo])
						{
							format(string, sizeof(string), "   Vocк foi promovido a %s, pelo lнder %s", cargo,PlayerName(playerid));
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "   Vocк promoveu %s para %s.", giveplayer,cargo);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						}
						else
						{
						    format(string, sizeof(string), "   Vocк foi rebaixado a %s, pelo lнder %s", cargo,PlayerName(playerid));
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "   Vocк rebaixou %s para %s.", giveplayer,cargo);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						}

						PlayerInfo[para1][pCargo] = level;

						new org = PlayerInfo[playerid][pLider];
						if(level == 444)
						{
					   		if(strcmp(InfoOrg[org][SubLider],"Ninguйm",true)==0)
							{
					    		DemitirInfoOrg(giveplayer);
						   		ConviteInfoOrg(giveplayer, org, 444);
							}
							else
							{
								strmid(string, InfoOrg[org][SubLider], 0, strlen(InfoOrg[org][SubLider]), 255);
						   		DemitirInfoOrg(giveplayer);
						   		DemitirInfoOrg(InfoOrg[org][SubLider]);
						   		ConviteInfoOrg(string, org, 4);
						   		ConviteInfoOrg(giveplayer, org, 444);
							}
							return true;
						}
						else if(level == 555)
						{
						   	if(strcmp(InfoOrg[org][SubLider2],"Ninguйm",true)==0)
							{
                                DemitirInfoOrg(giveplayer);
								DemitirInfoOrg(giveplayer);
						   		ConviteInfoOrg(giveplayer, org, 555);
							}
							else
							{
						   		strmid(string, InfoOrg[org][SubLider2], 0, strlen(InfoOrg[org][SubLider2]), 255);
                                DemitirInfoOrg(giveplayer);
								DemitirInfoOrg(InfoOrg[org][SubLider2]);
						   		ConviteInfoOrg(string, org, 4);
						   		ConviteInfoOrg(giveplayer, org, 555);
							}
                            return true;
						}
		    			else if(level < 444)
						{
							DemitirInfoOrg(giveplayer);
						   	ConviteInfoOrg(giveplayer, org, level);
						}
					}
					else
				 	{
				 	    SendClientMessage(playerid, COLOR_GREY, "Nгo pode promover quem nгo й da sua org.");
					    return true;
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder !");
			}
			return true;
	}
Reply
#2

Tente isto:
PHP код:
CMD:sublideres(playerid)
{
    new 
string[128], string2[500], boolSubOn false;
    
strcat(string2"ID\tNome[Cargo]\tOrganizaзгo\tTelefone\n");
    foreach(
Playeri)
    {
        if(
PlayerInfo[i][pCargo] == 444 || PlayerInfo[i][pCargo] == 555
        {
            
format(stringsizeof string"%d\t%s[%d]\t%s\t%d\n",NomePlayer(i), PlayerInfo[i][pCargo],GetOrgName(PlayerInfo[i][pLider]),PlayerInfo[i][pPnumber]);
            
strcat(string2string);
            
SubOn true;
        }
    }
    if(
SubOn == false) return SendClientMessage(playerid0xFF0000FF"Nenhum sub-lнder online no momento!");
    
ShowPlayerDialog(playerid9955DIALOG_STYLE_TABLIST_HEADERS"Sub-Lideres Online"string2"Fechar""");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)