Auto Afk problem
#1

I made this auto afk system as you can see below and i want it to check if the player is afk ,onduty, jailed or logged in as rcon admin, it will only do what it is told as shown below. But if the player is offduty, not jailed, afk or is an rcon admin it should do as told below.. The problem is it wont send the messages and when the player returns they are automatically killed.

PHP код:
public OnPlayerPause(playerid)
{
if(
Afk[playerid] == 0)
    {
        if(
IsPlayerAdmin(playerid) || pInfo[playerid][OnDuty] == || pInfo[playerid][Jailed] >= || pInfo[playerid][OnhDuty] == 1)
        {
         
SendClientMessage(playeridgrey,"[AFK]: Your status has been Automatically set to Paused.");
            
afklabel[playerid] = Create3DTextLabel("Player is Away [AFK]"0xFFFF00FF30.040.050.040.00);
            
Attach3DTextLabelToPlayer(afklabel[playerid], playerid0.00.00.7);
             
Afk[playerid] = 1;
        }
}
    else
    {
        
SendClientMessage(playeridgrey,"[AFK]: Your status has been Automatically set to Paused.");
        
SendClientMessage(playeridgrey,"[AFK]: You have 10 minutes to return or you will be kicked get kick.");
        
AFKtimer SetTimerEx("AFK"6000000"i"playerid);
        
afklabel[playerid] = Create3DTextLabel("Player is Away [AFK]"0xFFFF00FF30.040.050.040.00);
        
Attach3DTextLabelToPlayer(afklabel[playerid], playerid0.00.00.7);
         
Afk[playerid] = 1;
        
GetPlayerHealth(playeridafkH[playerid]);
        
SetPlayerHealth(playerid,300000);
        
GetPlayerArmour(playeridafkA[playerid]);
        
SetPlayerArmour(playerid,100000);
        
TogglePlayerControllable(playerid,0);
    }
    return 
1;
}
public 
OnPlayerResume(playeridtime)
{
    Return(
playerid);
    
KillTimer(AFKtimer);
    new 
string[48];
    
format(stringsizeof(string), "[AFK]: Welcome Back, you were paused for %i milliseconds."time);
    
SendClientMessage(playeridcoolbluestring);
    return 
1;
}
stock Return(playerid)
{
    
Afk[playerid] = 0;
    
SetPlayerHealth(playeridafkH[playerid]);
    
SetPlayerArmour(playeridafkA[playerid]);
    
TogglePlayerControllable(playerid,1);
    
Delete3DTextLabel(afklabel[playerid]);

Reply
#2

bump
Reply
#3

Edit: sorry, I don't see it for the first time.
Reply
#4

u blind m8?

AFKtimer = SetTimerEx("AFK", 600000, 0, "i", playerid);

And why would he post it for u? It is does not related to what he wants.

Show me your enum data for your saving system, Might help in jail status.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)