[Ajuda]/Convidar
#1

Encontrei um bug no gm aqui, o player lider digita /convidar para um player civil (sem nenhum profissao nem nada) e diz que o player n pode entrar na profissao.. sempre da isso, alguem sabe onde estб o erro? vlw

pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /convidar [playerid/Parte-do-Nick]");
                return 1;
            }
            new para1;
            new ftext[20];
            para1 = ReturnUser(tmp);
            if (PlayerInfo[playerid][pLeader] >= 1 && PlayerInfo[para1][pMember] == 0)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
                        {
                            if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Polнcia Militar"; }
                            else if(PlayerInfo[playerid][pLeader] == 2) {  ftext = "Polнcia Federal"; }
                            else if(PlayerInfo[playerid][pLeader] == 3) {  ftext = "Forзas Armadas"; }
                            //else if(PlayerInfo[playerid][pLeader] == 4) {  ftext = "Emergкncias.";  }
                            else if(PlayerInfo[playerid][pLeader] == 5) {  ftext = "Front Yard Ballas";  }
                            else if(PlayerInfo[playerid][pLeader] == 6) {  ftext = "Grove Street";  }
                            else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "Polнtico"; }
                            else if(PlayerInfo[playerid][pLeader] == 8) {  ftext = "Hitman";  }
                            else if(PlayerInfo[playerid][pLeader] == 9) {  ftext = "Repуrter";  }
                            else if(PlayerInfo[playerid][pLeader] == 10) {  ftext = "Lowrider";  }
                            else if(PlayerInfo[playerid][pLeader] == 11) {  ftext = "San Fierro Riffa";  }
                            else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "Los Santos Vagos";  }
                            else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "Asphalt King's";  }
                            else if(PlayerInfo[playerid][pLeader] == 14) {  ftext = "Policia Rodoviaria"; }
                            else if(PlayerInfo[playerid][pLeader] == 15) {  ftext = "Varrio Los Aztecas"; }
                            else if(PlayerInfo[playerid][pLeader] == 16) {  ftext = "Triads"; }
                            else if(PlayerInfo[playerid][pLeader] == 17) {  ftext = "Mafia Yakuza"; }
                            else if(PlayerInfo[playerid][pLeader] == 18) {  ftext = "Drifters"; }
                            else if(PlayerInfo[playerid][pLeader] == 19) {  ftext = "Comando Vermelho"; }
                            else if(PlayerInfo[playerid][pLeader] == 20) {  ftext = "Pcc"; }
                            else if(PlayerInfo[playerid][pLeader] == 21) {  ftext = "BOPE"; }
                            else if(PlayerInfo[playerid][pLeader] == 22) {  ftext = "Al-Qaeda"; }
                            else if(PlayerInfo[playerid][pLeader] == 23) {  ftext = "Policia Civil"; }
                            else if(PlayerInfo[playerid][pLeader] == 24) {  ftext = "Bombeiros"; }
                            else { return 1; }
                            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            printf("|ADMIN|: %s convidou %s para entrar no grupo dos: '%s'", sendername, giveplayer, ftext);
                            format(string, sizeof(string), "Vocк recebeu um convite para entrar na profissгo '%s' (digite /aceitar convite) para aceitar.", ftext, sendername);
                            SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "Vocк convidou %s para sua profissгo '%s'.", giveplayer,ftext);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            Invite[para1] = 1;
                            InviteOffer[para1] = playerid;
                            InviteJob[para1] = PlayerInfo[playerid][pLeader];
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "  O jogador nгo pode se tornar essa profissгo.");
                            return 1;
                        }
                    }
                }//not connected
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб autorizado a ultilizar este comando !");
            }
        }
        return 1;
    }
Reply
#2

poste a parte q diz q o player nгo pode entrar, vc postou o comando convidar, mais nao postou o /aceitar ^^
Reply
#3

PHP код:
if(strcmp(cmd"/convidar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /convidar [playerid/Parte-do-Nick]");
                return 
1;
            }
            new 
para1;
            new 
ftext[20];
            
