[SOLVED] Question about /wipechat
#1

Hey again,

I want to know whow I can Send a message to all when the chat is wiped (cleared). I know that I must include SendMessageToAll (COLOR_BLA); but I donґt know how to put it right.


Код:
dcmd_clear(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] < 2) return false;
	for(new i=0; i<30; i++)
	{
		SendClientMessageToAll(COLOR_BRIGHTRED, " ");

		
	}
	#pragma unused params
	return 1;
}
Someone help?
Reply
#2

Код:
dcmd_clearallchat(playerid,params[])
{
  #pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	SendCommandToAdmins(playerid,"ClearAllChat");
	for(new i = 0; i < 50; i++)
 	SendClientMessageToAll(green," ");
	return 1;
 	}
	else return SendClientMessage(playerid, 0xffffffaa,"Yu are nt an admin");
}
Reply
#3

I donґt want it with IsPlayerAdmin cause I have 3 adminlevels and I want to order which level can use this.

And your script donґt work..

Someone have an other idea?
Reply
#4

You can use any colour you want, as long as it's a valid colour.
Reply
#5

Quote:
Originally Posted by Calgon
You can use any colour you want, as long as it's a valid colour.
That wasnґt my question. I know that.
Read the whole topic again and you will know that I search an other thing.
Reply
#6

Quote:
Originally Posted by Flashy
Quote:
Originally Posted by Calgon
You can use any colour you want, as long as it's a valid colour.
That wasnґt my question. I know that.
Read the whole topic again and you will know that I search an other thing.
pawn Код:
SendClientMessageToAll(COLOR_BRIGHTRED, " ");
Should be correct, providing that you have defined the colour, don't blame me for your poor English please.
Reply
#7

I see that no one understand what I want. Again: I donґt have any problem with the colours!
I just want a Message to all players when a admin clear the chat!

Understand now?

Код:
dcmd_clear(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] < 2) return false;
	for(new i=0; i<30; i++)
	{
		SendClientMessageToAll(COLOR_BRIGHTRED, " ");

		
	}
	#pragma unused params
	return 1;
}
With this script I only can clear teh chat but at the end I donґt get a message which says "Admin xy has clear the chat."
Reply
#8

Quote:
Originally Posted by Flashy
I see that no one understand what I want. Again: I donґt have any problem with the colours!
I just want a Message to all players when a admin clear the chat!

Understand now?

Код:
dcmd_clear(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] < 2) return false;
	for(new i=0; i<30; i++)
	{
		SendClientMessageToAll(COLOR_BRIGHTRED, " ");

		
	}
	#pragma unused params
	return 1;
}
With this script I only can clear teh chat but at the end I donґt get a message which says "Admin xy has clear the chat."
Oh, I see now.

pawn Код:
dcmd_clear(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] < 2) return false;
   
    for(new i=0; i<30; i++)
    {
        SendClientMessageToAll(COLOR_BRIGHTRED, " ");
    }
   
    new
      String[ 54 ]
        Name[ MAX_PLAYER_NAME ];

    GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
    format( String, sizeof( String ), "Admin %s has cleared the chat.", Name );
    SendClientMessageToAll( COLOR_BRIGHTRED, String );
   
    #pragma unused params
    return 1;
}
Blame ****** Chrome for the indentation.
Reply
#9

Finally! Thanks man

I got one error next to optimiz my code qith the script. If you want explain me how to fix it:

Код:
dcmd_clear(playerid, params[])
{
	if(PlayerInfo[playerid][AdminLevel] < 2) return false;
	for(new i=0; i<30; i++)
	{
		SendClientMessageToAll(COLOR_BRIGHTRED, " ");

		new	str[54], pName[24]
		GetPlayerName(playerid, pName, sizeof(pName));
		format(str, sizeof(str), "Admin %s has cleared the chat.", pName);
		SendClientMessageToAll(COLOR_BRIGHTRED, str);
	}
	#pragma unused params
	return 1;
}
ERROR: \filterscripts\Adminscript.pwn(1143) : error 001: expected token: ";", but found "-identifier-"


ERROR LINE:

GetPlayerName(playerid, pName, sizeof(pName));

.
Reply
#10

pawn Код:
dcmd_clear(playerid, params[])
{
    if(PlayerInfo[playerid][AdminLevel] < 2) return false;
    for(new i=0; i<30; i++)
    {
        SendClientMessageToAll(COLOR_BRIGHTRED, " ");

        new str[54], pName[24]
        GetPlayerName(playerid, pName, sizeof(pName);
        format(str, sizeof(str), "Admin %s has cleared the chat.", pName);
        SendClientMessageToAll(COLOR_BRIGHTRED, str);
    }
    #pragma unused params
    return 1;
}
try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)