Afk system.
#2

This may work, try:

PHP код:
new Text3D:text[MAX_PLAYERS];

forward Check();

public 
OnGameModeInit()
{
    
SetTimer("Check"60000true);
    return 
1;
}

public 
Check()
{
    for(new 
0MAX_PLAYERS++)
    {
        new 
Float:Pos[3];
        
GetPlayerPos(iPos[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], i0.00.00.4);
            }
        }
        else { 
Delete3DTextLabel(text[i]); }
        
SetPVarFloat(i"X"Pos[0]);
        
SetPVarFloat(i"Y"Pos[1]);
        
SetPVarFloat(i"Z"Pos[2]);
    }
    return 
1;

Reply


Messages In This Thread
Afk system. - by budelis - 01.07.2011, 13:53
Re: Afk system. - by Shadoww5 - 01.07.2011, 14:38
Re: Afk system. - by Revolutionary Roleplay - 01.07.2011, 15:04

Forum Jump:


Users browsing this thread: 1 Guest(s)