BubbleChat
#1

I posted topic on this before, I know. But it hasnt been helpful and the heading doesnt match the problem so I edited the command as much as I could and Im posting again, sorry if its double posint.

Still doesnt work. I want: IF you type in the chat:
"Yo" - It will come up as Name says: Yo [this works]
".Yo" - It will come up in a bubble above your head for like 5s [Doesnt work]

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(!strcmp(text[0], ".", true))
    {
        SetPlayerChatBubble(playerid, text[1], 0xFF0000FF, 100.0, 10000);
        return 1;
    }
    else
    {
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s says: %s", sendername, text);
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,4,4);
        return 0;
    }
}
Reply
#2

pawn Код:
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_F ADE4,COLOR_FADE5);
wtf is that? i have seen the code but i dont get the function
btw show us your Error from Pawno
Reply
#3

That is real chat, chat within 20, and closer you are to that guy the colour change. So at closest its white then it goes kind of gray.

There are no erros, its just that it doesnt work, the bubble doesnt pop up, you typee .yo or yo, and it will come up with that in the normal name says: text, chat.
Reply
#4

Use
Код:
if( text [ 0 ] == '.')
instead of:
Код:
if(!strcmp(text[0], ".", true))
Edit: OnPlayerText should also return in a value
Reply
#5

Thx, it works, it comes in a bubble but it also comes in the chat, how can I get rid of that? Im up to there:
pawn Код:
if(text[0]=='.')
    {
        SetPlayerChatBubble(playerid, ((text[1])), COLOR_LIGHTLIGHTBLUE, 15.0, 7000);
        return 1;
    }
    else
    {
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s mуwi: %s", sendername, text);
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,4,4);
        return 0;
    }
And how can I edit that '.' bit so now it also gives a bubble when you put "!!" after the text?
Reply
#6

OnPlayerText return 0 mabye?
Reply
#7

Yeah i changed that after I posted this, I still need to know how to do text!!, to come in a bubble too.

And how can I but the bubble text in bracket? I tried : SetPlayerChatBubble(playerid, ((text[1])), COLOR_LIGHTLIGHTBLUE, 15.0, 7000);

but it doesnt work
Reply
#8

Ok I sorted everything out now.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0]=='.')
    {
        new string[256];
        format(string, sizeof(string), "((%s))",text[1]);
        SetPlayerChatBubble(playerid, string, COLOR_LIGHTLIGHTBLUE, 15.0, 7000);

        new string2[256];
        format(string2, sizeof(string2), "[ID:%d][OOC]Oscar Gonzalez: %s",playerid,text[1]);
        SendClientMessage(playerid, COLOR_WHITE, string2);

        return 0;
    }
    if(text[1]=='!')
    {
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s krzyczy: %s!!", sendername, text);
        ProxDetector(40.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        return 0;
    }
    else
    {
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s mуwi: %s", sendername, text);
        ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,4,4);
        return 0;
    }
    return 1;
}
All i need now, is in the second part:

pawn Код:
if(text[1]=='!')
    {
        new string[256];
        new sendername[MAX_PLAYER_NAME];
        if(gPlayerLogged[playerid] == 0)
        {
            return 0;
        }
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "%s krzyczy: %s!!", sendername, text);
        ProxDetector(40.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        return 0;
    }
So when you type "wtf is this!" it will work, because currently it only works if "!" is the 2nd character, and ideas? ! needs to be in somewhere but not first, it would be best if you could use it last.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)