[Ajuda] /promover pode mudar cargo de QUALQUER organizaзгo
#1

Cуdigo
pawn Код:
if(strcmp(cmd, "/promover", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Use: /Promover [ID/Nick] [Cargos (1-6)]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 6 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Cargos de 0 a 6!"); return 1; }
            if (PlayerInfo[playerid][pLider] >= 1)
            {
              if(IsPlayerConnected(para1))
              {
                if(para1 != INVALID_PLAYER_ID)
                {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pCargo] = level;
                        format(string, sizeof(string), "Vocк foi promovido pelo lнder %s", sendername);
                        SendClientMessage(para1, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "Vocк promoveu %s ao cargo %d.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo й um lнder!");
            }
        }
        return 1;
    }
Reply
#2

TALVEZ ISTO??



pawn Код:
if(strcmp(cmd, "/darcargo", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /darcargo [playerid/Parte-do-Nick] [Nъmero(1-6)]");
                return 1;
            }
            new para2;
            new level;
            para2 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 6 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "  Escolha um nъmero entre 1 e 6"); return 1; }
            if (PlayerInfo[playerid][pLeader] >= 1 && PlayerInfo[playerid][pLeader] == PlayerInfo[para2][pMember])
            {
              if(IsPlayerConnected(para2))
              {
                if(para2 != INVALID_PLAYER_ID)
                {
                        GetPlayerName(para2, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para2][pRank] = level;
                        format(string, sizeof(string), "* Vocк foi promovido a um novo cargo (%d) pelo lнder: %s", level, sendername);
                        SendClientMessage(para2, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* Vocк promoveu %s ao cargo %d.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                      if(PlayerInfo[playerid][pMember] == 6 && para2 != playerid){
                        if(level == 4){SetPlayerSkin(para2,269);PlayerInfo[para2][pModel] = 269;}
                        else if(level == 5){SetPlayerSkin(para2,271);PlayerInfo[para2][pModel] = 271;
                        }else{SetPlayerSkin(para2,105);PlayerInfo[para2][pModel] = 105;}
                        }
                        if(PlayerInfo[playerid][pMember] == 3 && para2 != playerid){
                        if(level == 3){SetPlayerSkin(para2,287);PlayerInfo[para2][pFarda] = 287;}
                        if(level == 4){SetPlayerSkin(para2,287);PlayerInfo[para2][pFarda] = 287;}
                        if(level == 2){SetPlayerSkin(para2,287);PlayerInfo[para2][pFarda] = 287;}
                        if(level == 1){SetPlayerSkin(para2,287);PlayerInfo[para2][pFarda] = 287;}
                        if(level == 5){SetPlayerSkin(para2,287);PlayerInfo[para2][pFarda] = 287;}
                        }
                        if(PlayerInfo[playerid][pMember] == 7 && para2 != playerid){
                        if(level == 1){SetPlayerSkin(para2,189);PlayerInfo[para2][pFarda] = 189;}
                        if(level == 2){SetPlayerSkin(para2,164);PlayerInfo[para2][pFarda] = 164;}
                        if(level == 3){SetPlayerSkin(para2,163);PlayerInfo[para2][pFarda] = 163;}
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  Vocк nгo estб autorizado a usar este comando (somente lнderes)");
            }
        }
        return 1;
    }
Reply
#3

sim andmeida pq ele tinha colocado >= o certo й criar um
pawn Код:
else if
para cada org.
Reply
#4

Quote:
Originally Posted by NathanLive
sim andmeida pq ele tinha colocado >= o certo й criar um
pawn Код:
else if
para cada org.
pode dar um exemplo?
Reply
#5

BUMP. ={
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)