Block Chat -Script - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Block Chat -Script (
/showthread.php?tid=73629)
Block Chat -Script -
kacxper - 16.04.2009
Hi
I'm searching some scrpit who can block chat - normal players cant write in chat only admins can write
Please help
//Sorry i cant good english
Re: Block Chat -Script -
Rks25 - 16.04.2009
make a if(admincheck) at onplayertext.
Re: Block Chat -Script -
kacxper - 16.04.2009
.... i'm noob.... i dont know what should i do
//i was starting learn pawno two days ago
please help!!
Re: Block Chat -Script -
OmeRinG - 16.04.2009
in OnPlayerText return 0 to hide text and return 1 to show..
check if playerid is admin if true return 1
else
return 0
Re: Block Chat -Script -
Sandra18[NL] - 16.04.2009
//Top of script:
Код:
new bool:ChatBlocked;
//OnPlayerText:
Код:
public OnPlayerText(playerid, text[])
{
if(ChatBlocked == true && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000AA, "Sorry, the admins blocked the chat");
return 0;
}
return 1;
}
//OnPlayerCommandText:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/blockchat", true)==0 && IsPlayerAdmin(playerid))
{
if(ChatBlocked == false)
{
ChatBlocked = true;
SendClientMessageToAll(0xFF0000AA, "The Admins blocked the chat!");
}
else
{
ChatBlocked = false;
SendClientMessageToAll(0x00FF00AA, "The Admins unblocked the chat!");
}
return 1;
}
return 0;
}
Re: Block Chat -Script -
kacxper - 16.04.2009
Thx
but i have some errors
Код:
C:\Documents and Settings\Kacxper\Pulpit\All.pwn(141) : error 010: invalid function or declaration
C:\Documents and Settings\Kacxper\Pulpit\All.pwn(143) : error 010: invalid function or declaration
C:\Documents and Settings\Kacxper\Pulpit\All.pwn(148) : error 010: invalid function or declaration
C:\Documents and Settings\Kacxper\Pulpit\All.pwn(153) : error 010: invalid function or declaration
C:\Documents and Settings\Kacxper\Pulpit\All.pwn(155) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
form 141 to 155
Код:
if(strcmp(cmdtext, "/blockchat", true)==0 && IsPlayerAdmin(playerid))
{
if(ChatBlocked == false)
{
ChatBlocked = true;
SendClientMessageToAll(0xFF0000AA, "The Admins blocked the chat!");
}
else
{
ChatBlocked = false;
SendClientMessageToAll(0x00FF00AA, "The Admins unblocked the chat!");
}
return 1;
}
return 0;
Re: Block Chat -Script -
Sandra18[NL] - 16.04.2009
Did you put that command in your OnPlayerCommandText-callback along with your other commands?
Re: Block Chat -Script -
kacxper - 16.04.2009
Yes
// i made new FilterScript and now its ok!
Код:
#pragma tabsize 0
#include <a_samp>
#include <core>
#include <float>
new bool:ChatBlocked;
public OnFilterScriptInit()
{
}
public OnPlayerText(playerid, text[])
{
if(ChatBlocked == true && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0xFF0000AA, "Sorry, the admins blocked the chat");
return 0;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/blockchat", true)==0 && IsPlayerAdmin(playerid))
{
if(ChatBlocked == false)
{
ChatBlocked = true;
SendClientMessageToAll(0xFF0000AA, "The Admins blocked the chat!");
}
else
{
ChatBlocked = false;
SendClientMessageToAll(0x00FF00AA, "The Admins unblocked the chat!");
}
return 1;
}
return 0;
}
Thanks very much
=>Sandra<=