multi functions onplayertext
#1

Hello, I'm pretty new on scripting and I've tried to make an admin chat and a custom chat color for players.
This is my code:
Код:
public OnPlayerText(playerid, text[])
{
new chat[200], name[MAX_PLAYER_NAME], msg[128];
if(IsPlayerAdmin(playerid) && text[0] == '#')
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(msg, sizeof(msg), "[ADMIN CHAT]%s(%d): %s", pName, playerid, text[1]);
SendMessageToAdmins(msg);
}
else
{
GetPlayerName(playerid, name, sizeof(name));
format(chat, sizeof(chat), "(%d): {EBFF00}%s{FFFFFF}",playerid, text);
SendPlayerMessageToAll(playerid, chat);
return 0;
}
The problem is when I'm trying to talk in admin chat it shows up also in the main chat.
I need to make them both to return 0; I guess but I just couldn't do it without getting unreachable code errors.

If some experienced guy could help me with that I'll be thankful with a rep.
Thanks, rakinz.

EDIT: fixed
Reply


Messages In This Thread
multi functions onplayertext - by rakinz - 28.01.2017, 14:23
Re: multi functions onplayertext - by IceBilizard - 28.01.2017, 14:26
Re: multi functions onplayertext - by oMa37 - 28.01.2017, 14:31
Re: multi functions onplayertext - by rakinz - 28.01.2017, 14:33
Re: multi functions onplayertext - by rakinz - 28.01.2017, 14:35
Re: multi functions onplayertext - by rakinz - 28.01.2017, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)