[Ajuda] Comando
#7

Quote:
Originally Posted by Netiinho
Посмотреть сообщение
Como Assim PT pode da uma dica por favor?
@edit
me basei no comentario do cara para responder, porem eu estava errado voce esta a usar strcmp.
Isso alem de ser antigo e o mais antigo metodo de criacao de comandos, recomendo a estudar sobre processadores de comandos.

recomendo este: https://sampforum.blast.hk/showthread.php?tid=460056

porem existem muitos mais.

pawn Код:
if(strcmp("/alistar", cmd, true) == 0)
    {
        if(lider[playerid] == 1 || sublider[playerid] == 1)
        {
            new plid;

            if(sscanf(cmdtext, "s[8]u", cmd, plid))
            {
                SendClientMessage(playerid, Vermelho, "Digite: /alistar [id]");
                return 1;
            }
            if(IsPlayerConnected(plid))
            {
                if(PlayerInfo[playerid][_Profissao] == 0)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 0);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Forзa Aerea.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 1)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 1);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: swat.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 2)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 2);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: PIR.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x666666, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 3)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 3);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Exercito.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 4)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 4);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Elite Aerea.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 5)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 5);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Comando Vermelho.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 6)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 6);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: La Cosa Nostra.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 7)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 7);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Yakuza.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 8)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 8);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Bope.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 9)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 9);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Mar.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x33CCFFAA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 10)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 10);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: Policia Rodoviaria Federal.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x0069D2FF, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 11)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 11);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: FBI.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0xB0B000AA, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 12)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 12);
                    format(string, sizeof(string), "%s te alistou para a organizaзгo: AQ.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x989758FF, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 13)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 13);
                    format(string, sizeof(string), "%s te alistou para A TV: Panico Na Bande.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x989758FF, string);
                }
                if(PlayerInfo[playerid][_Profissao] == 14)
                {
                    format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                    dini_IntSet(file2, "Profissao", 14);
                    format(string, sizeof(string), "%s te alistou para o: Gate.", GetPlayerNameEx(playerid));
                    SendClientMessage(playerid, COLOR_GREEN, "Comando efetuado com sucesso.");
                    SendClientMessage(plid, 0x989758FF, string);
                }
            }
            else
            {
                SendClientMessage(playerid, Vermelho, "Jogador nгo conectado!");
            }
        }

        return 1;
    }
quanto ao seu problema acredito que resolva.
Reply


Messages In This Thread
Comando - by Netiinho - 09.01.2015, 22:39
Re: Comando - by [BOPE]Seu._.Madruga - 09.01.2015, 22:48
Re: Comando - by PT - 09.01.2015, 23:18
Re: Comando - by Netiinho - 09.01.2015, 23:33
Re: Comando - by mau.tito - 09.01.2015, 23:36
Re: Comando - by Netiinho - 09.01.2015, 23:48
Re: Comando - by PT - 10.01.2015, 00:05
Re: Comando - by Netiinho - 10.01.2015, 00:23
Re: Comando - by PT - 10.01.2015, 04:31
Re: Comando - by Netiinho - 10.01.2015, 13:07

Forum Jump:


Users browsing this thread: 1 Guest(s)