[ajuda] Como dar leader a alguma ORG
#1

Boas pessoal !

De novo com uma duvida, uso um sistema muito simples para o meu GM de equipas vou mostrar.

pawn Код:
public SetPlayerTeamFromClass(playerid,classid)
{
    if(classid == 0 ) {
        gTeam[playerid] = TEAM_desempregados;
    } else if(classid == 1) {
        gTeam[playerid] = TEAM_grove;
    } else if(classid == 2 ) {
        gTeam[playerid] = TEAM_MEDICOS;
    } else if(classid == 3 ) {
        gTeam[playerid] = TEAM_POLICIA;
    } else if(classid == 4 ) {
        gTeam[playerid] = TEAM_mecanicos;
    } else if(classid == 5 ) {
        gTeam[playerid] = TEAM_Russian_Mafia;
    } else if(classid == 6 ) {
        gTeam[playerid] = TEAM_GOVERNO;
    } else if(classid == 7 ) {
        gTeam[playerid] = TEAM_TAXI;
    } else if(classid == 8 ) {
        gTeam[playerid] = TEAM_EXERCITO;
    } else if(classid == 9 ) {
        gTeam[playerid] = TEAM_TUNNING;
    }
}
pawn Код:
public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == TEAM_desempregados) {
        SetPlayerColor(playerid,TEAM_desempregados_COLOR); //
    } else if(gTeam[playerid] == TEAM_grove) {
        SetPlayerColor(playerid,TEAM_grove_COLOR); //
    } else if(gTeam[playerid] == TEAM_MEDICOS) {
        SetPlayerColor(playerid,TEAM_MEDICOS_COLOR); //
    } else if(gTeam[playerid] == TEAM_POLICIA) {
        SetPlayerColor(playerid,TEAM_POLICIA_COLOR); //
    } else if(gTeam[playerid] == TEAM_mecanicos) {
        SetPlayerColor(playerid,TEAM_mecanicos_COLOR); //
    } else if(gTeam[playerid] == TEAM_Russian_Mafia) {
        SetPlayerColor(playerid,TEAM_Russian_Mafia_COLOR); //
    } else if(gTeam[playerid] == TEAM_GOVERNO) {
        SetPlayerColor(playerid,TEAM_GOVERNO_COLOR); //
    } else if(gTeam[playerid] == TEAM_TAXI) {
        SetPlayerColor(playerid,TEAM_TAXI_COLOR); //
    } else if(gTeam[playerid] == TEAM_EXERCITO) {
        SetPlayerColor(playerid,TEAM_EXERCITO_COLOR); //
    } else if(gTeam[playerid] == TEAM_TUNNING) {
        SetPlayerColor(playerid,TEAM_TUNNING_COLOR); //
    }
}
O meu pedido:

- Alguem me ensina como eu posso criar um Leader para cada org ? e cada vez que ele logasse aparecia uma mensagem para todos a dizer que o tal jogador era o leader da org tal !
Reply
#2

pode usar esse comando:

no inicio do gm botar:
pawn Код:
enum pInfo:
{
   pLeader
};
pawn Код:
if(strcmp(cmd,"/darlider", true) == 0)
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo й administrador!!!!!");

new tmp[24], idx; tmp = strtok(params, idx);
        if(!strlen(tmp))
                return SendClientMessage(playerid, COLOR_GREY, "[USO] /darlider [id/nick] [Number(1-10)]");

