[Ajuda] com SetTimer
#1

galera e o seguinte to tentando fazer um sistema de verificar o player de esc. pelo q andei lendo onplayerupdate decha de ser atualizado quando o player fica esc. O problema e que o status do player depois q da esc nao muda.

PHP код:
enum AFKInfo
{
    
AFKTimerEx,
    
AFKPause,
    
AFKPlay
};
new 
CheckAFKInfo[MAX_PLAYERS][AFKInfo];
public 
OnPlayerConnect(playerid)
{
    
CheckAFKInfo[playerid][AFKPlay] = 1;
    
CheckAFKInfo[playerid][AFKPause] = 0;
    
CheckAFKInfo[playerid][AFKTimerEx] = SetTimerEx("CheckPausePlayer"500true"i",playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(CheckAFKInfo[playerid][AFKTimerEx]);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    
CheckAFKInfo[playerid][AFKPlay] = 1;
    
CheckAFKInfo[playerid][AFKPause] = 0;
    return 
1;
}
stock CheckPausePlayer(playerid)
{
    
CheckAFKInfo[playerid][AFKPlay]++;
    if(
CheckAFKInfo[playerid][AFKPlay] > 4)
    {
       
CheckAFKInfo[playerid][AFKPause] = 1;
       
CheckAFKInfo[playerid][AFKPlay] = 0;
    }
    else
    {
       
CheckAFKInfo[playerid][AFKPause] = 0;
       
CheckAFKInfo[playerid][AFKPlay] = 1;
    }
    return 
1;
}
stock PlayerPause(playerid)
{
    if(
CheckAFKInfo[playerid][AFKPause] == && CheckAFKInfo[playerid][AFKPlay] == 0)
    {
        return 
1;
    }
    return 
0;
}
stock PlayerPlay(playerid)
{
    if(
CheckAFKInfo[playerid][AFKPause] == && CheckAFKInfo[playerid][AFKPlay] == 1)
    {
        return 
1;
    }
    return 
0;

Reply


Messages In This Thread
com SetTimer - by lucas_mdr1235 - 09.05.2015, 23:04
Re: com SetTimer - by Gii - 09.05.2015, 23:52
Re: com SetTimer - by JonathanFeitosa - 10.05.2015, 10:48
Re: com SetTimer - by Lуs - 10.05.2015, 11:37
Re: com SetTimer - by lucas_mdr1235 - 10.05.2015, 14:53

Forum Jump:


Users browsing this thread: 1 Guest(s)