01.07.2011, 14:38
This may work, try:
PHP код:
new Text3D:text[MAX_PLAYERS];
forward Check();
public OnGameModeInit()
{
SetTimer("Check", 60000, true);
return 1;
}
public Check()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
new Float:Pos[3];
GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
if(GetPVarFloat(i, "X") == Pos[0] && GetPVarFloat(i, "Y") == Pos[1] && GetPVarFloat(i, "Z") == Pos[2])
{
SetPVarInt(i, "AFK", GetPVarInt(i, "AFK") +1);
if(GetPVarInt(i, "AFK") > 1)
{
text[i] = Create3DTextLabel("AFK: Away From Keyboard !",0xFFF600FF,10.0,40.0,10.0,20.0,0);
Attach3DTextLabelToPlayer(text[i], i, 0.0, 0.0, 0.4);
}
}
else { Delete3DTextLabel(text[i]); }
SetPVarFloat(i, "X", Pos[0]);
SetPVarFloat(i, "Y", Pos[1]);
SetPVarFloat(i, "Z", Pos[2]);
}
return 1;
}