[DUV]Profissao
#2

algo como isto


no OnPlayerCommandText
pawn Код:
if(strcmp(cmd, "/tornarlider", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COR_CINZA, "USE: /tornarlider [ID/Nome do Jugador] [Numeros(1-2)]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(level > 2 || level < 0) { SendClientMessage(playerid, COR_CINZA, "Nгo vб abaixo do nъmero 0, ou acima nъmero de 2!"); return 1; }//Mudar no caso de colocar mais
            if (PlayerInfo[playerid][pAdmin] >= 5)//Define nivel de admin
            {
              if(IsPlayerConnected(para1))
              {
                if(para1 != INVALID_PLAYER_ID)
                {
                  if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
                  {
                    SendClientMessage(playerid, COR_CINZA, "Esse jogador jб tem uma profissгo!");
                    return 1;
                  }
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pLeader] = level;
                        PlayerInfo[para1][pTeam] = level;
                        PlayerInfo[para1][pMember] = level;
                        if(level == 1)
                        {
                          format(string, sizeof(string), "Vocк foi colocado como traficante de droga por %s", sendername);
                            SendClientMessage(para1, COR_AZUL, string);
                            Profissao[playerid]=1;//Coloca na proifissгo 1
                                             SetPlayerSkin(playerid, 277);//Define a skin do player

                        }
                        else if(level == 2)
                        {
                          format(string, sizeof(string), "Vocк foi colocado como traficante de armas por %s", sendername);
                            SendClientMessage(para1, COR_AZUL, string);
                            Profissao[playerid]=2;//Coloca na proifissгo 2
                                             SetPlayerSkin(playerid, 277);//Define a skin do player
                        }
                    }
                }//nгo conectado
            }
            else
            {
                SendClientMessage(playerid, COR_CINZA, "Vocк nгo estб autorizado a usar esse comando!");
            }
        }
        return 1;
    }
acho eu ...

[EDIT] Atualizado. Obrigado SuB_ZeRo0_
Reply


Messages In This Thread
[DUV]Profissao - by lucas_loky - 20.05.2010, 21:15
Re: [DUV]Profissao - by DartakousLien - 20.05.2010, 22:05
Re: [DUV]Profissao - by SuB_ZeRo0_ - 20.05.2010, 22:30
Re: [DUV]Profissao - by russo666 - 20.05.2010, 22:43
Re: [DUV]Profissao - by lucas_loky - 21.05.2010, 00:23
Re: [DUV]Profissao - by russo666 - 21.05.2010, 00:28
Re: [DUV]Profissao - by lucas_loky - 21.05.2010, 00:30
Re: [DUV]Profissao - by russo666 - 21.05.2010, 01:03
Re: [DUV]Profissao - by andmeida10 - 21.05.2010, 12:00
Re: [DUV]Profissao - by russo666 - 21.05.2010, 12:37

Forum Jump:


Users browsing this thread: 1 Guest(s)