SA-MP Forums Archive
Clearchat can't work - 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: Clearchat can't work (/showthread.php?tid=317184)



Clearchat can't work - varuncoolrule - 10.02.2012

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


Re: Clearchat can't work - Konstantinos - 10.02.2012

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



AW: Clearchat can't work - Drebin - 10.02.2012

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



Re: Clearchat can't work - varuncoolrule - 10.02.2012

Thank You My Friends +1 to you both


Re: Clearchat can't work - Vince - 10.02.2012

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


Re: Clearchat can't work - varuncoolrule - 10.02.2012

Thnx you vince +1 to you also


Re: Clearchat can't work - Konstantinos - 10.02.2012

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


Re: Clearchat can't work - varuncoolrule - 10.02.2012

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.



Re: Clearchat can't work - varuncoolrule - 10.02.2012

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.



Re: Clearchat can't work - varuncoolrule - 10.02.2012

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