[Ajuda] convite de sublider bugado
#1

Esse й um problema que existe em praticamente todos GM base gf, ocorre na organizaзгo "Prefeitura": quando sub-lнder da organizaзгo convida alguйm, esse alguйm spawna na hq vбrias vezes seguidas atй ser banido pelo samp.ban. Mas o caso й que quando o lнder da org convida, fica tudo normal. Fiquei intrigado com esse bug e tentei arrumar ele e nгo consegui, ai vim consultar aos experientes pra ver se sabem o que se passa.

pawn Код:
// spawn da prefeitura
        if(PlayerInfo[playerid][pMembro] == 7 || PlayerInfo[playerid][pLider] == 7)//Prefeito Nascimento
        {

            XXAirBreak[playerid] += 3;
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerInterior(playerid, 3);
            XXAirBreak[playerid] += 3;SetPlayerPos(playerid, 354.8267,154.4102,1025.7964);
            SetPlayerFacingAngle(playerid,181.4693);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerWantedLevel(playerid, 0);
            return true;
        }

// comando de convidar pra org
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /convidar [playerid/Parte-do-Nick]");
                return true;
            }
            new para1;
            para1 = ReturnUser(tmp);
            if (PlayerInfo[playerid][pLider] >= 1 || PlayerInfo[playerid][pCargo] == 200 || PlayerInfo[playerid][pCargo] == 100)
            {
                new lolz = GetPlayerOrg(playerid);
                if(TemVaga(lolz) == 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvaga primeiro.");
                    return true;
                }
                if(IsPlayerConnected(para1))
                {
                    if(PlayerInfo[para1][pMembro] != 0 || PlayerInfo[para1][pLider] != 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Este player jб participa de Org/Gang/Mafia.");
                        return true;
                    }
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* Vocк convidou %s para sua organizaзгo: %s.", giveplayer,NomeORG(playerid));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

                        new convitestring[128];
                        format(convitestring,sizeof(convitestring), "O Lider dos: %s\n\nEsta convidando voce para entrar para a organizaзгo\n\nDeseja entrar para org?",NomeORG(playerid));
                        ShowPlayerDialog(para1,642,DIALOG_STYLE_MSGBOX,"Convite",convitestring,"Aceitar","Recusar");
                        InviteOffer[para1] = playerid;
                        InviteJob[para1] = lolz;
                    }
                }//not connected
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Somente lнderes podem usar este comando !");
            }
        }
        return true;
    }

