[AJUDA] Comando /mostrarvagas
#1

Ae tava tentando criar um comando /mostrarvagas, entretanto nгo deu muito sucesso, quando eu mostro as vagas pra algum player, em vez de mostrar pra ele ta mostrando й pra mim e tambem o comando ta dando warning:

Warning:
Код:
E:\Documents and Settings\Casa PC\Meus documentos\BRA.pwn(15549) : warning 217: loose indentation
Linha do warning:

Код:
 if(strcmp(cmd, "/mostrarvagas", true) == 0)
Comando

Код:
if(strcmp(cmd, "/mostrarvagas", true) == 0)
    	{
        if(IsPlayerConnected(playerid))
	    {
	        tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "Use: /mostrarvagas [id]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
		if(PlayerInfo[playerid][pAdmin] < 1)
	    {
			SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um admin.");
			return 1;
	    }
			if(IsPlayerConnected(giveplayerid))
			{
				if(giveplayerid != INVALID_PLAYER_ID)
				{
				    if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nao pode mostrar vagas a vocк!"); return 1; }
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
					    SendClientMessage(playerid, COR_VERMELHO, "|__O Admin Lhe Mostrou Todas As Vagas De Lideres__|");
                        format(string, sizeof(string), "Policia Militar: %s", InfoOrg[1][Lider]);
		                SendClientMessage(playerid, COR_PM, string);
		                format(string, sizeof(string), "ROTAM: %s", InfoOrg[2][Lider]);
		         		SendClientMessage(playerid, COR_PR, string);
						format(string, sizeof(string), "Exйrcito: %s", InfoOrg[3][Lider]);
						SendClientMessage(playerid, COR_EXE, string);
						format(string, sizeof(string), "Mйdicos: %s", InfoOrg[4][Lider]);
						SendClientMessage(playerid, COR_SAMU, string);
						format(string, sizeof(string), "Aztecas: %s", InfoOrg[5][Lider]);
						SendClientMessage(playerid, COR_AZTECAS, string);
						format(string, sizeof(string), "Hamas: %s", InfoOrg[6][Lider]);
						SendClientMessage(playerid, COR_HAMAS, string);
						format(string, sizeof(string), "Prefeitura: %s", InfoOrg[7][Lider]);
						SendClientMessage(playerid, COR_PRE, string);
						format(string, sizeof(string), "Hitmans: %s", InfoOrg[8][Lider]);
						SendClientMessage(playerid, COR_HITMAN, string);
						format(string, sizeof(string), "Reporteres: %s", InfoOrg[9][Lider]);
						SendClientMessage(playerid, COR_REP, string);
						format(string, sizeof(string), "Taxistas: %s", InfoOrg[10][Lider]);
						SendClientMessage(playerid, COR_TAXI, string);
    					format(string, sizeof(string), "Policia Federal: %s", InfoOrg[11][Lider]);
						SendClientMessage(playerid, COR_PF, string);
						format(string, sizeof(string), "Mбfia Corleone: %s", InfoOrg[12][Lider]);
						SendClientMessage(playerid, COR_CORLEONE, string);
						format(string, sizeof(string), "Mбfia Yakuza: %s", InfoOrg[13][Lider]);
						SendClientMessage(playerid, COR_YAK, string);
						format(string, sizeof(string), "Groove: %s", InfoOrg[14][Lider]);
						SendClientMessage(playerid, COR_GRO, string);
    					format(string, sizeof(string), "Al'qaeda: %s", InfoOrg[15][Lider]);
						SendClientMessage(playerid, COR_AL, string);
						format(string, sizeof(string), "Policia Civil: %s", InfoOrg[16][Lider]);
						SendClientMessage(playerid, COR_PC, string);
    					format(string, sizeof(string), "Ballas: %s", InfoOrg[17][Lider]);
						SendClientMessage(playerid, COR_BALLAS, string);
    					format(string, sizeof(string), "Vagos: %s", InfoOrg[18][Lider]);
						SendClientMessage(playerid, COR_VAGOS, string);
    					format(string, sizeof(string), "Comando Vermelho: %s", InfoOrg[19][Lider]);
						SendClientMessage(playerid, COR_CV, string);
    					format(string, sizeof(string), "PCC: %s", InfoOrg[20][Lider]);
						SendClientMessage(playerid, COLOR_DBLUE, string);
    					format(string, sizeof(string), "Le Fodasticos %s", InfoOrg[21][Lider]);
						SendClientMessage(playerid, COR_FODASTICOS, string);
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   O Jogador esta longe de Vocк !");
					    return 1;
					}
				}
			}
	        else
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   O Jogador estб offline !");
	            return 1;
	        }
		}
	    return 1;
 	}
