[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Модератор форума: Gank  
[GF] Текст над игроком когда он AFK
Дата: 13.03.2011, Воскресенье, 04:13:32 | Сообщение # $NUMBER
Группа: Пользователи
Сообщений: 78
Репутация: 187+
К 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
Code
afkto[playerid] = 2;

В public SetPlayerSpawn
Code
afkto[playerid] = 0;

После
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;

Вроде всё :)
Дата: 13.03.2011, Воскресенье, 05:45:00 | Сообщение # $NUMBER
Группа: Пользователи
Сообщений: 223
Репутация: 98+
держи + отличный урок
  • Страница 1 из 1
  • 1
Поиск: