- Регистрация
- 22 Янв 2018
- Сообщения
- 190
- Лучшие ответы
- 0
- Репутация
- 1
Всем привет! Как сделать, чтобы когда человек стоял в AFK больше минуты показывало так: "AFK: 1:45" (1 минута 45 секунд), а у меня показывает: "AFK: 105 секунд"
PHP:
new stringF[50];
if(GetPVarInt(playerid,"AFK_Tick") > 10000) SetPVarInt(playerid,"AFK_Tick",1), SetPVarInt(playerid,"AFK_Check",0);
if(GetPVarInt(playerid,"AFK_Check") < GetPVarInt(playerid,"AFK_Tick") && GetPlayerState(playerid)) SetPVarInt(playerid,"AFK_Check",GetPVarInt(playerid,"AFK_Tick")), SetPVarInt(playerid,"AFK_Time",0);
if(GetPVarInt(playerid,"AFK_Check") == GetPVarInt(playerid,"AFK_Tick") && GetPlayerState(playerid))
{
SetPVarInt(playerid,"AFK_Time",GetPVarInt(playerid,"AFK_Time") + 1);
if(GetPVarInt(playerid, "AFK_Time") > 2)
{
format(stringF,sizeof(stringF), "{6F97AC}AFK: {FFFFFF}%s секунд",ConvertSeconds(GetPVarInt(playerid, "AFK_Time")-2));
SetPlayerChatBubble(playerid, stringF, COLOR_GREEN, 30.0, 1200);
}
}
if(GetPVarInt(playerid,"AFK_Time") >= 600 && User[playerid][pAdmin] < 2) SendClientMessage(playerid,COLOR_LIGHTRED, "Вы были кикнуты с сервера за длительное время в AFK!"), Kick(playerid);