SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 30/05/2010, 03:09 PM   #1
Flashy
Huge Clucker
 
Join Date: Apr 2010
Posts: 297
Reputation: 1
Default [SOLVED] Question about /wipechat

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.


Code:
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?
Flashy is offline  
Old 30/05/2010, 03:32 PM   #2
DJDhan
High-roller
 
DJDhan's Avatar
 
Join Date: Oct 2009
Location: Canada
Posts: 1,152
Reputation: 3
Default Re: Question about /wipechat

Code:
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");
}
__________________
DJDhan is offline  
Old 30/05/2010, 03:58 PM   #3
Flashy
Huge Clucker
 
Join Date: Apr 2010
Posts: 297
Reputation: 1
Default Re: Question about /wipechat

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?
Flashy is offline  
Old 30/05/2010, 04:09 PM   #4
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: Question about /wipechat

You can use any colour you want, as long as it's a valid colour.
Calgon is offline  
Old 30/05/2010, 04:13 PM   #5
Flashy
Huge Clucker
 
Join Date: Apr 2010
Posts: 297
Reputation: 1
Default Re: Question about /wipechat

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.
Flashy is offline  
Old 30/05/2010, 04:17 PM   #6
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: Question about /wipechat

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 Code:
SendClientMessageToAll(COLOR_BRIGHTRED, " ");

Should be correct, providing that you have defined the colour, don't blame me for your poor English please.
Calgon is offline  
Old 30/05/2010, 04:20 PM   #7
Flashy
Huge Clucker
 
Join Date: Apr 2010
Posts: 297
Reputation: 1
Default Re: Question about /wipechat

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?

Code:
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."
Flashy is offline  
Old 30/05/2010, 04:22 PM   #8
Calgon
Banned
 
Join Date: Jan 2009
Posts: 6,136
Reputation: 1127
Default Re: Question about /wipechat

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?

Code:
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 Code:
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.
Calgon is offline  
Old 30/05/2010, 04:31 PM   #9
Flashy
Huge Clucker
 
Join Date: Apr 2010
Posts: 297
Reputation: 1
Default Re: Question about /wipechat

Finally! Thanks man

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

Code:
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));

.
Flashy is offline  
Old 30/05/2010, 04:32 PM   #10
iStarzz
Big Clucker
 
Join Date: May 2010
Posts: 114
Reputation: 0
Default Re: Question about /wipechat

pawn Code:
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
iStarzz is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]Simple question[SOLVED] park4bmx Help Archive 2 16/06/2010 05:24 PM
question about using new [SOLVED] [SF]RobMob Help Archive 5 11/02/2010 09:52 PM
[Solved] Question & Help [LSB]TheGame Help Archive 4 03/01/2010 10:01 PM
[SOLVED]A question TyreXel Help Archive 1 18/12/2009 04:01 PM
[SOLVED]Question Jakku Help Archive 2 17/08/2009 02:42 PM


All times are GMT. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.