para1 ReturnUser(tmp);
            if (
PlayerInfo[playerid][pLeader] >= && PlayerInfo[para1][pMember] == 0)
            {
                if(
IsPlayerConnected(para1))
                {
                    if(
para1 != INVALID_PLAYER_ID)
                    {
                        if (
PlayerInfo[para1][pMember] == && PlayerInfo[para1][pFMember] == 255)
                        {
                            if(
PlayerInfo[playerid][pLeader] == 1) { ftext "Polнcia Militar"; }
                            else if(
PlayerInfo[playerid][pLeader] == 2) {  ftext "Polнcia Federal"; }
                            else if(
PlayerInfo[playerid][pLeader] == 3) {  ftext "Forзas Armadas"; }
                            
//else if(PlayerInfo[playerid][pLeader] == 4) {  ftext = "Emergкncias.";  }
                            
else if(PlayerInfo[playerid][pLeader] == 5) {  ftext "Front Yard Ballas";  }
                            else if(
PlayerInfo[playerid][pLeader] == 6) {  ftext "Grove Street";  }
                            else if(
PlayerInfo[playerid][pLeader] == 7) { ftext "Polнtico"; }
                            else if(
PlayerInfo[playerid][pLeader] == 8) {  ftext "Hitman";  }
                            else if(
PlayerInfo[playerid][pLeader] == 9) {  ftext "Repуrter";  }
                            else if(
PlayerInfo[playerid][pLeader] == 10) {  ftext "Lowrider";  }
                            else if(
PlayerInfo[playerid][pLeader] == 11) {  ftext "San Fierro Riffa";  }
                            else if(
PlayerInfo[playerid][pLeader] == 12) { ftext "Los Santos Vagos";  }
                            else if(
PlayerInfo[playerid][pLeader] == 13) { ftext "Asphalt King's";  }
                            else if(
PlayerInfo[playerid][pLeader] == 14) {  ftext "Policia Rodoviaria"; }
                            else if(
PlayerInfo[playerid][pLeader] == 15) {  ftext "Varrio Los Aztecas"; }
                            else if(
PlayerInfo[playerid][pLeader] == 16) {  ftext "Triads"; }
                            else if(
PlayerInfo[playerid][pLeader] == 17) {  ftext "Mafia Yakuza"; }
                            else if(
PlayerInfo[playerid][pLeader] == 18) {  ftext "Drifters"; }
                            else if(
PlayerInfo[playerid][pLeader] == 19) {  ftext "Comando Vermelho"; }
                            else if(
PlayerInfo[playerid][pLeader] == 20) {  ftext "Pcc"; }
                            else if(
PlayerInfo[playerid][pLeader] == 21) {  ftext "BOPE"; }
                            else if(
PlayerInfo[playerid][pLeader] == 22) {  ftext "Al-Qaeda"; }
                            else if(
PlayerInfo[playerid][pLeader] == 23) {  ftext "Policia Civil"; }
                            else if(
PlayerInfo[playerid][pLeader] == 24) {  ftext "Bombeiros"; }
                            else { return 
1; }
                            
GetPlayerName(para1giveplayersizeof(giveplayer));
                            
GetPlayerName(playeridsendernamesizeof(sendername));
                            
printf("|ADMIN|: %s convidou %s para entrar no grupo dos: '%s'"sendernamegiveplayerftext);
                            
format(stringsizeof(string), "Vocк recebeu um convite para entrar na profissгo '%s' (digite /aceitar convite) para aceitar."ftextsendername);
                            
SendClientMessage(para1COLOR_LIGHTBLUEstring);
                            
format(stringsizeof(string), "Vocк convidou %s para sua profissгo '%s'."giveplayer,ftext);
                            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                            
Invite[para1] = 1;
                            
InviteOffer[para1] = playerid;
                            
InviteJob[para1] = PlayerInfo[playerid][pLeader];
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"  O jogador nгo pode se tornar essa profissгo.");
                            return 
1;
                        }
                    }
                }
//not connected
            
}
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Vocк nгo estб autorizado a ultilizar este comando !");
            }
        }
        return 
1;
    } 
Reply
#4

cara o /aceitar й mto grande, pois tem varias funзoes, e eu n vi erro no /aceitar convite.. acho q o erro й ai, pq o convite nem chega no cara
Reply
#5

