Admin Chat
#1

Hello guys ,
How should I make a admin chat (NOT RCON ONLY)
Any Ideas?
Reply
#2

PHP код:
public OnPlayerText(playeridtext[])
{
    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;
    } 
THIS IS SIMPLE ONE..
Reply
#3

i got this in my script.

replace arrays with yours.

PHP код:
stock adminchat(color, const msg[])
{
    foreach(
Playeri)
    {
        if (
playerData[i][playerLevel] >= 1)
        {
            
SendClientMessage(icolormsg);
        }
    }

Reply
#4

@iLearner, the code you provided is just a stock, not an admin chat.You're missing the code for it in OnPlayerText.
Reply
#5

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
@iLearner, the code you provided is just a stock, not an admin chat.You're missing the code for it in OnPlayerText.
He doesn't need Onplayertext,what is wrong with you?
Reply
#6

Quote:
Originally Posted by CannonBolt
Посмотреть сообщение
He doesn't need Onplayertext,what is wrong with you?
Do you really think that this code

PHP код:
stock adminchat(color, const msg[]) 

    foreach(
Playeri
    { 
        if (
playerData[i][playerLevel] >= 1
        { 
            
SendClientMessage(icolormsg); 
        } 
    } 

creates an admin chat?What is wrong with you?I simply stated that he provided a stock (that without the onplayertext, is useless).Fix your attitude buddy.
Reply
#7

Like this :

Код:
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;
}
Or use a stock for fast :

Код:
// 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;
}
Reply
#8

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
Do you really think that this code

PHP код:
stock adminchat(color, const msg[]) 

    foreach(
Playeri
    { 
        if (
playerData[i][playerLevel] >= 1
        { 
            
SendClientMessage(icolormsg); 
        } 
    } 

creates an admin chat?What is wrong with you?I simply stated that he provided a stock (that without the onplayertext, is useless).Fix your attitude buddy.
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)
Reply
#9

Quote:
Originally Posted by CannonBolt
Посмотреть сообщение
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)
Yes but again you misunderstood what I meant.
@iLearner provided the code (stock) so I told him that he needs to provide the onplayertext for that.However the admin chat can be used as a command like you said.
Reply
#10

remove the stock keyword, STOP THE ABUSE OF FUCKING STOCK.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)