Not able to speak - 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: Not able to speak (
/showthread.php?tid=145954)
Not able to speak -
Bomber - 04.05.2010
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 !
Re: Not able to speak -
aircombat - 04.05.2010
top of script :
Код:
new AFK[MAX_PLAYERS];
in ur /afk command
Код:
public OnPlayerText(playerid, text[])
{
if(AFK[playerid] == 1)
{
return 0;
}
return 1;
}
Re: Not able to speak -
Bomber - 04.05.2010
And, if his AFK, then servers sends message, how i do that ?
Re: Not able to speak -
aircombat - 04.05.2010
Код:
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
Re: Not able to speak -
Bomber - 04.05.2010
I mean, if his AFK, and he tries to speak, then comes Message that u can't speak, coz ur afk/brb
Re: Not able to speak -
NiiRV4N4 - 05.05.2010
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
Код:
public OnPlayerText(playerid, text[])
{
if(AFK[playerid] == 1)
{
return 0;
}
return 1;
}
|
Re: Not able to speak -
BP13 - 05.05.2010
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;
}
Re: Not able to speak -
Toni - 05.05.2010
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
Код:
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 Код:
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...
Re: Not able to speak -
aircombat - 05.05.2010
simply here is the whole code :
Top Of Script :
Код:
new AFK[MAX_PLAYERS];
new BRB[MAX_PLAYERS];
Under Your /afk Command :
Under Your /brb Command :
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;
}