28.01.2017, 14:23
(
Последний раз редактировалось rakinz; 28.01.2017 в 15:14.
)
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:
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
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;
}
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


