[Ajuda] /anuncio
#1

alguem tem o codigo do /anuncio para me passar nao acho aki no forum!!!
Reply
#2

pawn Код:
if(strcmp(cmdtext,"/anuncio",true) == 0 || strcmp(cmdtext,"/an",true) == 0)
{
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
        idx++;
    }
    new offset = idx;
    new result[256];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
       result[idx - offset] = cmdtext[idx];
          idx++;
    }
    if(!strlen(result))
    {
        SendClientMessage(playerid,BRANCO,"Use /(AN)uncio [Texto]");
    return 1;
    }
    new string[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string,sizeof(string),"[Anъncio]: %s: %s",name,result);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}
Ajudei? Reputation
Reply
#3

nao funcionou
Reply
#4

Qual o erro? Poste aqui que fica mais facil resolver ¬¬
Reply
#5

pawn Код:
if(!strcmp(cmd,"/anuncio",true))
{
    tmp = strtok(cmdtext,idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "(erro): /anuncio [text]");
    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;
    new sStr[120],nome[MAX_PLAYER_NAME];GetPlayerName(playerid,nome,sizeof(nome));
    format(sStr,sizeof(sStr),"Anъncio %s: %s",nome,(result));
    SendClientMessageToAll(-1,sStr);
    return 1;
}
Reply
#6

Pensei que quando usasse o result como unico parametro n precisasse do tmp.

Que noob eu =/
Reply
#7

tmp = strtok(cmdtext,idx); й o espaзo que tu usa exemplo:

[ /anuncio ESPAЗO ]

se nгo me engano..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)