[FilterScript] -DS- AFK
#1

Boa noite , tarde ou dia!
Venho trazendo um sistema AFK!!!
Sim , mais um sistema afk .Porem nao tao igual ao resto.

Includes utilizadas
  • a_samp
  • zcmd
  • sscanf2
Novidades:
  1. Alem do /afk ele te informa a hora que voce ficou ausente e a hora que voce saiu do ausente.
  2. Quando ausente fica um 3DLabel em sua cabeзa informando a hora que voce ficou afk .
  3. Ele seta seu nick por exemplo "[AFK]Don_AsMinaPira" .
  4. Ele conta quantos player ja ficaram afk no servidor .
  5. E um +- revolucionario Anti-ESC , se voce disconfiar que ele esta de ESC voce acusa ele . se ele nao se meche e Kickado!!

PS: nao da pra acusar player afk!

Comandos:
  1. /afk
  2. /playersafk
  3. /afkshoje >Apenas logado na Rcon.
  4. /resetar > Apenas logado na Rcon.
  5. /acusar

CODE\/
pawn Код:
#include a_samp
#include zcmd
#include sscanf2
#define DialogAFK                                                             99
new bool:afk[MAX_PLAYERS];
new Don[80];
new PlayersAfk;
new Text3D:AFKS;
new DName[MAX_PLAYER_NAME];
new IDName[MAX_PLAYER_NAME];
public OnFilterScriptInit(){ return 1; }
public OnFilterScriptExit(){ return 1; }
public OnPlayerConnect(playerid)
{
    afk[playerid] = false;
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}
cmd(afk,playerid,params[])
{
    new horas, minutos, segundos;
    gettime(horas,minutos,segundos);
    new DHoras, DMinutos, DSegundos;
    gettime(DHoras,DMinutos,DSegundos);
    if(afk[playerid] == false)
    {
          GetPlayerName(playerid, DName,sizeof(DName));
          format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) entrou no modo ausente ( /afk ).", DName , playerid);
          SendClientMessage(playerid,-1,Don);
          afk[playerid] = true;
          new Float:Pos[3];
          GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
          SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+50);
          new Float:Vida[1];
          GetPlayerHealth(playerid,Vida[0]);
          SetPlayerHealth(playerid,Vida[0]+100000);
          TogglePlayerControllable(playerid,1);
          format(Don,sizeof(Don),"[AFK]%s", DName);
          SetPlayerName(playerid, Don);
          PlayersAfk++;
          format(Don,sizeof(Don),"-Info- Voce ficou ausente as %i:%i:%i", horas, minutos, segundos);
          SendClientMessage(playerid,-1,Don);
          format(Don,sizeof(Don),"-Info- Player ausente desdas %i:%i:%i", horas, minutos, segundos);
          Create3DTextLabel(Don,0xF00ECAA,Pos[0],Pos[1],Pos[2],50.0,0);
          Attach3DTextLabelToPlayer(Text3D:AFKS,playerid,0.0,0.0,4.0);
         
    }
    else
    {
          format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) saiu do modo ausente ( /afk ).", DName , playerid);
          SendClientMessage(playerid,-1,Don);
          afk[playerid] = false;
          new Float:Pos[3];
          GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
          SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]-50);
          new Float:Vida[1];
          GetPlayerHealth(playerid,Vida[0]);
          SetPlayerHealth(playerid,Vida[0]-100000);
          TogglePlayerControllable(playerid,0);
          format(Don,sizeof(Don),"%s", DName);
          SetPlayerName(playerid, Don);
          format(Don,sizeof(Don),"-Info- Voce ficou ausente as %i:%i:%i e voltou as %i:%i:%i", horas, minutos, segundos, DHoras, DMinutos, DSegundos);
          SendClientMessage(playerid,-1,Don);
          Delete3DTextLabel(Text3D:AFKS);
    }
    return true;
}
cmd(playersafk,playerid,params[])
{
   for(new x=0; x<MAX_PLAYERS; x++)
   {
       new Speed[50];
       if(afk[x]== true)
       {
           GetPlayerName(i, DName,sizeof(DName));
           format(Don,sizeof(Don),"| %s[ID:%d] |AFK\n", DName,x);
           strcat(Speed, Don);
       }
       ShowPlayerDialog(playerid, DialogAFK, DIALOG_STYLE_MSGBOX, "Players Afk", Speed, "Ok","");
   }
   return true;
}
cmd(afkshoje,playerid,params[])
{
   if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"-Erro- Apenas logado na Rcon");
   format(Don,sizeof(Don),"-Info- Total de players AFK hoje %i.",PlayersAfk);
   SendClientMessageToAll(-1,Don);
   return true;
}
cmd(resetar,playerid,params[])
{
   if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,"-Erro- Apenas logado na Rcon");
   GetPlayerName(playerid, DName,sizeof(DName));
   format(Don,sizeof(Don),"-Info- AFKґs resetado pelo admin %s(ID%d).",DName,playerid);
   SendClientMessageToAll(-1,Don);
   PlayersAfk = 0;
   return true;
}
cmd(acusar,playerid,params[])
{
    new Float:Pos[3], ID;
    if(sscanf(params,"d",ID))return SendClientMessage(playerid,-1,"-Uso- /acusar[id]");
    if(afk[ID] == true)return SendClientMessage(playerid,-1,"-Erro- Ele esta ausente ( /afk )");
    GetPlayerPos(ID,Pos[0],Pos[1],Pos[2]);
    if(IsPlayerInRangeOfPoint(playerid, 3.0,Pos[0],Pos[1],Pos[2]))return SendClientMessage(playerid, -1,"-Erro- Player Nao Esta Perto");
    SetTimerEx("Posicao",8000,false,"iifff",playerid,ID,Pos[0],Pos[1],Pos[2]);
    GameTextForPlayer(ID,"~r~se mova pra nao ser kickado", 3000, 3);
    GetPlayerName(ID, IDName, sizeof(IDName));
    format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) te acusou de ESC.", IDName, ID);
    SendClientMessage(ID,-1,Don);
    return true;
}
forward Posicao(playerid,ID,Float:X,Float:Y,Float:Z);
public Posicao(playerid,ID,Float:X,Float:Y,Float:Z)
{
    new Float:Pos[3];
    GetPlayerPos(ID,Pos[0],Pos[1],Pos[2]);
    if (Pos[0] == X && Pos[1] == Y && Pos[2] == Z)
    {
         GetPlayerName(ID, IDName, sizeof(IDName));
         format(Don,sizeof(Don),"-Info- O jogador %s(ID:%d) foi chutado do server.[Motivo: ESC].", IDName, ID);
         SendClientMessage(ID,-1,Don);
         Kick(ID);
    }else GameTextForPlayer(ID,"Nao foi kickado se mexeu a tempo", 3000, 3);
    return true;
}

