[Ajuda] Comando vip
#1

Ola tenho um server RPG e gostaria de saber como fazer para o player ganhar score e VIP digitando um comando so uma vez ? pf me ajudem
Reply
#2

posta o comando que da vip para o player e o que da score tambem
Reply
#3

pawn Код:
if(strcmp(cmd, "/editar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new editarnome[MAX_PLAYER_NAME];
            new editarnome2[MAX_PLAYER_NAME];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                MSGPLAYER(playerid, COLOR_GRAD1, "USE: /editar [id] [STATUS] [QUANTIDADE]");
                MSGPLAYER(playerid, COLOR_GRAD4, "|1 Level |2 Morreu |3 Melhorar |4 Horas Jogadas ");
                MSGPLAYER(playerid, COLOR_GRAD3, "|5 Conta Do Banco |6 NumeroTelefone |7 Respeito ");
                MSGPLAYER(playerid, COLOR_GRAD2, "|8 ChaveCasa |9 ChaveEmpresa |10 VIP(3,4,5)");
                MSGPLAYER(playerid, COLOR_GRAD2, "|12 Detetive |13 Advogado |14 Mecвnico |15 Repуrter |16 L.Carros |17 V.Drogas");
                MSGPLAYER(playerid, COLOR_GRAD2, "|18 P.Sexo |19 Box |20 Emprego |21 Matou |24 Skill De Pesca");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                GetPlayerName(playerid,editarnome,sizeof(editarnome));
                GetPlayerName(giveplayerid,editarnome2,sizeof(editarnome2));
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        MSGPLAYER(playerid, COLOR_GRAD1, "USE: /editar [id] [STATUS] [QUANTIDADE]");
                        MSGPLAYER(playerid, COLOR_GRAD4, "|1 Level |2 Morreu |3 Melhorar |4 Horas Jogadas ");
                        MSGPLAYER(playerid, COLOR_GRAD3, "|5 Conta Do Banco |6 NumeroTelefone |7 Respeito ");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|8 ChaveCasa |9 ChaveEmpresa |10 VIP(3,4,5)");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|12 Detetive |13 Advogado |14 Mecвnico |15 Repуrter |16 L.Carros |17 V.Drogas");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|18 P.Sexo |19 Box |20 Emprego |21 Matou |24 Skill De Pesca");
                        return 1;
                    }
                    new stat;
                    stat = strval(tmp);
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        MSGPLAYER(playerid, COLOR_GRAD1, "USE: /editar [id] [STATUS] [QUANTIDADE]");
                        MSGPLAYER(playerid, COLOR_GRAD4, "|1 Level |2 Morreu |3 Melhorar |4 Horas Jogadas ");
                        MSGPLAYER(playerid, COLOR_GRAD3, "|5 Conta Do Banco |6 NumeroTelefone |7 Respeito ");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|8 ChaveCasa |9 ChaveEmpresa |10 VIP(3,4,5)");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|12 Detetive |13 Advogado |14 Mecвnico |15 Repуrter |16 L.Carros |17 V.Drogas");
                        MSGPLAYER(playerid, COLOR_GRAD2, "|18 P.Sexo |19 Box |20 Emprego |21 Matou |24 Skill De Pesca");
                        return 1;
                    }
                    new quantidade;
                    quantidade = strval(tmp);
                    if (PlayerInfo[playerid][pAdmin] >= 1337)
                    {
                        if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
                        {
                            MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/pa)");
                            return 1;
                        }
                        if(giveplayerid == playerid && PlayerInfo[playerid][pAdmin] != 1342)
                        {
                            MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo pode se editar");
                            return 1;
                        }
                        switch (stat)
                        {
                            case 1:
                            {
                                PlayerInfo[giveplayerid][pLevel] = quantidade;
                                format(string, sizeof(string), "   Vocк setou level %d para o jogador", quantidade);
                                ScoreLevel(giveplayerid);
                            }
                            case 2:
                            {
                                PlayerInfo[giveplayerid][pDeaths] = quantidade;
                                format(string, sizeof(string), "   Vocк setou %d vezes que ele morreu", quantidade);
                            }
                            case 3:
                            {
                                PlayerInfo[giveplayerid][gPupgrade] = quantidade;
                                format(string, sizeof(string), "   Vocк setou %d de pontos de melhoria", quantidade);
                            }
                            case 4:
                            {
                                PlayerInfo[giveplayerid][pConnectTime] = quantidade;
                                format(string, sizeof(string), "Vocк setou %d horas jogadas para o jogador", quantidade);
                                //format(string, sizeof(string), "   Desabilitado");
                            }
                            case 5:
                            {
                                PlayerInfo[giveplayerid][pConta] = quantidade;
                                format(string, sizeof(string), "   Vocк setou R$%d no banco do jogador", quantidade);
                                format(gstring, 128, "%s usou /editar banco em %s e setou %d", PlayerName(playerid), PlayerName(giveplayerid), quantidade);
                                PayLog(gstring);
                            }
                            case 6:
                            {
                                PlayerInfo[giveplayerid][pPnumber] = quantidade;
                                format(string, sizeof(string), "   Vocк setou o celular do jogador para %d", quantidade);
                            }
                            case 7:
                            {
                                PlayerInfo[giveplayerid][pExp] = quantidade;
                                format(string, sizeof(string), "   Vocк setou o respeito do jogador para %d", quantidade);
                            }
                            case 8:
                            {
                                PlayerInfo[giveplayerid][pPHousekey] = quantidade;
                                format(string, sizeof(string), "   Vocк setou a chave de casa pra %d", quantidade);
                            }
                            case 9:
                            {
                                PlayerInfo[giveplayerid][pPbiskey] = quantidade;
                                format(string, sizeof(string), "   Vocк setou a chave da empresa %d", quantidade);
                            }
                            case 10:
                            {
                                MSGPLAYER(playerid, COLOR_GRAD1, "Desabilitado!");
                                /*PlayerInfo[giveplayerid][pVIP] = quantidade;
                                format(string, sizeof(string), "   Vocк setou VIP %d para o jogador", quantidade);
                                getdate(year, month, day);
                                gettime(hour,minute);
                                format(string, sizeof(string), "%s deu vip ao %s nнvel %d ( %d/%d/%d - %d:%d)",editarnome,editarnome2,quantidade,year, month, day,hour, minute);
                                VipsLog(string);*/

                            }
                            case 11:
                            {
                                format(string, sizeof(string), "   esse status foi retirado", quantidade);
                            }
                            case 12:
                            {
                                PlayerInfo[giveplayerid][pDetSkill] = quantidade;
                                format(string, sizeof(string), "   Vocк setou nivel de detetive para: %d", quantidade);
                            }
                            case 13:
                            {
                                PlayerInfo[giveplayerid][pLawSkill] = quantidade;
                                format(string, sizeof(string), "   Vocк setou nivel de advogado para: %d", quantidade);
                            }
                            case 14:
                            {
                                PlayerInfo[giveplayerid][pMechSkill] = quantidade;
                                format(string, sizeof(string), "   Vocк setou nivel de mecanico para: %d", quantidade);
                            }
                            case 15:
                            {
                                PlayerInfo[giveplayerid][pNewsSkill] = quantidade;
                                format(string, sizeof(string), "   The Player News Reporter Skill Set To %d", quantidade);
                            }
                            case 17:
                            {
                                PlayerInfo[giveplayerid][pDrogasSkill] = quantidade;
                                format(string, sizeof(string), "   Vocк setou a Skill de Drogas para: %d", quantidade);
                            }
                            case 18:
                            {
                                PlayerInfo[giveplayerid][pSexSkill] = quantidade;
                                format(string, sizeof(string), "  Vocк setou a Skill de P.Sexo para: %d", quantidade);
                            }
                            case 19:
                            {
                                PlayerInfo[giveplayerid][pBoxSkill] = quantidade;
                                format(string, sizeof(string), "   The Player Box Skill Set To %d", quantidade);
                            }
                            case 21:
                            {
                                PlayerInfo[giveplayerid][pKills] = quantidade;
                                format(string, sizeof(string), "   Vocк setou %d vezes que ele matou alguйm", quantidade);
                            }
                            case 22:
                            {
                                PlayerInfo[giveplayerid][pContractTime] = quantidade;
                                format(string, sizeof(string), "   Vocк setou o tempo de contrato para: %d", quantidade);
                            }
                            case 23:
                            {
                            }
                            case 24:
                            {
                                PlayerInfo[giveplayerid][pFishSkill] = quantidade;
                                format(string, sizeof(string), "   Vocк setou a Skill de Pescar para: %d", quantidade);
                            }
                            default:
                            {
                                format(string, sizeof(string), "   Codigo Invalido", quantidade);
                            }

                        }
                        MSGPLAYER(playerid, COLOR_GRAD1, string);
                    }
                    else
                    {
                        MSGPLAYER(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
                    }
                }//not valid id
            }//not connected
        }
        return 1;
    }

