need help with scripting the chat clear
#1

i need help with scripting something.
i want a command like /clearchat
and that clear the chat.
how to script that.
Reply
#2

ZCMD:
pawn Код:
//removed because I do not know what i was thinking writing this command.
If you need it for a different command processor; let me know.
Reply
#3

Quote:

(7744) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

how to fix that?
Reply
#4

EriesJohnson, there are quite a few problems in that code... try this instead:

pawn Код:
CMD:clearchat(playerid, params[])
{
    for(new i = 0; i < 100; i ++)
    {
         SendClientMessageToAll(0xFFFFFFFF, "");
    }
    return 1;
}
Reply
#5

I have no idea why I posted that code lol.

Though; I think calling me EriesJohnson may be a bit worse haha :P
Reply
#6

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
I have no idea why I posted that code lol.

Though; I think calling me EriesJohnson may be a bit worse haha :P
LOL, sorry mate. I just read your name whilst I was scrolling down, I probably had about half a second to read it and remember it and then started posting, didn't even do a copy+paste, .
Reply
#7

Hehe :P
Reply
#8

This all you do is send a bunch of blank messages to all,

Quote:

if (strcmp("/clearchat", cmdtext, true, 13) == 0)//the command
{
if(IsPlayerAdmin(playerid))//is player rcon admin
{//then
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
SendClientMessagesForAll(-1, " ");//send blank message to all
return 1;
}
else//if player is not rcon admin
{//then
SendClientMessages(playerid, -1, "You are not a rcon admin");//send messages to player who used command, but is not rcon admin
}
}

Reply
#9

Quote:
Originally Posted by ic3cr3am
Посмотреть сообщение
This all you do is send a bunch of blank messages to all,
"/clearchat" has lenght of 10, not 13. Plus sending 7 lines is not enough. I use /pagesize 20 so I'm still able to read the chat + if I scroll up.
Reply
#10

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
EriesJohnson, there are quite a few problems in that code... try this instead:

pawn Код:
CMD:clearchat(playerid, params[])
{
    for(new i = 0; i < 100; i ++)
    {
         SendClientMessageToAll(0xFFFFFFFF, "");
    }
    return 1;
}
that will do a small " lag " in server reduce the loop, 30 enough
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)