Creditos
Don_Speed > Criador da FS
Los > Pela dica de inovar


Qualquer Bug Avisa!
Reply
#2

Achei muito basico mais muito ъtil.. 5/10
Reply
#3

Quote:
Originally Posted by Tony_Rodrigues
Посмотреть сообщение
Achei muito basico mais muito ъtil.. 5/10
Pode ser elogiado como pode ser criticado , nao me importo muito com as criticas , mas , aceito elas.
Reply
#4

Bom!
Reply
#5

Simples mais ъtil, уtimo trabalho!
Reply
#6

Muito simples, Cуdigo Ъtil literalmente! Alйm de ter bugs...
Reply
#7

Quote:
Originally Posted by paulor
Посмотреть сообщение
Muito simples, Cуdigo Ъtil literalmente! Alйm de ter bugs...
Acho que й isto.
Reply
#8

Nгo recomendo usar isso em servidores RPG.
Reply
#9

Muito bom mesmo, eu estava pensando em fazer algo similar, mas como o seu estб muito melhor do que havia pensando,desisti kkk.

Quote:
Originally Posted by AFerreira
Посмотреть сообщение
Nгo recomendo usar isso em servidores RPG.
Й, realmente, o unico que serviria pra servidor RPG seria o /acusar com algumas mudanзas.
Reply
#10

Nгo entendi isso ai..
Por que vocк colocou?:
pawn Код:
cmd(afk,playerid,params[])
Nгo seria assim nгo? :S
pawn Код:
cmd:afk(playerid,params[])
2/10
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)