[pedido]Comando Anunciar.
#1

Com Quero saber Como crio um Comando de /anunciar.
Dai assim que o player digitar anunciar Seu Anuncio й mandado para todos Players ON.

/anuncio [TEXTO].

Deste Geito /\.
Reply
#2

pawn Код:
#include zcmd
#include sscanf2
pawn Код:
new texto;
new nome[MAX_PLAYER_NAME];
new Str[128];
new id;
pawn Код:
CMD:anuncio(playerid, params[])
{
        if(sscanf(params, "s",texto))
        {
            SendClientMessage(playerid,-1,"Use: /anuncio [texto]");
        }
        else
        {
            GetPlayerName(playerid,nome,sizeof(nome));
            format(Str, sizeof(Str),"Anъncio de %s [ID:%d]: %s",nome,playerid,texto);
            SendClientMessageToAll(-1,Str);
        }
       return true;
}
Reply
#3

as ves nao entendo ocara quй ajudar tanto que nem define texto queria ver como й que vai mandar a mensagen e em getplayername nem definiu o nome tbm parabens pra tigo em str? vo nem comentar.
Reply
#4

pawn Код:
CMD:anunciar(playerid, params[])
{
    new texto[44], Nome[MAX_PLAYER_NAME], msg[128];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid,-1,"* Utilize: /anunciar <Texto>");
    GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
    format(msg,sizeof(msg),"[ANUNCIO] (%s diz: %s)",Nome, texto);
    SendClientMessageToAll(-1, msg);
    return true;
}
Reply
#5

Quote:
Originally Posted by AFerreira
Посмотреть сообщение
pawn Код:
CMD:anunciar(playerid, params[])
{
    new texto[44], Nome[MAX_PLAYER_NAME], msg[128];
    if(sscanf(params,"s",texto)) return SendClientMessage(playerid,-1,"* Utilize: /anunciar <Texto>");
    GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
    format(msg,sizeof(msg),"[ANUNCIO] (%s diz: %s)",Nome, texto);
    SendClientMessageToAll(-1, msg);
    return true;
}
Vlw aferreira
+rep
Ops nao da pra dar mais rep pra tu
Ja dei xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)