SA-MP Forums Archive
Local Chat Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Local Chat Help (/showthread.php?tid=136670)



Local Chat Help - NiiRV4N4 - 26.03.2010

pawn Код:
public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    format(string, sizeof(string), "%s says: %s", sendername, text);
    ProxDetector(20.0, playerid, string,WHITE,WHITE,WHITE,WHITE,WHITE);
    return 1;
}
This code works but when I tryed it it sent two message. Here is an example:
Код:
 says: Test
Jacob_Snake: Test
I need someone to fix this code so that only the code I provided is the only one that will be sent when the player types and enters something. I want local chat and local chat only but it doesn't work because it uses both chats and my name doesn't appear in my code which it should TO SUM IT ALL UP. Thank you.


Re: Local Chat Help - NiiRV4N4 - 26.03.2010

bump


Re: Local Chat Help - CJ101 - 26.03.2010

pawn Код:
public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    format(string, sizeof(string), "%s says: %s", sendername, text);
    ProxDetector(20.0, playerid, string,WHITE,WHITE,WHITE,WHITE,WHITE);
    return 0;
}



Re: Local Chat Help - NiiRV4N4 - 26.03.2010

Thanks but I still can't see my name.

Код:
 says:
It should be:
Код:
(sendername) says:



Re: Local Chat Help - CJ101 - 26.03.2010

pawn Код:
public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,sendername,sizeof sendername);
    new string[256];
    format(string, sizeof(string), "%s says: %s", sendername, text);
    ProxDetector(20.0, playerid, string,WHITE,WHITE,WHITE,WHITE,WHITE);
    return 0;
}



Re: Local Chat Help - NiiRV4N4 - 26.03.2010

Thank you so much.