Clearchat command for all and player only - 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 command for all and player only (
/showthread.php?tid=583095)
Clearchat command for all and player only -
whando - 25.07.2015
Hello, I got a clearchat command for admins to clear all players chats. Now I want to make it for the person who uses it to only clear his chat. I'm still learning and can't get it working, whats wrong?
Код:
CMD:clearchatall(playerid, params[])
{
if (PlayerData[playerid][pAdmin] < 5)
return SendErrorMessage(playerid, "You cannot use this command.");
for (new i = 0; i < 100; i ++) {
SendClientMessageToAll(-1, "");
}
return 1;
}
Код:
CMD:clearchat(playerid, params[])
{
for (new i = 0; i < 100; i ++) {
SendClientMessage(-1, "");
}
return 1;
}
error 035: argument type mismatch (argument 2)
AW: Clearchat command for all and player only -
Mencent - 25.07.2015
Hello!
PHP код:
CMD:clearchatall(playerid, params[])
{
if (PlayerData[playerid][pAdmin] < 5)
return SendErrorMessage(playerid, "You cannot use this command.");
for (new i = 0; i < 20; i ++) {
SendClientMessageToAll(-1, "");
}
return 1;
}
CMD:clearchat(playerid, params[])
{
for (new i = 0; i < 20; i ++) {
SendClientMessage(playerid,-1, "");
}
return 1;
}
It is enough if you write 20 instead of 100 because you can have maximal 20 rows in your chat.
The mistake was that you forgot the "playerid" parameter.
- Mencent
Re : Clearchat command for all and player only -
Terrorizt - 25.07.2015
Код:
CMD:clearchat(playerid, params[])
{
for (new i = 0; i < 100; i ++) {
SendClientMessage(playerid,-1, ""); // you forgot playerid
}
return 1;
}
Re: Clearchat command for all and player only -
iMFear - 25.07.2015
PHP код:
CMD:clearchat(playerid, params[])
{
for (new i = 0; i < 100; i ++) {
SendClientMessage(playerid, -1, "");
}
return 1;
}
Re: Clearchat command for all and player only -
whando - 25.07.2015
Oh that's stupid haha, thanks guys!