[Ajuda] Sistema de Patentes por Score/gangue
#1

Olб, estou tendo uns probleminhas para criar um sistema de patentes por gangue/score exemplo:


Player com 500 score й ranking 14 e sua patente й: General "Dentro da sua gangue"

gostaria de saber como fasso para exibir estes nъmeros e nomes no chat global e no cmd /meuranking ou se possнvel em uma textdraw exemplo:

Sua patente: General
Ranking: 14



poderiam me ajudar? Tentei fazer da seguinte maneira:


pawn Код:
new CargoTerrorista[MAX_PLAYERS];

COMMAND:meucargo(playerid, params[])
{
    new String[24];
    format(String, sizeof(String),"Seu Cargo: %d", CargoTerrorista);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    return true;
}

new CargoTerrorista[MAX_PLAYERS];

stock GetCargoTerrorista(playerid)
{
    new CargoNomeT[20];

    if(CargoTerrorista[playerid] == 1) { CargoNomeT = "Lider Israelita"; }
    if(CargoTerrorista[playerid] == 2) { CargoNomeT = "Sub-Lider Israelita"; }
    if(CargoTerrorista[playerid] == 3) { CargoNomeT = "General Israelita"; }
    if(CargoTerrorista[playerid] == 4) { CargoNomeT = "Comandante"; }
    if(CargoTerrorista[playerid] == 5) { CargoNomeT = "Chefe de Armamento"; }
    if(CargoTerrorista[playerid] == 6) { CargoNomeT = "Comandante da Tropa"; }
    if(CargoTerrorista[playerid] == 7) { CargoNomeT = "Atirador Preciso"; }
    if(CargoTerrorista[playerid] == 8) { CargoNomeT = "Bombardeador"; }
    if(CargoTerrorista[playerid] == 9) { CargoNomeT = "Treinador Militar"; }
    if(CargoTerrorista[playerid] == 10) { CargoNomeT = "Espiao Israelita"; }
    if(CargoTerrorista[playerid] == 11) { CargoNomeT = "Homem-Bomba"; }
    if(CargoTerrorista[playerid] == 12) { CargoNomeT = "Atirador Expert"; }
    if(CargoTerrorista[playerid] == 13) { CargoNomeT = "Atirador"; }
    if(CargoTerrorista[playerid] == 14) { CargoNomeT = "Atirador Novato"; }
    if(CargoTerrorista[playerid] == 15) { CargoNomeT = "Terrorista Classe A"; }
    if(CargoTerrorista[playerid] == 16) { CargoNomeT = "Terrorista Classe B"; }
    if(CargoTerrorista[playerid] == 17) { CargoNomeT = "Terrorista Classe C"; }

    return CargoNomeT;
}


    if(PlayerInfo[playerid][gTeam] == Terrorista)
    {


        if(PlayerInfo[playerid][Score] >= 0 && PlayerInfo[playerid][Score] <= 5)
        {


            CargoTerrorista[playerid] = 17;
        }
        if(PlayerInfo[playerid][Score] >= 5 && PlayerInfo[playerid][Score] <= 25)
        {


            CargoTerrorista[playerid] = 16;
        }
        if(PlayerInfo[playerid][Score] >= 25 && PlayerInfo[playerid][Score] <= 50)
        {


            CargoTerrorista[playerid] = 15;
        }
        if(PlayerInfo[playerid][Score] >= 50 && PlayerInfo[playerid][Score] <= 100)
        {


            CargoTerrorista[playerid] = 14;
        }
        if(PlayerInfo[playerid][Score] >= 100 && PlayerInfo[playerid][Score] <= 200)
        {


            CargoTerrorista[playerid] = 13;
        }
        if(PlayerInfo[playerid][Score] >= 200 && PlayerInfo[playerid][Score] <= 300)
        {


            CargoTerrorista[playerid] = 12;
        }
        if(PlayerInfo[playerid][Score] >= 300 && PlayerInfo[playerid][Score] <= 400)
        {


            CargoTerrorista[playerid] = 11;
        }
        if(PlayerInfo[playerid][Score] >= 400 && PlayerInfo[playerid][Score] <= 500)
        {


            CargoTerrorista[playerid] = 10;
        }
        if(PlayerInfo[playerid][Score] >= 500 && PlayerInfo[playerid][Score] <= 600)
        {


            CargoTerrorista[playerid] = 9;
        }
        if(PlayerInfo[playerid][Score] >= 600 && PlayerInfo[playerid][Score] <= 700)
        {


            CargoTerrorista[playerid] = 8;
        }
        if(PlayerInfo[playerid][Score] >= 700 && PlayerInfo[playerid][Score] <= 800)
        {


            CargoTerrorista[playerid] = 7;
        }
        if(PlayerInfo[playerid][Score] >= 800 && PlayerInfo[playerid][Score] <= 900)
        {


            CargoTerrorista[playerid] = 6;
        }
        if(PlayerInfo[playerid][Score] >= 900 && PlayerInfo[playerid][Score] <= 1000)
        {


            CargoTerrorista[playerid] = 5;
        }
        if(PlayerInfo[playerid][Score] >= 1000 && PlayerInfo[playerid][Score] <= 1100)
        {


            CargoTerrorista[playerid] = 4;
        }
        if(PlayerInfo[playerid][Score] >= 1100 && PlayerInfo[playerid][Score] <= 1200)
        {


            CargoTerrorista[playerid] = 3;
        }
        if(PlayerInfo[playerid][Score] >= 1200 && PlayerInfo[playerid][Score] <= 1400)
        {


            CargoTerrorista[playerid] = 2;
        }
        if(PlayerInfo[playerid][Score] >= 1400)
        {


            CargoTerrorista[playerid] = 1;
        }
    }

