30.09.2016, 16:00
Hello guys ,
How should I make a admin chat (NOT RCON ONLY)
Any Ideas?
How should I make a admin chat (NOT RCON ONLY)
Any Ideas?
public OnPlayerText(playerid, text[])
{
if(text[0] == '@' && PlayerInfo[playerid][Level] >= 1) {
new string[150]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"A.Chat:[%i]%s: %s",playerid,string,text[1]);
MessageToAdmins(0xF27ED2FF,string);
return 0;
}
stock adminchat(color, const msg[])
{
foreach(Player, i)
{
if (playerData[i][playerLevel] >= 1)
{
SendClientMessage(i, color, msg);
}
}
}
stock adminchat(color, const msg[])
{
foreach(Player, i)
{
if (playerData[i][playerLevel] >= 1)
{
SendClientMessage(i, color, msg);
}
}
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '!') // Change symbol
{
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
new string[256];
format(string, sizeof(string), "A.CHAT %s : %s", PlayerName(playerid), text[1]);
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= 1)
SendClientMessage(i, COLOR_PURPLE, string);
}
return 0;
}
}
return 1;
}
// stock by nogh445
stock SendAdminMessage(col, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] >= 1)
SendClientMessage(i, col, string);
}
return 1;
}
|
Do you really think that this code
PHP код:
|
|
But he doesn't need OnPlayerText. i've an admin chat it works fine i didn't use onplayertext for it i just simple use a command /adminchat [Message],So that's why i said he doesn't need OnPlayerText,In my opinion using OnplayerText for an admin chat would be something like (@ then a message) or (! then a message)
|