Disable chat for player -
sim_sima - 25.02.2011
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:
In the /goafk command i added:
And in the /back command i added:
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.
Re: Disable chat for player -
randomkid88 - 25.02.2011
Return 0 to stop the text from being sent.
Re: Disable chat for player -
sim_sima - 25.02.2011
Quote:
Originally Posted by randomkid88
Return 0 to stop the text from being sent.
|
Thank you. Ill try that
Re: Disable chat for player -
Kwarde - 25.02.2011
And don't forget that message.
Change
pawn Code:
if(afkmsg[playerid] != 0) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
for
pawn Code:
if(afkmsg[playerid] != 0) return 0, SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
Now it'll return 0 AND the message
Re: Disable chat for player -
sim_sima - 25.02.2011
Quote:
Originally Posted by randomkid88
Return 0 to stop the text from being sent.
|
Yea, but now i cant chat when im not in afk mode. I want the player to be unable to chat only when in afk mode
Re: Disable chat for player -
sim_sima - 25.02.2011
Quote:
Originally Posted by Kwarde
And don't forget that message.
Change
pawn Code:
if(afkmsg[playerid] != 0) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
for
pawn Code:
if(afkmsg[playerid] != 0) return 0, SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
Now it'll return 0 AND the message
|
Oh, thank you very much
Re: Disable chat for player -
Kwarde - 25.02.2011
@sim_sima:
OMG look at my post. I'd (probably) gave the right answer !!!
This forum requires that you wait 60 seconds between posts. Please try again in 9 seconds.
EDIT: Oh you've already seen it xD
We're a bit stuck with the waiting time I guess
Re: Disable chat for player -
sim_sima - 25.02.2011
Quote:
Originally Posted by Kwarde
And don't forget that message.
Change
pawn Code:
if(afkmsg[playerid] != 0) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
for
pawn Code:
if(afkmsg[playerid] != 0) return 0, SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not chat while in AFK mode. Type /back to chat");
Now it'll return 0 AND the message
|
Yes, i tryed that, but its still the same
Re: Disable chat for player -
randomkid88 - 25.02.2011
I'm sorry for not being specific. Kwarde has provided the solution, I meant to return 0 in that section, not for the entire OnPlayerText.
Re: Disable chat for player -
Kwarde - 25.02.2011
@sim_sima:
Not working? It should work... Try
'if(afkmsg[playerid] == 1)'