PDA

View Full Version : Chat bug


calzo2011
08/04/2012, 08:58 PM
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;
}

ReneG
08/04/2012, 09:02 PM
Don't return 1 on OnPlayerText. Return 0 to get rid of the normal SA:MP chat.
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.

calzo2011
08/04/2012, 10:08 PM
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 (c) 1997-2006, ITB CompuPhase


2 Errors.


What do I need to do to fix it?