#1

Can someone tell/show me why this isn't working? It is repeating the message when I speak in-game.

Код HTML:
public OnPlayerText(playerid, text[])
{
	new string[132];
	if(PlayerInfo[playerid][pAccent] != 0)
	{
		format(string, sizeof(string), "[%s Accent] %s says: %s", PlayerInfo[playerid][pAccent], GetPlayerNameEx(playerid), text);
		Log("logs/chat.log", string);
		SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 10000);
	    ProxDetector(20.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
		return 1;
    }
	format(string, sizeof(string), "%s says: %s", GetPlayerNameEx(playerid), text);
	Log("logs/chat.log", string);
	SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 10000);
 	ProxDetector(20.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
}
For example, in-game it says:
[British Accent] John Walker says: Yo.
John Walker: Yo.

How do I make it so it doesn't repeat itself after?
Reply
#2

return 0 instead of return 1
Reply
#3

Код:
public OnPlayerText(playerid, text[])
{
	new string[132];
	if(PlayerInfo[playerid][pAccent] != 0)
	{
		format(string, sizeof(string), "[%s Accent] %s says: %s", PlayerInfo[playerid][pAccent], GetPlayerNameEx(playerid), text);
		Log("logs/chat.log", string);
		SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 10000);
		ProxDetector(20.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
		return 1;
	}
	else
	{
		format(string, sizeof(string), "%s says: %s", GetPlayerNameEx(playerid), text);
		Log("logs/chat.log", string);
		SetPlayerChatBubble(playerid, text, COLOR_WHITE, 20.0, 10000);
		ProxDetector(20.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
	}
	return 1;
}
This is it, you had to put an ELSE betwen pAccent functions :P to trigger betwen 'em
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)