afk check doesnt work
#1

OnPlayerConnect

PHP код:
SetTimerEx("AFKCheck"50001"i"playerid); 
PHP код:
forward AFKCheck(playerid);
public 
AFKCheck(playerid)
{
  new 
Float:Pos[3]; 
  for(new 
0MAX_PLAYERSi++)
  {
     
GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
     if(
IsPlayerInRangeOfPoint(i,2,Pos[0],Pos[1],Pos[2])) 
     {
        
AFK[i]++; 
     }
     if(
AFK[i] == 60)
     {
        
AFK[i] = 0;
        
Lounge[i] = true;
        
SetPlayerPos(i, -794.806396,497.738037,1376.195312);
        
SetPlayerInterior(i1);
        
SetPlayerVirtualWorld(i,10);
        
IsPlayerInLobby[i] = 1;
        
SetPlayerHealth(i99999);
        
ResetPlayerWeapons(i);
        new 
string[250];
        
format(stringsizeof(string), "_AFK_%s"PlayerName[i]);
        
SetPlayerName(istring);
        
SetPlayerColor(iCOLOR_GREY);
      }
  }
  return 
1;

I joined a test sv with my friends, he goes afk, but instead changing his nickanem to _AFK_clown, i get it changed to myself instead, there's someting wrong with the "id's" cant figure out.
Reply


Messages In This Thread
afk check doesnt work - by severance - 02.09.2018, 22:20
Re: afk check doesnt work - by solstice_ - 02.09.2018, 22:32
Re: afk check doesnt work - by severance - 02.09.2018, 22:39
Re: afk check doesnt work - by RogueDrifter - 02.09.2018, 23:16
Re: afk check doesnt work - by severance - 02.09.2018, 23:21
Re: afk check doesnt work - by Shinja - 02.09.2018, 23:47

Forum Jump:


Users browsing this thread: 2 Guest(s)