SA-MP Forums Archive
Admin Chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Chat (/showthread.php?tid=618062)



Admin Chat - Gotham - 30.09.2016

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


Re: Admin Chat - Younes44 - 30.09.2016

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..


Re: Admin Chat - iLearner - 30.09.2016

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);
        }
    }




Re: Admin Chat - Quinncell - 30.09.2016

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


Re: Admin Chat - CannonBolt - 30.09.2016

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?


Re: Admin Chat - Quinncell - 30.09.2016

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.


Re: Admin Chat - ActionTanki91 - 30.09.2016

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;
}



Re: Admin Chat - CannonBolt - 30.09.2016

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)


Re: Admin Chat - Quinncell - 30.09.2016

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.


Re: Admin Chat - Logic_ - 01.10.2016

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