SA-MP Forums Archive
[Ajuda] Tv e chat. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Tv e chat. (/showthread.php?tid=402891)



Tv e chat. - Mteck - 28.12.2012

pawn Код:
if(strcmp(cmd, "/a", true) == 0 || strcmp(cmd, "/chat", true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando!");
        GetPlayerName(playerid, sendername, sizeof(sendername));
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[64];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result)) return SendClientMessage(playerid,-1,"Use:{FFFFFF} /a [Texto]");
        format(string, sizeof(string), "{FF4500}%s diz: {FFFFE0}%s", sendername,tmp);
        ChatAdmin(-1, string);
        return 1;
    }
Como faзo pra tirar da rcon? esse cod nem na rcon ta funfando oque tens de errado?
Tipo, com o nнvel 5 e 6 as cores no chat diferenciadas dos nнveis abaixo.

pawn Код:
if(strcmp(cmd, "/espiar", true) == 0 || strcmp(cmd, "/tv", true) == 0)
    {

        GetPlayerName(playerid, nome, sizeof nome);
        if(PlayerInfo[playerid][Level] >= 1)
        {
           tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
           {
               SendClientMessage(playerid, COLOR_WHITE, "[ADMIN] /TV  [playerid/Parte-do-Nick]");
               return 1;
           }
           if(!IsPlayerConnected(playerid))
           {
               SendClientMessage(playerid, COLOR_GREY, "    Jogador nгo conectado");
               return 1;
           }
           if(playerid == playerid)
           {
              SendClientMessage(playerid, COLOR_GREY, "    Nгo й possнvel se espiar.");
              return 1;
           }
           if(IsPlayerInAnyVehicle(playerid))
           {
               GetPlayerName(playerid, nome, sizeof(nome));
               format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)",playerid);
               SendClientMessage(playerid, COLOR_WHITE, string);
               TogglePlayerSpectating(playerid, 1);
               PlayerSpectateVehicle(playerid, GetPlayerVehicleID(playerid), SPECTATE_MODE_NORMAL);
               Espiando[playerid] = 1;
               return 1;
           }
           else
           {
               format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)",playerid);
               SendClientMessage(playerid, COLOR_WHITE, string);
               TogglePlayerSpectating(playerid, 1);
               PlayerSpectatePlayer(playerid, playerid, SPECTATE_MODE_NORMAL);
               Espiando[playerid] = 1;
           }
        }
        return 1;
    }
estб correto?


Re: Tv e chat. - Don_Speed - 28.12.2012

pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando!");
Isso ai e da rcon!



Re: Tv e chat. - Mteck - 28.12.2012

Don, o chat nгo estб funfando, vocк digita algo e ele nгo aparece (quando estou logado na rcon)


Код HTML:
 if(PlayerInfo[playerid][Level] >= 1)
Йra sу mudar isso e.e kk


Re: Tv e chat. - paulor - 28.12.2012

pawn Код:
if(strcmp(cmd, "/espiar", true) == 0 || strcmp(cmd, "/tv", true) == 0)
{
    if(PlayerInfo[playerid][Level] >= 1)
    {
       tmp = strtok(cmdtext, idx);
       if(!strlen(tmp))
       {
           SendClientMessage(playerid, COLOR_WHITE, "[ADMIN] /TV  [playerid/Parte-do-Nick]");
           return 1;
       }
       new give = ReturnUser(tmp);
       if(!IsPlayerConnected(give))
       {
           SendClientMessage(playerid, COLOR_GREY, "    Jogador nгo conectado");
           return 1;
       }
       if(give == playerid)
       {
          SendClientMessage(playerid, COLOR_GREY, "    Nгo й possнvel se espiar.");
          return 1;
       }
       GetPlayerName(give, nome, sizeof(nome));
       format(string, sizeof(string), "Vocк estб espiando %s (ID: %d)",nome, give);
       SendClientMessage(playerid, COLOR_WHITE, string);
       if(IsPlayerInAnyVehicle(give))
       {
           TogglePlayerSpectating(playerid, 1);
           PlayerSpectateVehicle(playerid, GetPlayerVehicleID(give), SPECTATE_MODE_NORMAL);
           Espiando[playerid] = 1;
       }
       else
       {
           TogglePlayerSpectating(playerid, 1);
           PlayerSpectatePlayer(playerid, give, SPECTATE_MODE_NORMAL);
           Espiando[playerid] = 1;
       }
    }
    return 1;
}
Nгo entendi a 1° duvida, somente tirar o Adm rcon ?


Re: Tv e chat. - Mteck - 28.12.2012

Sim, era sу retirar do Adminrcon, obrigado. rep+


@Edit, Paulo nгo esta pegando o /a ;/