SA-MP Forums Archive
[Question] Underline removing... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question] Underline removing... (/showthread.php?tid=504047)



[Question] Underline removing... - ZeroTheScyther - 01.04.2014

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 ^-^


Re: [Question] Underline removing... - PrivatioBoni - 01.04.2014

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.


Re: [Question] Underline removing... - LocMax - 01.04.2014

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;
}