[Question] Underline removing...
#1

Hey guys. Working on a RP server and after lot of progress I realized that I didn't really made anything to remove the underline from players' name ... so I made this one really quick but I have a small problem ...

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(masked[playerid])
    {
        new string[128];// This is string what we use.
        format(string, sizeof(string), "Strainul %d: %s", maskid[playerid], text); //This is when you are masked and  you start to speak
        ProxDetector(30.0, playerid, string, -1,0xFFFFFFBB,0xFFFFFFBB,0xFFFFFF77,0xFFFFFF33);
        return 0;
    }
    else
    {
        new string[128];// This is string what we use.
        format(string, sizeof(string), "%s: %s", GetPlayerNameEx(playerid), text); //when you are not masked and you speak
        ProxDetector(30.0, playerid, string, -1,0xFFFFFFBB,0xFFFFFFBB,0xFFFFFF77,0xFFFFFF33);
    }
    return 1;
}
Whenever I chat I get two messages like

pawn Код:
Akira Heartnet: Test!
Akira_Heartnet: Test!
What's wrong?

EDIT: Don't tell me it's because I didn't added
pawn Код:
return 0;
Edit2: Yep ... fixed, I just had to add that return 0; ... Damn' I'm so stupid sometimes ^-^
Reply
#2

Indeed. You need
pawn Код:
return 0;
otherwise it outputs both the RP chat and the global chat thus giving the illusion that it's sent twice.
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    if(masked[playerid])
    {
        format(string, sizeof(string), "Strainul %d: %s", maskid[playerid], text); //This is when you are masked and  you start to speak
        ProxDetector(30.0, playerid, string, -1,0xFFFFFFBB,0xFFFFFFBB,0xFFFFFF77,0xFFFFFF33);
    }
    else
    {
        format(string, sizeof(string), "%s: %s", GetPlayerNameEx(playerid), text); //when you are not masked and you speak
        ProxDetector(30.0, playerid, string, -1,0xFFFFFFBB,0xFFFFFFBB,0xFFFFFF77,0xFFFFFF33);
    }
    return 0;
}
or

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    if(masked[playerid]) format(string, sizeof(string), "Strainul %d: %s", maskid[playerid], text);
    else format(string, sizeof(string), "%s: %s", GetPlayerNameEx(playerid), text); //when you are not masked and you speak
    return ProxDetector(30.0, playerid, string, -1,0xFFFFFFBB,0xFFFFFFBB,0xFFFFFF77,0xFFFFFF33), 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)