Clearchat can't work
#1

pawn Код:
CMD:clearchat(playerid, params[])
{
    foreach(Player, i)
    {
        if(PlayerInfo[playerid][pAdmin] >= 2)
        {
            for(new e = 0; e < 4; e++) ClearChatbox(i);
        }
    }
    return 1;
    format(string, sizeof(string), "AdmCmd: %s has cleared all the chatbox.", GetPlayerNameEx(playerid);
    ABroadCast(COLOR_WHITE, string, 2);
}
This Command Can't Work Please Help Me
Reply
#2

Only 4 lines. better more..
pawn Код:
for( new i = 0; i <= 100; i ++ )
{
    SendClientMessage( i, -1, "" );
}
Reply
#3

Show us the ClearChatbox(i) function.
Also, you can easily do it this way:

pawn Код:
CMD:clearchat(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        for(new i = 0; i < 100; i++)
        SendClientMessageToAll(-1,"");
    }
    return 1;
    format(string, sizeof(string), "AdmCmd: %s has cleared all the chatbox.", GetPlayerNameEx(playerid);
    ABroadCast(COLOR_WHITE, string, 2);
}
Reply
#4

Thank You My Friends +1 to you both
Reply
#5

Please Don't Start Every Word With A Capital Letter That Is So Annoying! Anyways:
pawn Код:
CMD:clearchat(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2)
        return SendClientMessage(playerid, COLOR_WHITE, "AdmCmd: You do not have permission to use this command!");

    for(new i; i < 20 /* or 50 */; i++)
        SendClientMessageToAll(-1, " ");

    format(string, sizeof(string), "AdmCmd: %s has cleared the chatbox.", GetPlayerNameEx(playerid);
    ABroadCast(COLOR_WHITE, string, 2);
    return 1;
}
Oh my god, am I really that slow .. -.-
Reply
#6

Thnx you vince +1 to you also
Reply
#7

pawn Код:
CMD:clearchat( playerid, params[ ] )
{
    new string[ 64 ];
    // Rest
Edit: You edited your post and removing the undefined symbol "string"
Reply
#8

Vince these are errors
pawn Код:
F:\Server232\gamemodes\EGRP.pwn(58075) : error 017: undefined symbol "string"
F:\Server232\gamemodes\EGRP.pwn(58075) : error 017: undefined symbol "string"
F:\Server232\gamemodes\EGRP.pwn(58076) : error 017: undefined symbol "string"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#9

After removing String
pawn Код:
F:\Server232\gamemodes\EGRP.pwn(58075) : error 020: invalid symbol name ""
F:\Server232\gamemodes\EGRP.pwn(58075) : error 035: argument type mismatch (argument 2)
F:\Server232\gamemodes\EGRP.pwn(58076) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#10

After Removing String i think script look likes
pawn Код:
CMD:clearchat(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2)
        return SendClientMessage(playerid, COLOR_WHITE, "AdmCmd: You are not authorized to use that command!");

    for(new i; i < 20 /* or 50 */; i++)
        SendClientMessageToAll(-1, " ");

    format(sizeof), "AdmCmd: %s has cleared the chatbox.", GetPlayerNameEx(playerid);
    ABroadCast(COLOR_WHITE, 2);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)