[AJUDA] Criar Chat
#1

Bom Alguem Por Favor Pode Mim Ajuda A Criar Chat Tipo "!" usando isso
Reply
#2

Strings
Faзa uma verificaзгo na callback OnPlayerText se o primeiro caractere й igual a !.
Reply
#3

Sim Eu sei mais quando faзo da esse erros olha ai

C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 029: invalid expression, assumed zero
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(702) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\windws 8\Desktop\treinotutb.pwn(703) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(705) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(711) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(717) : error 010: invalid function or declaration


Код:
 public OnPlayerText(playerid, text[])
{
    new tmp[128];
    if(text[0] == '!')
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i, 9.0, Pos[0], Pos[1], Pos[2]))
            {
                SendClientMessage(i, 0xE31919FF, tmp);
            }
        }
    }
    return 1;
}
    SetPlayerChatBubble(playerid, text, COLOR_WHITE, 80.0, 10000);
    format(string,sizeof(string),"[Chat Torcida Uniformizada Terror Bicolor] %s (%i): {FFFFFF}%s",playerid,text);
    SendPlayerMessageToAll(playerid,string);

    return 0;
}
Ai A Public O
Reply
#4

Retire o return 1.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new tmp[128];
    if(text[0] == '!')
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i, 9.0, Pos[0], Pos[1], Pos[2]))
            {
                SendClientMessage(i, 0xE31919FF, tmp);
            }
        }
    }
    SetPlayerChatBubble(playerid, text, COLOR_WHITE, 80.0, 10000);
    format(string,sizeof(string),"[Chat Torcida Uniformizada Terror Bicolor] %s (%i): {FFFFFF}%s",playerid,text);
    SendPlayerMessageToAll(playerid,string);

    return 0;
}
Reply
#5

Agora Ficou So Assim

C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 029: invalid expression, assumed zero
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(702) : error 021: symbol already defined: "GetPlayerPos"
C:\Users\windws 8\Desktop\treinotutb.pwn(703) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(705) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(715) : error 010: invalid function or declaration
Reply
#6

Verifique se vocк nгo deixou nada que estava dentro da callback OnPlayerText para fora, pois a callback estб certa.
Reply
#7

pere
Reply
#8

Vc Tem Algum ex de q pode ta fora da callback?
Reply
#9

Quando estava dando erro por causa do return estava assim:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new tmp[128];
    if(text[0] == '!')
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i, 9.0, Pos[0], Pos[1], Pos[2]))
            {
                SendClientMessage(i, 0xE31919FF, tmp);
            }
        }
    }
    return 1;
}
    SetPlayerChatBubble(playerid, text, COLOR_WHITE, 80.0, 10000);
    format(string,sizeof(string),"[Chat Torcida Uniformizada Terror Bicolor] %s (%i): {FFFFFF}%s",playerid,text);
    SendPlayerMessageToAll(playerid,string);

    return 0;
}
E eu falei para vocк deixar assim:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new tmp[128];
    if(text[0] == '!')
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i, 9.0, Pos[0], Pos[1], Pos[2]))
            {
                SendClientMessage(i, 0xE31919FF, tmp);
            }
        }
    }
    SetPlayerChatBubble(playerid, text, COLOR_WHITE, 80.0, 10000);
    format(string,sizeof(string),"[Chat Torcida Uniformizada Terror Bicolor] %s (%i): {FFFFFF}%s",playerid,text);
    SendPlayerMessageToAll(playerid,string);

    return 0;
}
Acretido que pode ter ficado uma parte:
pawn Код:
public OnPlayerText(playerid, text[])
{
// Cуdigo
 public OnPlayerText(playerid, text[])
{
    new tmp[128];
    if(text[0] == '!')
    {
        new Float:Pos[3];
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerInRangeOfPoint(i, 9.0, Pos[0], Pos[1], Pos[2]))
            {
                SendClientMessage(i, 0xE31919FF, tmp);
            }
        }
    }
    return 1;
}
    SetPlayerChatBubble(playerid, text, COLOR_WHITE, 80.0, 10000);
    format(string,sizeof(string),"[Chat Torcida Uniformizada Terror Bicolor] %s (%i): {FFFFFF}%s",playerid,text);
    SendPlayerMessageToAll(playerid,string);

    return 0;
}
Reply
#10

eu peguei pra testa coloquei um em cima do outro ai deu esse error falando q esta definido pq tem 2 mais eu tirei e procurei pra ver se tinha outra callback mais n tem


C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(696) : error 029: invalid expression, assumed zero
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : error 010: invalid function or declaration
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : error 021: symbol already defined: "OnPlayerText"
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : error 029: invalid expression, assumed zero
C:\Users\windws 8\Desktop\treinotutb.pwn(699) : fatal error 107: too many error messages on one line
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)