10.01.2013, 01:17
How do I make the /clearchat command to delete the chat. Thank you.
CMD:clearchat(playerid, params[])
{
for(new i=0; i<100; i++)
{
SendClientMessage(playerid,COLOR_RED, "");
}
}
CMD:clearchat(playerid, params[])
{
//if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command."); //Optional, replace PlayerInfo[playerid][Admin] with your own variable if you intend to use.
for(new i = 0; i < 100; i++)
{
SendClientMessageToAll(playerid,0xFF0000FF, " ");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/clearchat", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
SendClientMessageToAll(-1, "");
}
}
else SendClientMessage(playerid, -1, "You are not authorized to use this command !");
return 1;
}
return 0;
}
Do you mean using STRCMP? OnPlayerCommandText? If yes, here ya go.
pawn Код:
|