Local Chat Help
#1

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.
Reply
#2

bump
Reply
#3

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;
}
Reply
#4

Thanks but I still can't see my name.

Код:
 says:
It should be:
Код:
(sendername) says:
Reply
#5

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;
}
Reply
#6

Thank you so much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)