13.10.2011, 09:27
pawn Code:
if (strcmp(cmd, "/clearchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xAFAFAFAA, "[USAGE]: /clearchat [line]");
}
new lin = strval(tmp);
if(lin < 1) return SendClientMessage(playerid,0xAFAFAFAA, " Error !");
GetPlayerName(playerid, sendername, sizeof(sendername));
for(new i=0; i<GetMaxPlayers(); i++) ClearChatbox(i,lin);
}
}
return 1;
}
stock ClearChatbox(playerid, lines)
{
if (IsPlayerConnected(playerid))
{
for(new i=0; i<lines; i++)
{
SendClientMessage(playerid, 0xAFAFAFAA, " ");
}
}
return 1;
}