[AJUDA] Criar Gang Chat
#1

Bom pessoal nao to querendo usar FS de gang porque da muito problema , to criando um GM do 0 usando o new do Pawno!

Sou iniciante no Pawn, uma linguagem que eu to achando legal de mecher!

Primeiro, ja usei o search e apenas consegui topicos com os membros pedindo ajuda porque deu algum erro no chat da gang!

Entao queria saber se alguem pode me ajudar a criar um chat de gang/say

Obrigado pela atenзгo!
Reply
#2

Vou te dar um exemplo.

pawn Код:
new Gang[MAX_PLAYERS char];

forward SendMessageToPlayerGang(playerid, color, string[]);
public SendMessageToPlayerGang(playerid, color, string[])
{
    if(Gang{playerid} == 1)
    {
        for(new i; i < MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i) && Gang{i} == 1)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    if(Gang{playerid} == 2)
    {
        for(new i; i < MAX_PLAYERS; ++i)
        {
            if(IsPlayerConnected(i) && Gang{i} == 2)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}
Isso foi apenas um exemplo, vocк pode otimizar mais ele e acrescentar tambйm.
Agora um exemplo de como usar:

pawn Код:
CMD:virargang1(playerid)
{
    Gang{playerid} = 1;
    return true;
}

CMD:chat(playerid, params[])
{
    new text[24], msg[128], Nome[24];
    if(sscanf(params,"s",text)) return SendClientMessage(playerid,-1,"use /chat <texto>");
    GetPlayerName(playerid,Nome,24);
    format(msg,sizeof(msg),"* %s: %s",Nome,text);
    SendMessageToPlayerGang(playerid, -1/*Cor*/, msg/*texto*/);
    return true;
}
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=324849
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)