[FilterScript] Sistema de afk por tempo
#4

Se eu fosse usar, eu faria dessa forma;


PHP код:
// sгo dois arquivos. caso alguйm nгo tenha entendido.
/*
#  db   db d88888b  .d8b.  d8888b. d88888b d8888b.    d888888b d8b   db  .o88b. 
#  88   88 88'     d8' `8b 88  `8D 88'     88  `8D      `88'   888o  88 d8P  Y8 
#  88ooo88 88ooooo 88ooo88 88   88 88ooooo 88oobY'       88    88V8o 88 8P      
#  88~~~88 88~~~~~ 88~~~88 88   88 88~~~~~ 88`8b         88    88 V8o88 8b      
#  88   88 88.     88   88 88  .8D 88.     88 `88. db   .88.   88  V888 Y8b  d8 
#  YP   YP Y88888P YP   YP Y8888D' Y88888P 88   YD VP Y888888P VP   V8P  `Y88P' 
*/
#if defined _inc_header
    #undef _inc_header
#endif
#include <YSI\y_groups>
#include <YSI\y_commands>
#include <YSI\y_hooks>
new 
    
Group:Group_AFK,
    
Player_Name[MAX_PLAYERS][MAX_PLAYER_NAME],
    
Player_TimeAfk[MAX_PLAYERS];
/* 
#  d88888b d8b   db d8888b.       .d88b.  d88888b      d88888b d888888b db      d88888b 
#  88'     888o  88 88  `8D      .8P  Y8. 88'          88'       `88'   88      88'     
#  88ooooo 88V8o 88 88   88      88    88 88ooo        88ooo      88    88      88ooooo 
#  88~~~~~ 88 V8o88 88   88      88    88 88~~~        88~~~      88    88      88~~~~~ 
#  88.     88  V888 88  .8D      `8b  d8' 88           88        .88.   88booo. 88.     
#  Y88888P VP   V8P Y8888D'       `Y88P'  YP           YP      Y888888P Y88888P Y88888P 
*/
// [...]
// [...]
// [...]
/*
#  d888888b .88b  d88. d8888b. db         d888888b d8b   db  .o88b. 
#    `88'   88'YbdP`88 88  `8D 88           `88'   888o  88 d8P  Y8 
#     88    88  88  88 88oodD' 88            88    88V8o 88 8P      
#     88    88  88  88 88~~~   88            88    88 V8o88 8b      
#    .88.   88  88  88 88      88booo. db   .88.   88  V888 Y8b  d8 
#  Y888888P YP  YP  YP 88      Y88888P VP Y888888P VP   V8P  `Y88P' 
*/
#if defined _inc_impl
    #undef _inc_impl
#endif
hook OnGameModeInit()
{
    
Group_AFK Group_Create("AFK");
    return 
true;
}
hook OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridPlayer_Name[playerid], MAX_PLAYER_NAME);
    return 
true;
}
YCMD:ausentes(playeridparams[], help
{
    new
        
tmp_str[128];
    
SendClientMessage(playerid, -1"Exibindo jogadores ausentes:");
    foreach(new 
GroupMember(Group_AFK))
    {
        
format(tmp_strsizeof tmp_str"  %s - %i"Player_Name[playerid], gettime() - Player_TimeAfk[playerid]);
        
SendClientMessage(playerid, -1tmp_str);
    }
    return 
true;
}
YCMD:afk(playeridparams[], help
{
    if(
Group_GetPlayer(Group_AFKplayerid))
    {
        
Group_SetPlayer(Group_AFKplayeridfalse);
        
SendClientMessage(playerid, -1"Vocк nгo esta mais afk.");
    }
    else
    {
        
Group_SetPlayer(Group_AFKplayeridtrue);
        
SendClientMessage(playerid, -1"Agora vocк esta ausente.");
        
Player_TimeAfk[playerid] = gettime();
    }
    return 
true;
}
/* 
#  d88888b d8b   db d8888b.       .d88b.  d88888b      d88888b d888888b db      d88888b 
#  88'     888o  88 88  `8D      .8P  Y8. 88'          88'       `88'   88      88'     
#  88ooooo 88V8o 88 88   88      88    88 88ooo        88ooo      88    88      88ooooo 
#  88~~~~~ 88 V8o88 88   88      88    88 88~~~        88~~~      88    88      88~~~~~ 
#  88.     88  V888 88  .8D      `8b  d8' 88           88        .88.   88booo. 88.     
#  Y88888P VP   V8P Y8888D'       `Y88P'  YP           YP      Y888888P Y88888P Y88888P 
*/ 
bom trabalho, mano.
Reply


Messages In This Thread
Sistema de afk por tempo - by Gguiz - 02.11.2017, 04:20
Re: Sistema de afk por tempo - by RogerX - 02.11.2017, 10:27
Re: Sistema de afk por tempo - by Don_Speed - 02.11.2017, 11:15
Re: Sistema de afk por tempo - by Naine - 02.11.2017, 12:04
Re: Sistema de afk por tempo - by ScripitrFaunu - 02.11.2017, 13:20
Re: Sistema de afk por tempo - by Gguiz - 02.11.2017, 15:47
Re: Sistema de afk por tempo - by Benner - 02.11.2017, 18:38
Re: Sistema de afk por tempo - by Gguiz - 02.11.2017, 18:45
Re: Sistema de afk por tempo - by Benner - 02.11.2017, 18:48
Re: Sistema de afk por tempo - by CezarBR - 02.11.2017, 21:45

Forum Jump:


Users browsing this thread: 1 Guest(s)