Poderiam me ajudar?
Reply
#2

Utiliza switch e bem melhor.

Assim deve funcionar
pawn Код:
new CargoTerrorista[MAX_PLAYERS];

COMMAND:meucargo(playerid, params[])
{
    new String[24];
    format(String, sizeof(String),"Seu Cargo: %d", CargoTerrorista[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    return true;
}

stock GetCargoTerrorista(playerid)
{
    new CargoNomeT[100];

    if(CargoTerrorista[playerid] == 1)  CargoNomeT = "Lider Israelita";
    if(CargoTerrorista[playerid] == 2)  CargoNomeT = "Sub-Lider Israelita";
    if(CargoTerrorista[playerid] == 3)  CargoNomeT = "General Israelita";
    if(CargoTerrorista[playerid] == 4)  CargoNomeT = "Comandante";
    if(CargoTerrorista[playerid] == 5)  CargoNomeT = "Chefe de Armamento";
    if(CargoTerrorista[playerid] == 6)  CargoNomeT = "Comandante da Tropa";
    if(CargoTerrorista[playerid] == 7)  CargoNomeT = "Atirador Preciso";
    if(CargoTerrorista[playerid] == 8)  CargoNomeT = "Bombardeador";
    if(CargoTerrorista[playerid] == 9)  CargoNomeT = "Treinador Militar";
    if(CargoTerrorista[playerid] == 10)  CargoNomeT = "Espiao Israelita";
    if(CargoTerrorista[playerid] == 11)  CargoNomeT = "Homem-Bomba";
    if(CargoTerrorista[playerid] == 12)  CargoNomeT = "Atirador Expert";
    if(CargoTerrorista[playerid] == 13)  CargoNomeT = "Atirador";
    if(CargoTerrorista[playerid] == 14)  CargoNomeT = "Atirador Novato";
    if(CargoTerrorista[playerid] == 15)  CargoNomeT = "Terrorista Classe A";
    if(CargoTerrorista[playerid] == 16)  CargoNomeT = "Terrorista Classe B";
    if(CargoTerrorista[playerid] == 17)  CargoNomeT = "Terrorista Classe C";

    return CargoNomeT;
}
Reply
#3

Uma dъvida, utilizando desta forma que vocк me passou ai Tito, eu poderia adicionar no cmd /meucargo a var CargoNomeT?
Reply
#4

Tente:

Код:
new CargoTerrorista[MAX_PLAYERS];

CMD:myrank(playerid, params[])
{
    new String[30];
    format(String, sizeof(String),"Seu Cargo: %s", CargoTerrorista[playerid]);
    SendClientMessage(playerid, 0x1E90FFAA,String);
    return true;
}

stock GetCargoTerrorista(playerid)
{
    new CargoNomeT[100];

    if(CargoTerrorista[playerid] == 1)  CargoNomeT = "Lider Israelita";
    if(CargoTerrorista[playerid] == 2)  CargoNomeT = "Sub-Lider Israelita";
    if(CargoTerrorista[playerid] == 3)  CargoNomeT = "General Israelita";
    if(CargoTerrorista[playerid] == 4)  CargoNomeT = "Comandante";
    if(CargoTerrorista[playerid] == 5)  CargoNomeT = "Chefe de Armamento";
    if(CargoTerrorista[playerid] == 6)  CargoNomeT = "Comandante da Tropa";
    if(CargoTerrorista[playerid] == 7)  CargoNomeT = "Atirador Preciso";
    if(CargoTerrorista[playerid] == 8)  CargoNomeT = "Bombardeador";
    if(CargoTerrorista[playerid] == 9)  CargoNomeT = "Treinador Militar";
    if(CargoTerrorista[playerid] == 10)  CargoNomeT = "Espiao Israelita";
    if(CargoTerrorista[playerid] == 11)  CargoNomeT = "Homem-Bomba";
    if(CargoTerrorista[playerid] == 12)  CargoNomeT = "Atirador Expert";
    if(CargoTerrorista[playerid] == 13)  CargoNomeT = "Atirador";
    if(CargoTerrorista[playerid] == 14)  CargoNomeT = "Atirador Novato";
    if(CargoTerrorista[playerid] == 15)  CargoNomeT = "Terrorista Classe A";
    if(CargoTerrorista[playerid] == 16)  CargoNomeT = "Terrorista Classe B";
    if(CargoTerrorista[playerid] == 17)  CargoNomeT = "Terrorista Classe C";

    return 1;
}
Reply
#5

Quote:
Originally Posted by focaximubh
Посмотреть сообщение
Uma dъvida, utilizando desta forma que vocк me passou ai Tito, eu poderia adicionar no cmd /meucargo a var CargoNomeT?
Pode sim, contanto que crie alguma funзгo que use ela, pra nгo dar warning.


Quote:
Originally Posted by BieeelEvolution
Посмотреть сообщение
Nгo seria %s envez de %d ?
No caso ele fez pra dizer com o nъmero do cargo, ex: Cargo: 5.
Reply
#6

Existe alguma forma de eu fazer para quando eu digitar /meucargo ele falasse por exemplo:

Seu cargo: 14 [General]? acredito que seria mais fбcil
Reply
#7

pawn Код:
new CargoTerrorista[MAX_PLAYERS];

CMD:myrank(playerid) {
    new String[30];
    format(String, sizeof(String),"Seu Cargo: %d [%s]", CargoTerrorista[playerid], GetCargoTerrorista(playerid));
    SendClientMessage(playerid, 0x1E90FFAA,String);
    return true;
}

stock GetCargoTerrorista(playerid) {
    new CargoNomeT[100];
    if(CargoTerrorista[playerid] == 1)  CargoNomeT = "Lider Israelita";
    if(CargoTerrorista[playerid] == 2)  CargoNomeT = "Sub-Lider Israelita";
    if(CargoTerrorista[playerid] == 3)  CargoNomeT = "General Israelita";
    if(CargoTerrorista[playerid] == 4)  CargoNomeT = "Comandante";
    if(CargoTerrorista[playerid] == 5)  CargoNomeT = "Chefe de Armamento";
    if(CargoTerrorista[playerid] == 6)  CargoNomeT = "Comandante da Tropa";
    if(CargoTerrorista[playerid] == 7)  CargoNomeT = "Atirador Preciso";
    if(CargoTerrorista[playerid] == 8)  CargoNomeT = "Bombardeador";
    if(CargoTerrorista[playerid] == 9)  CargoNomeT = "Treinador Militar";
    if(CargoTerrorista[playerid] == 10)  CargoNomeT = "Espiao Israelita";
    if(CargoTerrorista[playerid] == 11)  CargoNomeT = "Homem-Bomba";
    if(CargoTerrorista[playerid] == 12)  CargoNomeT = "Atirador Expert";
    if(CargoTerrorista[playerid] == 13)  CargoNomeT = "Atirador";
    if(CargoTerrorista[playerid] == 14)  CargoNomeT = "Atirador Novato";
    if(CargoTerrorista[playerid] == 15)  CargoNomeT = "Terrorista Classe A";
    if(CargoTerrorista[playerid] == 16)  CargoNomeT = "Terrorista Classe B";
    if(CargoTerrorista[playerid] == 17)  CargoNomeT = "Terrorista Classe C";
    return CargoNomeT;
}
Reply
#8

Quote:
Originally Posted by iHarzard
Посмотреть сообщение
pawn Код:
new CargoTerrorista[MAX_PLAYERS];

CMD:myrank(playerid) {
    new String[30];
    format(String, sizeof(String),"Seu Cargo: %d [%s]", CargoTerrorista[playerid], GetCargoTerrorista(playerid));
    SendClientMessage(playerid, 0x1E90FFAA,String);
    return true;
}

stock GetCargoTerrorista(playerid) {
    new CargoNomeT[100];
    if(CargoTerrorista[playerid] == 1)  CargoNomeT = "Lider Israelita";
    if(CargoTerrorista[playerid] == 2)  CargoNomeT = "Sub-Lider Israelita";
    if(CargoTerrorista[playerid] == 3)  CargoNomeT = "General Israelita";
    if(CargoTerrorista[playerid] == 4)  CargoNomeT = "Comandante";
    if(CargoTerrorista[playerid] == 5)  CargoNomeT = "Chefe de Armamento";
    if(CargoTerrorista[playerid] == 6)  CargoNomeT = "Comandante da Tropa";
    if(CargoTerrorista[playerid] == 7)  CargoNomeT = "Atirador Preciso";
    if(CargoTerrorista[playerid] == 8)  CargoNomeT = "Bombardeador";
    if(CargoTerrorista[playerid] == 9)  CargoNomeT = "Treinador Militar";
    if(CargoTerrorista[playerid] == 10)  CargoNomeT = "Espiao Israelita";
    if(CargoTerrorista[playerid] == 11)  CargoNomeT = "Homem-Bomba";
    if(CargoTerrorista[playerid] == 12)  CargoNomeT = "Atirador Expert";
    if(CargoTerrorista[playerid] == 13)  CargoNomeT = "Atirador";
    if(CargoTerrorista[playerid] == 14)  CargoNomeT = "Atirador Novato";
    if(CargoTerrorista[playerid] == 15)  CargoNomeT = "Terrorista Classe A";
    if(CargoTerrorista[playerid] == 16)  CargoNomeT = "Terrorista Classe B";
    if(CargoTerrorista[playerid] == 17)  CargoNomeT = "Terrorista Classe C";
    return CargoNomeT;
}
Looool parece que estб funcionando apenas mudar o string ali para 50 pq ele fica [Terrorista Cla... mas parece estar funcional, obrigado mano ++Rep a todos que ajudaram ai vlw

Uma dъvida..... Como seria para fazer o seguinte:

o player atinge 1400 Score assim atingindo o cargo mбximo, mas qd alguйm atingir 14001 o cargo mбximo serб setado a pessoa que estб com maior score e a outra perde um cargo se tornando cargo 2 por exemplo com 1400 scores e assim sucessivamente....
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)