К new ставим
Code
new Text3D:afktime3d[MAX_PLAYERS];
new Float:x3x[MAX_PLAYERS], Float:x3y[MAX_PLAYERS], Float:x3z[MAX_PLAYERS];
new Float:x3xx[MAX_PLAYERS], Float:x3yy[MAX_PLAYERS], Float:x3zz[MAX_PLAYERS];
new afkto[MAX_PLAYERS];
new realafk[MAX_PLAYERS];
В public OnPlayerConnect
В public SetPlayerSpawn
После
Code
if(WantLawyer[i] == 20)
{
SendClientMessage(i, COLOR_LIGHTRED, " Вы больше не нуждаетесь в адвокате.");
WantLawyer[i] = 0;
CallLawyer[i] = 0;
Ставите
Code
if(afkto[i] == 1 || afkto[i] == 0)
{
if(IsPlayerConnected(i))
{
if(afkto[i] == 0)
{
GetPlayerPos(i,x3x[i],x3y[i],x3z[i]);
afkto[i] = 1;
}
else if(afkto[i] == 1)
{
GetPlayerPos(i,x3xx[i],x3yy[i],x3zz[i]);
if(x3x[i] == x3xx[i] && x3y[i] == x3yy[i])
{
realafk[i] = realafk[i] + 1;
if(realafk[i] == 350 && PlayerInfo[i][pAdmin] == 0)
{
GetPlayerName(i,plname,sizeof(plname));
format(string,sizeof(string),"SERVER: %s кикнут,причина: AFK",plname);
SendClientMessageToAll(COLOR_WHITE,string);
Kick(i);
}
if(realafk[i]>=0)
{
format(string,sizeof(string),"{FFA500}[AFK][{FFFFFF}%d{FFA500} секунд]",realafk[i]);
if(IsValidDynamic3DTextLabel(afktime3d[i]))
{
UpdateDynamic3DTextLabelText(afktime3d[i],0xFFA500FF,string);
}
else
{
afktime3d[i] = CreateDynamic3DTextLabel(string,0xFFA500FF,x3x[i],x3y[i],x3zz[i],30,i);
}
}
}
else if(x3x[i] != x3xx[i] || x3y[i] != x3yy[i])
{
realafk[i] = 0;
DestroyDynamic3DTextLabel(afktime3d[i]);
}
x3x[i] = 0;
x3y[i] = 0;
x3z[i] = 0;
x3xx[i] = 0;
x3yy[i] = 0;
x3zz[i] = 0;
afkto[i] = 0;
}
}
В public OnPlayerCommandText
Code
realafk[playerid] = 1;
В public OnPlayerText
Code
realafk[playerid] = 1;
Вроде всё