Cant use Chat ...[in game]
#1

hey guy's .... how are you all ? so i got an problem here is the code like
PHP код:
public OnPlayerText(playerid)
{
    if(
AFK[playerid] == 1)return GameTextForPlayer"You cant chat while in afk mode",3000,3);
    return 
0;

This is just my code and i am using lordz afk system so the problem is that when i am in afk so i cant chat but after i get /back again i cant chat ... wtf ...
Reply
#2

Well I'm sorry I think it's becoming because of a mistake in defines, I guess. Here's my chat stuffs of L-AFK.
As same as written on L-AFK:
pawn Код:
#define Disable_AFKCHAT == true //Change it from true to false if you don't want AFK users to be restricted in Chatting.

#if defined Disable_AFKCHAT == true
public OnPlayerText(playerid)
{
    if(AFK[playerid] == 1)
    {
     SendClientMessage(playerid, red, "You cannot chat while you are in AFK.");
    }
    return 0;
}
#endif
Please change the define to:
pawn Код:
#define Disable_AFKCHAT true
And also, make sure that the AFK variable is set to 0 on /back command.
Reply
#3

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Well I'm sorry I think it's becoming because of a mistake in defines, I guess. Here's my chat stuffs of L-AFK.
As same as written on L-AFK:
pawn Код:
#define Disable_AFKCHAT == true //Change it from true to false if you don't want AFK users to be restricted in Chatting.

#if defined Disable_AFKCHAT == true
public OnPlayerText(playerid)
{
    if(AFK[playerid] == 1)
    {
     SendClientMessage(playerid, red, "You cannot chat while you are in AFK.");
    }
    return 0;
}
#endif
Please change the define to:
pawn Код:
#define Disable_AFKCHAT true
And also, make sure that the AFK variable is set to 0 on /back command.
you mean change
PHP код:
#if defined Disable_AFKCHAT == true 
into
PHP код:
#if defined Disable_AFKCHAT true 
Reply
#4

Not that '#if'. At the top of the script, it has some defines. There you can see a define like this:
pawn Код:
#define Disable_AFKCHAT == true //Change it from true to false if you don't want AFK users to be restricted in Chatting.
Change it to:
pawn Код:
#define Disable_AFKCHAT true
Reply
#5

If you return 0 under OnPlayerText the text will not be shown, change it to 1.
Reply
#6

pawn Код:
public OnPlayerText(playerid)
{
    if(AFK[playerid] == 1) return GameTextForPlayer, "You cant chat while in afk mode",3000,3), 0; // NOTICE THE ZERO I ADDED HERE - IT PREVENTS AFK PLAYERS FROM CHATTING
    return 1; // If a player isn't afk, message gets sent
}
You were returning 0 no matter happens...
Reply
#7

-removed-.
Reply
#8

Nah man ... i set it to 1 i mean i tried but it will allow you to chat in game as well and while in afk as well.i'm saying that it is not showing it is showing but not letting me to chat before and after afk.
Reply
#9

Try using the code Mean given, it seems to work well.
Reply
#10

Quote:
Originally Posted by мυ∂υℓ_вacнα
Посмотреть сообщение
Nah man ... i set it to 1 i mean i tried but it will allow you to chat in game as well and while in afk as well.i'm saying that it is not showing it is showing but not letting me to chat before and after afk.
Use my code, I added a 0 after the format so it returns 0 on AFK and 1 on anything else...

I even wrote "NOTICE THE ZERO" with caps in my code!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)