/r no chat
#1

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

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;
            }
Reply
#3

Lucas Nicolas:
e necessario a stock de SendRadioMessage
Reply
#4

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);
            }
        }
    }
}
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)