Not able to speak
#1

So, i made AFK/BRB system in my GM..

I want to know that how can I disable that if he/she is /afk or /brb then he/she can't speak ?

Please help !
Reply
#2

top of script :
Код:
new AFK[MAX_PLAYERS];
in ur /afk command
Код:
AFK[playerid] = 1;
Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
    return 0;
    }
    return 1;
}
Reply
#3

And, if his AFK, then servers sends message, how i do that ?
Reply
#4

Код:
new string[128]; new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s Is AFK",pName);
SendClientMessageToAll(COLOR,string);
put that in ur afk command
Reply
#5

I mean, if his AFK, and he tries to speak, then comes Message that u can't speak, coz ur afk/brb
Reply
#6

Quote:
Originally Posted by Bomba || ❶❸❸❼
I mean, if his AFK, and he tries to speak, then comes Message that u can't speak, coz ur afk/brb
Read:
Quote:
Originally Posted by Etch ❽ H
top of script :
Код:
new AFK[MAX_PLAYERS];
in ur /afk command
Код:
AFK[playerid] = 1;
Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
    return 0;
    }
    return 1;
}
Reply
#7

That was useless NiiRV4N4... This is how it goes:

[pawn]new AFK[MAX_PLAYERS];

in ur /afk command

AFK[playerid] = 1;

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_WHATEVER, "You cannot speak because you are AFK. Type /back first!");
    return 0;
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by NiiRV4N4
Quote:
Originally Posted by Bomba || ❶❸❸❼
I mean, if his AFK, and he tries to speak, then comes Message that u can't speak, coz ur afk/brb
Read:
Quote:
Originally Posted by Etch ❽ H
top of script :
Код:
new AFK[MAX_PLAYERS];
in ur /afk command
Код:
AFK[playerid] = 1;
Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
    return 0;
    }
    return 1;
}
Hes asking If The Person is AFK, Or BRB, There will be a error message sent to that player (e.g. "SERVER: You cannot talk, you are brb or afk.")

Do This, Not sure it will work, but it's worth a try
pawn Код:
new AFK[MAX_PLAYERS];
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
       return SendClientMessage(playerid, COLOR_RED, "You are AFK/BRB, You Cannot Speak!");
    }
    return 0;
}
Not sure if that will work remember...
Reply
#9

simply here is the whole code :


Top Of Script :
Код:
new AFK[MAX_PLAYERS];
new BRB[MAX_PLAYERS];
Under Your /afk Command :
Код:
AFK[playerid] = 1;
Under Your /brb Command :
Код:
BRB[playerid] = 1;
Under Your /back Command :
Код:
AFK[playerid] = 0;
BRB[playerid] = 0;
Код:
public OnPlayerText(playerid, text[])
{
    if(AFK[playerid] == 1)
    {
       SendClientMessage(playerid, COLOR_RED, "You are AFK , You Can't Speak Until You Are Back (/back)");
       return 0;
    }
    if(BRB[playerid] == 1)
    {
       SendClientMessage(playerid, COLOR_RED, "You are BRB , You Can't Speak Until You Are Back (/back)");
       return 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)