SA-MP Forums Archive
/r no 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: /r no chat (/showthread.php?tid=186985)



/r no chat - marinov - 31.10.2010

como eu faзo um /r [texto] q soh da pra um time ler as mensagens ?


Re: /r no chat - Macintosh - 31.10.2010

pawn Код:
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            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))
            {
                SendClientMessage(playerid, COLOR_R, "USE: (/r)adio [radio chat]");
                return 1;
            }
            if(PlayerInfo[playerid][pMembro] == 1 || PlayerInfo[playerid][pLider] == 1)
            {
                if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "** Comandante %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "** Capitгo %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "** Tenente %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "** Sargento %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "** Cabo %s: %s, over. **", sendername, result); }
                else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "** Guarda de Trвnsito %s: %s, over. **", sendername, result); }
                else
                {
                    format(string, sizeof(string), "** Guarda %s: %s, over. **", sendername, result);
                }
                SendRadioMessage(1,COLOR_R,string);
                printf("%s", string);
                return 1;
            }



Respuesta: /r no chat - BiieL - 31.10.2010

Lucas Nicolas:
e necessario a stock de SendRadioMessage


Re: Respuesta: /r no chat - jonas_gabriel - 31.10.2010

Quote:
Originally Posted by BiieL
Посмотреть сообщение
Lucas Nicolas:
e necessario a stock de SendRadioMessage
pode ser uma public tambйm.

topo do gm

Код:
forward SendRadioMessage(member, COLOR, string[]);
crie a public

pawn Код:
public SendRadioMessage(member, COLOR, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pMembro] == member || PlayerInfo[i][pLider] == member)
            {
                SendClientMessage(i, COLOR, string);
            }
        }
    }
}



Re: /r no chat - TiagoPS - 31.10.2010

gente esse topico й igual o meu que eu fiz faz tres dias mas n responderam
como faz para simplesmente getar o texto que escreve em um comando eu n to conseguindo fazer
queria um geiro simples