// comando de aceitar o convite

    if(strcmp(cmd,"/aceitar",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            new x_Emprego[32];
            x_Emprego = strtok(cmdtext, idx);
            if(!strlen(x_Emprego)) {
                SendClientMessage(playerid, COLOR_WHITE, "|__________________[ Aceitar ]__________________|");
                SendClientMessage(playerid, COLOR_WHITE, "Use: aceitar [nome]");
                SendClientMessage(playerid, COLOR_GREY, "Nomes Validos: Transa, drogas, Reparo, Advogado, seguranзa, emprego, aovivo, Refill , Assalto, tunagem");
                SendClientMessage(playerid, COLOR_GREY, "Nomes Validos: Carro, Taxi, Onibus, Boxe, Medico, Mecanico, Multa ,divorcio, mendigo, convite, arrancadao");
                return true;
            }
            //new para1;
            if(strcmp(x_Emprego,"convite",true) == 0)
            {
                if(InviteOffer[playerid] < 999)
                {
                    if(IsPlayerConnected(InviteOffer[playerid]))
                    {
                        if(PlayerInfo[InviteOffer[playerid]][pLider] == 1) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 282; SetPlayerSkin(playerid, 282); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 2) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 285; SetPlayerSkin(playerid, 285); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 3) { PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; ChosenSkin[playerid] = 287; SetPlayerSkin(playerid, 287); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 4) { PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; ChosenSkin[playerid] = 158; SetPlayerSkin(playerid, 158); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 5) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 114; SetPlayerSkin(playerid, 114); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 6) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 121; SetPlayerSkin(playerid, 121); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 7) { PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; ChosenSkin[playerid] = 163; SetPlayerSkin(playerid, 163); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 8) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 127; SetPlayerSkin(playerid, 127); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 9) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 148; SetPlayerSkin(playerid, 148); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 10) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 28; SetPlayerSkin(playerid, 28); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 11) { PlayerInfo[playerid][pTeam] = 25; gTeam[playerid] = 2; ChosenSkin[playerid] = 286; SetPlayerSkin(playerid, 286); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 12) { PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 12; ChosenSkin[playerid] = 126; SetPlayerSkin(playerid, 126); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 13) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 203; SetPlayerSkin(playerid, 203); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 14) { PlayerInfo[playerid][pTeam] = 15; gTeam[playerid] = 12; ChosenSkin[playerid] = 107; SetPlayerSkin(playerid, 107); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 15) { PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 17; ChosenSkin[playerid] = 30; SetPlayerSkin(playerid, 30); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 16) { PlayerInfo[playerid][pTeam] = 25; gTeam[playerid] = 2; ChosenSkin[playerid] = 186; SetPlayerSkin(playerid, 186); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 17) { PlayerInfo[playerid][pTeam] = 18; gTeam[playerid] = 12; ChosenSkin[playerid] = 103; SetPlayerSkin(playerid, 103); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 18) { PlayerInfo[playerid][pTeam] = 19; gTeam[playerid] = 12; ChosenSkin[playerid] = 109; SetPlayerSkin(playerid, 109); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 19) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 40; SetPlayerSkin(playerid, 40); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 20) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 247; SetPlayerSkin(playerid, 247); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 21) { PlayerInfo[playerid][pTeam] = 20; gTeam[playerid] = 12; ChosenSkin[playerid] = 292; SetPlayerSkin(playerid, 292); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 22) { PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; ChosenSkin[playerid] = 118; SetPlayerSkin(playerid, 118); }
                        else if(PlayerInfo[InviteOffer[playerid]][pLider] == 23) { PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; ChosenSkin[playerid] = 112; SetPlayerSkin(playerid, 112); }
                        PlayerInfo[playerid][pMembro] = InviteJob[playerid];
                        PlayerInfo[playerid][pCargo] = 1;
                        SelectCharID[playerid] = PlayerInfo[playerid][pMembro];
                        new rand = random(sizeof(gInviteSpawns));
                        XXAirBreak[playerid] += 3;
                        XXAirBreak[playerid] += 3;SetPlayerPos(playerid, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
                        SetPlayerFacingAngle(playerid, gInviteSpawns[rand][3]);
                        SetPlayerCameraPos(playerid,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                        SetPlayerCameraLookAt(playerid,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
                        Controle(playerid, 0);
                        SelectChar[playerid] = 255;
                        SelectCharID[playerid] = PlayerInfo[playerid][pMembro];
                        SelectCharPlace[playerid] = 1;
                        PlayerInfo[playerid][pSkin] = ChosenSkin[playerid];
                        SetPlayerSkin(playerid, ChosenSkin[playerid]);
                        format(gstring, sizeof(gstring), "* Vocк foi convidado por %s para entrar para a org: %s, parabйns.", PlayerName(InviteOffer[playerid]), NomeORG(InviteOffer[playerid]));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
                        ConviteInfoOrg(PlayerName(playerid), InviteJob[playerid], 1);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "    O jogador que lhe convidou nгo estб conectado.");
                        return true;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "    Vocк nгo foi convidado para nenhuma organizaзгo.");
                    return true;
                }
            }
            else
            {
                return true;
            }
        }
        return true;
    }
Reply


Messages In This Thread
convite de sublider bugado - by bombomloko - 29.11.2013, 21:28

Forum Jump:


Users browsing this thread: 1 Guest(s)