09.01.2015, 20:04
Asн estб todo hecho:
pawn Код:
//=====Detector AFK==========//
new PlayerText3D:pTextLabel[MAX_PLAYERS];
new TiempoAFK[MAX_PLAYERS];
new AFK[MAX_PLAYERS];
new cadena[50];
public OnGameModeInit()
{
SetTimer("DetectarAFK", 60000, true);
return 1;
}
public OnPlayerUpdate(playerid)
{
AFK[playerid] = 0;
return 1;
}
//=============Detectar AFK================//
forward DetectarAFK();
public DetectarAFK()
{
foreach(Player, i)
{
if(AFK[i] == 1)
{
TiempoAFK[i]++;
format(cadena, sizeof(cadena), "{FF8211}Pausado{FFFFFF} [Durante {FFFF00}%i{FFFFFF} minutos]", TiempoAFK[i]);
pTextLabel[i] = Create3DTextLabel(cadena, 0xFFFFFFFF, 30.0, 40.0, 50.0, 40.0, 0, 0);
Attach3DTextLabelToPlayer(pTextLabel[i], i, 0.0, 0.0, 0.5);
}
else
{
Delete3DTextLabel(pTextLabel[i]);
TiempoAFK[i] = 0;
AFK[i] = 1;
}
}
return 1;
}