Testou o meu?
Reply
#6

vou testar, й q precisa por o server online para todos.. para testar em 2, daqui 5min eu falo aqui se deu ou nao, mas por curiosidade, oq vc alterou no cmd Bruno?
Reply
#7

Tirei a veficaзгo do gTeam[para1]==TEAM_GREEN que tava tendo.
Reply
#8

n funcionou.. agr diz que eu n tenho autorizaзгo suficiente
Reply
#9

ajuda :X
Reply
#10

tente assim:
pawn Код:
if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USO: /convidar [playerid/Parte-do-Nick]");
        new para1,ftext[20];
        para1 = ReturnUser(tmp);
        if (PlayerInfo[playerid][pLeader]  < 1 /*&& PlayerInfo[para1][pMember] == 0*/) return SendClientMessage(playerid,-1,"Vocк nem й lider .-.");
        if(!IsPlayerConnected(para1)) return SendClientMessage(playerid, -1,"Jogador nгo conectado");
        if (gTeam[para1]==TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
        {
            if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Polнcia Militar"; }
            else if(PlayerInfo[playerid][pLeader] == 2) {  ftext = "Polнcia Federal"; }
            else if(PlayerInfo[playerid][pLeader] == 3) {  ftext = "Forзas Armadas"; }
            //else if(PlayerInfo[playerid][pLeader] == 4) {  ftext = "Emergкncias.";  }
            else if(PlayerInfo[playerid][pLeader] == 5) {  ftext = "Front Yard Ballas";  }
            else if(PlayerInfo[playerid][pLeader] == 6) {  ftext = "Grove Street";  }
            else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "Polнtico"; }
            else if(PlayerInfo[playerid][pLeader] == 8) {  ftext = "Hitman";  }
            else if(PlayerInfo[playerid][pLeader] == 9) {  ftext = "Repуrter";  }
            else if(PlayerInfo[playerid][pLeader] == 10) {  ftext = "Lowrider";  }
            else if(PlayerInfo[playerid][pLeader] == 11) {  ftext = "San Fierro Riffa";  }
            else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "Los Santos Vagos";  }
            else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "Asphalt King's";  }
            else if(PlayerInfo[playerid][pLeader] == 14) {  ftext = "Policia Rodoviaria"; }
            else if(PlayerInfo[playerid][pLeader] == 15) {  ftext = "Varrio Los Aztecas"; }
            else if(PlayerInfo[playerid][pLeader] == 16) {  ftext = "Triads"; }
            else if(PlayerInfo[playerid][pLeader] == 17) {  ftext = "Mafia Yakuza"; }
            else if(PlayerInfo[playerid][pLeader] == 18) {  ftext = "Drifters"; }
            else if(PlayerInfo[playerid][pLeader] == 19) {  ftext = "Comando Vermelho"; }
            else if(PlayerInfo[playerid][pLeader] == 20) {  ftext = "Pcc"; }
            else if(PlayerInfo[playerid][pLeader] == 21) {  ftext = "BOPE"; }
            else if(PlayerInfo[playerid][pLeader] == 22) {  ftext = "Al-Qaeda"; }
            else if(PlayerInfo[playerid][pLeader] == 23) {  ftext = "Policia Civil"; }
            else if(PlayerInfo[playerid][pLeader] == 24) {  ftext = "Bombeiros"; }
            else { return 1; }
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            printf("|ADMIN|: %s convidou %s para entrar no grupo dos: '%s'", sendername, giveplayer, ftext);
            format(string, sizeof(string), "Vocк recebeu um convite para entrar na profissгo '%s' (digite /aceitar convite) para aceitar.", ftext, sendername);
            SendClientMessage(para1, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "Vocк convidou %s para sua profissгo '%s'.", giveplayer,ftext);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            Invite[para1] = 1;
            InviteOffer[para1] = playerid;
            InviteJob[para1] = PlayerInfo[playerid][pLeader];
        }
        else return SendClientMessage(playerid, COLOR_GREY, "  O jogador nгo pode se tornar essa profissгo.");
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)