if(level > 10 || level < 0)
            return SendClientMessage(playerid, COLOR_RED,"[ERRO] Nъmeros entre 1 e 10")

 if(IsPlayerConnected(giveid))
        {
            if(giveid != INVALID_PLAYER_ID)
            {
                if(Player[giveid][pMember] != 0)
                    return SendClientMessage(playerid, COLOR_LIGHTBLUE, "O jogador jб tem uma profissгo.");

                Player[giveid][pLeader] = level;
                if(Player[giveid][pAdmin] < 6)
                {
                    format(thestring, sizeof(thestring), "%s lhe lider", Player[playerid][pName]);
                    SendClientMessage(giveid, COLOR_LIGHTBLUE, thestring);
                    format(thestring, sizeof(thestring), "%s й o novo lнder administrativo da ORG %s (%d).", Player[giveid][pName], OrgsNames[level], level);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, thestring);
                    new org[128];

                    if(strcmp(dini_Get(org,OrgsCargos[0]),"Nenhum",true)!=0)
                        return SendClientMessage(playerid, COLOR_LIGHTBLUE, "A profissгo jб possui um lнder.");

if(level == 0) { Player[giveid][pChar] = 23; DelMembro(giveid); }
                    else if(level == 1) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder na NOME DA ORG"); Player[giveid][pChar] = 265; gTeam[giveid] = 2;}
                    else if(level == 2) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder no NOME DA ORG "); Player[giveid][pChar] = 286; gTeam[giveid] = 2; }
                    else if(level == 3) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder no NOME DA ORG ."); Player[giveid][pChar] = 287; gTeam[giveid] = 2;}
                    else if(level == 4) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder nos NOME DA ORG."); Player[giveid][pChar] = 279; gTeam[giveid] = 4;}
                    else if(level == 5) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder nos NOME DA ORG."); Player[giveid][pChar] = 104; gTeam[giveid] = 7;}
                    else if(level == 6) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder na NOME DA ORG."); Player[giveid][pChar] = 270; gTeam[giveid] = 7;}
                    else if(level == 7) { SendClientMessageToAll(COLOR_PREF, "Hб um novo lider nos NOME DA ORG ."); Player[giveid][pChar] = 147; gTeam[giveid] = 8;}
                    else if(level == 8) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder nos NOME DA ORG"); Player[giveid][pChar] = 165; gTeam[giveid] = 8;}
                    else if(level == 9) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder nos NOME DA ORG."); Player[giveid][pChar] = 185; gTeam[giveid] = 9;}
                    else if(level == 10) { SendClientMessageToAll(COLOR_NOME DA ORG, "Hб um novo lнder nos NOME DA ORG"); Player[giveid][pChar] = 47; gTeam[giveid] = 47;}

}
                Player[giveid][pMember] = level;
                Player[giveid][pRank] = 6;
                Player[giveid][pTeam] = gTeam[giveid];
                Player[giveid][pModel] = Player[giveid][pChar];
                SetPlayerSkin(giveid, Player[giveid][pChar]);
                SetPlayerToTeamColor(giveid);
                if(Player[giveid][pAdmin] < 7)
                    AddMembro(giveid);
            }
        }
        else
            SendClientMessage(playerid, COLOR_RED, "[ERRO] Jogador nгo encontrado.");

        return 1;
    }
Vai na public OnPlayerConnect, para cada vez que um lider logar aparecer uma mensagem.

pawn Код:
public OnPlayerConnect(playerid)

PS: Desculpe se estб mal organizado mas no fуrum й muito dificil.
Reply
#3

pawn Код:
#define LIDER_TEAM_GROVE 10
Como setar o cara para lider:

pawn Код:
gTeam[playerid] = LIDER_TEAM_GROVE;
Agora para aparecer a mensagem, coloca na CallBack OnPlayerConnect:
pawn Код:
if(gTeam[playerid] == LIDER_TEAM_GROVE)
{
    new msg[40], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    format(msg,sizeof(msg),"* O lider da grove %s conectou no servidor.", Name);
    SendClientMessageToAll(-1,msg);
}
Obs: Isso foi sу um exemplo para vocк ver como se faz.
ObsІ: Para que a mensagem apareзa vocк deve configurб-la com seu sistema de salvamento.
Reply
#4

Nao percebi muito bem como posso salvar o jogador leader
Reply
#5

Quote:
Originally Posted by Rick_DR
Посмотреть сообщение
Nao percebi muito bem como posso salvar o jogador leader
Por scriptfile...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)