//--------------------------------------
if(strcmp(cmd, "/darvip", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1342)
            {
                MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
                return 1;
            }
            VipVaga();
            if(VagaSobrando == 0)
            {
                MSGPLAYER(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvip primeiro.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                MSGPLAYER(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                MSGPLAYER(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel]");
                return 1;
            }
            level = strval(tmp);
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                    format(string, sizeof string, "Vocк deu VIP Nнvel %d para %s", level, giveplayer);
                    MSGPLAYER(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof string, "Vocк ganhou VIP Nнvel %d do admin %s", level, sendername);
                    MSGPLAYER(para1, COLOR_LIGHTBLUE, string);
                    getdate(year, month, day);
                    gettime(hour,minute,second);
                    format(string, sizeof(string), "%s deu vip ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,day, month, year,hour, minute);
                    VipsLog(string);
                    PlayerInfo[para1][pVIP] = level;
                    new var03 = 0;
                    for(new i = 0; i < sizeof(VipInfo); i++)
                    {
                        if(strcmp(giveplayer,VipInfo[i][vNick],true)==0)
                        {
                            VipInfo[i][vTipo] = level;
                            SaveVip();
                            var03 = 1;
                            break;
                        }
                    }
                    if(var03 == 0)
                    {
                        for(new i = 0; i < sizeof(VipInfo); i++)
                        {
                            if(strcmp("Ninguem",VipInfo[i][vNick],true)==0)
                            {
                                strmid(VipInfo[i][vNick], giveplayer, 0, strlen(giveplayer), 255);
                                VipInfo[i][vTipo] = level;
                                SaveVip();
                                break;
                            }
                        }
                    }
                }
            }
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)