SA-MP Forums Archive
Chat bug - 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: Chat bug (/showthread.php?tid=332640)



Chat bug - calzo2011 - 08.04.2012

Hey guys,

Am working on my own LA gamemode made form scratch but am having troubles with the chat system, I got the ooc working fine its just the normal push t then type and enter that the problem as when you do it it shows to all players and is normal

My code:
Код:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(str, sizeof(str), "%s says: %s", pname, text);
    return 1;
}



Re: Chat bug - ReneG - 08.04.2012

Don't return 1 on OnPlayerText. Return 0 to get rid of the normal SA:MP chat.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(str, sizeof(str), "%s says: %s", pname, text);
    return 0;
}
You also need to look up a ProxDetector function so it sends the message to only those who are near.


Re: Chat bug - calzo2011 - 08.04.2012

I got 2 errors

Код:
C:\Users\Calum Smith\Desktop\LARP\gamemodes\larp.pwn(407) : error 017: undefined symbol "strreplace"
C:\Users\Calum Smith\Desktop\LARP\gamemodes\larp.pwn(409) : error 017: undefined symbol "ProxDetector"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
What do I need to do to fix it?