Disable chat for player
#1

Hello guys. I have made an AFK filterscript.
It works almost perfect.
It has a /goafk command and a /back command.
I want to make the player unable to chat when he types /goafk, and the only thing he can type is /back.
If he types anything else, i want to send him a client message.

I have done the following:

At the top of the script I added:
pawn Code:
new afkmsg[500];
In the /goafk command i added:
pawn Code:
afkmsg[playerid] = 1;
And in the /back command i added:
pawn Code:
afkmsg[playerid] = 0;
And under OnPlayerText i added:
pawn Code:
if(afkmsg[playerid] != 0) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
But it works almost fine. When the player chats in AFK mode, it shows the client message, but the chat text still appears.

Hope someone can help me fixing it. Thank you.
Reply


Messages In This Thread
Disable chat for player - by sim_sima - 25.02.2011, 18:24
Re: Disable chat for player - by randomkid88 - 25.02.2011, 18:30
Re: Disable chat for player - by sim_sima - 25.02.2011, 18:31
Re: Disable chat for player - by Kwarde - 25.02.2011, 18:31
Re: Disable chat for player - by sim_sima - 25.02.2011, 18:33
Re: Disable chat for player - by sim_sima - 25.02.2011, 18:34
Re: Disable chat for player - by Kwarde - 25.02.2011, 18:34
Re: Disable chat for player - by sim_sima - 25.02.2011, 18:38
Re: Disable chat for player - by randomkid88 - 25.02.2011, 18:39
Re: Disable chat for player - by Kwarde - 25.02.2011, 18:40

Forum Jump:


Users browsing this thread: 2 Guest(s)