[Ajuda] Sistema de Familia
#1

Preciso de ajuda com o sistema de famнlia que nгo ta expulsando um membro dб Familia.

Код:
    if(dialogid == 775)
    {
        if(response == 1)
        {
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 775, DIALOG_STYLE_INPUT, "Expulsar da Famнlia", "Digite abaixo o nъmero do membro no /infofamilia\nque vocк deseja expulsar da sua famнlia:", "Confirmar", "Cancelar");
            if(!IsNumero(inputtext)) return ShowPlayerDialog(playerid, 775, DIALOG_STYLE_INPUT, "Expulsar da Famнlia", "Digite abaixo o nъmero do membro no /infofamilia\nque vocк deseja expulsar da sua famнlia:", "Confirmar", "Cancelar");
            new numero = strval(inputtext);
            if(numero < 1 || numero > 9) return ShowPlayerDialog(playerid, 775, DIALOG_STYLE_INPUT, "Expulsar da Famнlia", "Digite abaixo o nъmero do membro no /infofamilia\nque vocк deseja expulsar da sua famнlia:", "Confirmar", "Cancelar");
            new idfam = GetIDFamilia(playerid);
            switch(numero)
            {
                case 1: { strmid(Familia[idfam][Membro1], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func1], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 2: { strmid(Familia[idfam][Membro2], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func2], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 3: { strmid(Familia[idfam][Membro3], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func3], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 4: { strmid(Familia[idfam][Membro4], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func4], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 5: { strmid(Familia[idfam][Membro5], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func5], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 6: { strmid(Familia[idfam][Membro6], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func6], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 7: { strmid(Familia[idfam][Membro7], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func7], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 8: { strmid(Familia[idfam][Membro8], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func8], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 9: { strmid(Familia[idfam][Membro9], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func9], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            }
            SendClientMessage(playerid, COLOR_YELLOW, "Membro escolhido expulso com sucesso!");
            SalvarFamilias();
            return 1;
       }
    }
Reply
#2

Код:
            switch(numero)
            {
                case 1: { strmid(Familia[idfam][Membro1], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func1], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 2: { strmid(Familia[idfam][Membro2], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func2], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 3: { strmid(Familia[idfam][Membro3], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func3], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 4: { strmid(Familia[idfam][Membro4], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func4], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 5: { strmid(Familia[idfam][Membro5], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func5], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 6: { strmid(Familia[idfam][Membro6], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func6], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 7: { strmid(Familia[idfam][Membro7], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func7], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 8: { strmid(Familia[idfam][Membro8], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func8], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 9: { strmid(Familia[idfam][Membro9], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func9], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            }
Nesse cуdigo tu sу tб mostrando que o "nome" de n slots de membro ficarб setado como "Ninguйm". Creio que falta tu setar nas variбveis individuais do jogador pra tirar.
Reply
#3

Quote:
Originally Posted by MINDSnnf
Посмотреть сообщение
Код:
            switch(numero)
            {
                case 1: { strmid(Familia[idfam][Membro1], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func1], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 2: { strmid(Familia[idfam][Membro2], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func2], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 3: { strmid(Familia[idfam][Membro3], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func3], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 4: { strmid(Familia[idfam][Membro4], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func4], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 5: { strmid(Familia[idfam][Membro5], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func5], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 6: { strmid(Familia[idfam][Membro6], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func6], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 7: { strmid(Familia[idfam][Membro7], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func7], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 8: { strmid(Familia[idfam][Membro8], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func8], "Nenhuma", 0, strlen("Nenhuma"), 255); }
                case 9: { strmid(Familia[idfam][Membro9], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idfam][Func9], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            }
Nesse cуdigo tu sу tб mostrando que o "nome" de n slots de membro ficarб setado como "Ninguйm". Creio que falta tu setar nas variбveis individuais do jogador pra tirar.
Mais tipo tem uma funзгo que o membro ele mesmo pode se sair da familia que й essa e estб funcionando perfeitamente mais a do lider expulsar o membro nгo vai


Код:
    if(dialogid == 776)
    {
        if(response == 1)
        {
            new idf = GetIDFamilia(playerid);
            new cor = GetCorFamilia(idf);
            if(strcmp(Familia[idf][Membro1], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro1], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func1], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro2], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro2], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func2], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro3], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro3], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func3], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro4], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro4], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func4], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro5], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro5], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func5], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro6], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro6], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func6], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro7], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro7], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func7], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro8], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro8], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func8], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            if(strcmp(Familia[idf][Membro9], PlayerName(playerid), true) == 0) { strmid(Familia[idf][Membro9], "Ninguйm", 0, strlen("Ninguйm"), 255); strmid(Familia[idf][Func9], "Nenhuma", 0, strlen("Nenhuma"), 255); }
            SendClientMessage(playerid, cor, "Vocк saiu da famнlia com sucesso!");
            SalvarFamilias();
            for(new i = 0; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if((PlayerEmFamilia(i)) && (GetIDFamilia(i) == idf))
                    {
                        new barro[256];
                        format(barro, sizeof(barro), "Famнlia %s: %s saiu da Famнlia.", GetNomeFamilia(playerid), PlayerName(playerid));
                        SendClientMessage(i, cor, barro);
                    }
                }
            }
            return 1;
        }
        else return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)