Qualquer ajuda й bem vinda
Reply
#2

Tente assim:

pawn Код:
if(strcmp(cmd, "/mostrarvagas", true) == 0)
{
    if(IsPlayerConnected(playerid)) {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) {
            SendClientMessage(playerid, COLOR_WHITE, "Use: /mostrarvagas [id]");
            return 1;
        }
        giveplayerid = ReturnUser(tmp);
        if(PlayerInfo[playerid][pAdmin] < 1) {
            SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um admin.");
            return 1;
        }
        if(IsPlayerConnected(giveplayerid)) {
            if(giveplayerid != INVALID_PLAYER_ID) {
                if (ProxDetectorS(8.0, playerid, giveplayerid)) {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nao pode mostrar vagas a vocк!"); return 1; }
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    SendClientMessage(playerid, COR_VERMELHO, "|__O Admin Lhe Mostrou Todas As Vagas De Lideres__|");
                    format(string, sizeof(string), "Policia Militar: %s", InfoOrg[1][Lider]);
                    SendClientMessage(playerid, COR_PM, string);
                    format(string, sizeof(string), "ROTAM: %s", InfoOrg[2][Lider]);
                    SendClientMessage(playerid, COR_PR, string);
                    format(string, sizeof(string), "Exйrcito: %s", InfoOrg[3][Lider]);
                    SendClientMessage(playerid, COR_EXE, string);
                    format(string, sizeof(string), "Mйdicos: %s", InfoOrg[4][Lider]);
                    SendClientMessage(playerid, COR_SAMU, string);
                    format(string, sizeof(string), "Aztecas: %s", InfoOrg[5][Lider]);
                    SendClientMessage(playerid, COR_AZTECAS, string);
                    format(string, sizeof(string), "Hamas: %s", InfoOrg[6][Lider]);
                    SendClientMessage(playerid, COR_HAMAS, string);
                    format(string, sizeof(string), "Prefeitura: %s", InfoOrg[7][Lider]);
                    SendClientMessage(playerid, COR_PRE, string);
                    format(string, sizeof(string), "Hitmans: %s", InfoOrg[8][Lider]);
                    SendClientMessage(playerid, COR_HITMAN, string);
                    format(string, sizeof(string), "Reporteres: %s", InfoOrg[9][Lider]);
                    SendClientMessage(playerid, COR_REP, string);
                    format(string, sizeof(string), "Taxistas: %s", InfoOrg[10][Lider]);
                    SendClientMessage(playerid, COR_TAXI, string);
                    format(string, sizeof(string), "Policia Federal: %s", InfoOrg[11][Lider]);
                    SendClientMessage(playerid, COR_PF, string);
                    format(string, sizeof(string), "Mбfia Corleone: %s", InfoOrg[12][Lider]);
                    SendClientMessage(playerid, COR_CORLEONE, string);
                    format(string, sizeof(string), "Mбfia Yakuza: %s", InfoOrg[13][Lider]);
                    SendClientMessage(playerid, COR_YAK, string);
                    format(string, sizeof(string), "Groove: %s", InfoOrg[14][Lider]);
                    SendClientMessage(playerid, COR_GRO, string);
                    format(string, sizeof(string), "Al'qaeda: %s", InfoOrg[15][Lider]);
                    SendClientMessage(playerid, COR_AL, string);
                    format(string, sizeof(string), "Policia Civil: %s", InfoOrg[16][Lider]);
                    SendClientMessage(playerid, COR_PC, string);
                    format(string, sizeof(string), "Ballas: %s", InfoOrg[17][Lider]);
                    SendClientMessage(playerid, COR_BALLAS, string);
                    format(string, sizeof(string), "Vagos: %s", InfoOrg[18][Lider]);
                    SendClientMessage(playerid, COR_VAGOS, string);
                    format(string, sizeof(string), "Comando Vermelho: %s", InfoOrg[19][Lider]);
                    SendClientMessage(playerid, COR_CV, string);
                    format(string, sizeof(string), "PCC: %s", InfoOrg[20][Lider]);
                    SendClientMessage(playerid, COLOR_DBLUE, string);
                    format(string, sizeof(string), "Le Fodasticos %s", InfoOrg[21][Lider]);
                    SendClientMessage(playerid, COR_FODASTICOS, string);
                }
                else {
                    SendClientMessage(playerid, COLOR_GREY, "   O Jogador esta longe de Vocк !");
                    return 1;
                }
            }
        }
        else {
            SendClientMessage(playerid, COLOR_GREY, "   O Jogador estб offline !");
            return 1;
        }
    }
    return 1;
}
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=260576
Reply
#4

