Afk system.
#1

Hi people.Maybe anybody have afk system?If player don't move for 2 min,he have attacked 3dtext label.with text "Afk"
Reply
#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
#3

If you just want someone to do it for you, post a request in the stickied thread. I would be glad to help you, but I'm not going to waste my time just writing code for you when you have no desire to learn from it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)