Quote:
Originally Posted by Miqueias Barros
Посмотреть сообщение
OFF: Miqueias Miqueias, ta com medo de mim nй? Fugiu e tudo eu ri MT kkkkkkkkkk, entra no msn.
Reply
#5

BluX ta a mesma coisa, testei, mostra й pra mim em vez do player q quero mostrar
Reply
#6

Quote:
Originally Posted by titinho557
Посмотреть сообщение
BluX ta a mesma coisa, testei, mostra й pra mim em vez do player q quero mostrar
Use seu prуprio cуdigo ali!
Apenas clique no link que te mandei e aprenda identar usando seu prуprio cуdigo!

Simples assim, sу no Fуrum SA-MP. '-'
Reply
#7

pawn Код:
if(strcmp(cmd, "/mostrarvagas", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Use: /mostrarvagas [id]");
    giveplayerid = ReturnUser(tmp);
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um admin.");
    if(IsPlayerConnected(giveplayerid))
    {
        if(ProxDetectorS(8.0, playerid, giveplayerid))
        {
            if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "Vocк nao pode mostrar vagas a vocк!");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            SendClientMessage(playerid, COR_VERMELHO, "|__O Admin Lhe Mostrou Todas As Vagas De Lideres__|");
            format(string, sizeof(string), "Policia Militar: %s", InfoOrg[1][Lider]);
            SendClientMessage(playerid, COR_PM, string);
            format(string, sizeof(string), "ROTAM: %s", InfoOrg[2][Lider]);
            SendClientMessage(playerid, COR_PR, string);
            format(string, sizeof(string), "Exйrcito: %s", InfoOrg[3][Lider]);
            SendClientMessage(playerid, COR_EXE, string);
            format(string, sizeof(string), "Mйdicos: %s", InfoOrg[4][Lider]);
            SendClientMessage(playerid, COR_SAMU, string);
            format(string, sizeof(string), "Aztecas: %s", InfoOrg[5][Lider]);
            SendClientMessage(playerid, COR_AZTECAS, string);
            format(string, sizeof(string), "Hamas: %s", InfoOrg[6][Lider]);
            SendClientMessage(playerid, COR_HAMAS, string);
            format(string, sizeof(string), "Prefeitura: %s", InfoOrg[7][Lider]);
            SendClientMessage(playerid, COR_PRE, string);
            format(string, sizeof(string), "Hitmans: %s", InfoOrg[8][Lider]);
            SendClientMessage(playerid, COR_HITMAN, string);
            format(string, sizeof(string), "Reporteres: %s", InfoOrg[9][Lider]);
            SendClientMessage(playerid, COR_REP, string);
            format(string, sizeof(string), "Taxistas: %s", InfoOrg[10][Lider]);
            SendClientMessage(playerid, COR_TAXI, string);
            format(string, sizeof(string), "Policia Federal: %s", InfoOrg[11][Lider]);
            SendClientMessage(playerid, COR_PF, string);
            format(string, sizeof(string), "Mбfia Corleone: %s", InfoOrg[12][Lider]);
            SendClientMessage(playerid, COR_CORLEONE, string);
            format(string, sizeof(string), "Mбfia Yakuza: %s", InfoOrg[13][Lider]);
            SendClientMessage(playerid, COR_YAK, string);
            format(string, sizeof(string), "Groove: %s", InfoOrg[14][Lider]);
            SendClientMessage(playerid, COR_GRO, string);
            format(string, sizeof(string), "Al'qaeda: %s", InfoOrg[15][Lider]);
            SendClientMessage(playerid, COR_AL, string);
            format(string, sizeof(string), "Policia Civil: %s", InfoOrg[16][Lider]);
            SendClientMessage(playerid, COR_PC, string);
            format(string, sizeof(string), "Ballas: %s", InfoOrg[17][Lider]);
            SendClientMessage(playerid, COR_BALLAS, string);
            format(string, sizeof(string), "Vagos: %s", InfoOrg[18][Lider]);
            SendClientMessage(playerid, COR_VAGOS, string);
            format(string, sizeof(string), "Comando Vermelho: %s", InfoOrg[19][Lider]);
            SendClientMessage(playerid, COR_CV, string);
            format(string, sizeof(string), "PCC: %s", InfoOrg[20][Lider]);
            SendClientMessage(playerid, COLOR_DBLUE, string);
            format(string, sizeof(string), "Le Fodasticos %s", InfoOrg[21][Lider]);
            SendClientMessage(playerid, COR_FODASTICOS, string);
        }
        else return SendClientMessage(playerid, COLOR_GREY, "   O Jogador esta longe de Vocк !");
    }
    else return SendClientMessage(playerid, COLOR_GREY, "   O Jogador estб offline !");
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)