Guest User

Zezombia

a guest
Nov 23rd, 2008
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Sent[MAX_PLAYERS];
  4. new Connected[MAX_PLAYERS];
  5.  
  6. forward Go();
  7. forward Check();
  8.  
  9. public OnPlayerConnect(playerid)
  10. {
  11.     Connected[playerid] = 3;
  12. }
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     SetTimer("Go", 2000, 1);
  17. }
  18.  
  19. public OnPlayerUpdate(playerid)
  20. {
  21.     Sent[playerid] = 1;
  22.     return 1;
  23. }
  24.  
  25. public Go()
  26. {
  27.     for(new i = 0; i < GetMaxPlayers(); i++)
  28.     {
  29.         Sent[i] = 0;
  30.     }
  31.     SetTimer("Check", 1000, 0);
  32. }
  33.  
  34. public Check()
  35. {
  36.     for(new i = 0; i < GetMaxPlayers(); i++)
  37.     {
  38.         if(IsPlayerConnected(i) == 1)
  39.         {
  40.             if(Connected[i] == 0)
  41.             {
  42.                 if(Sent[i] == 0)
  43.                 {
  44.                     Kick(i);
  45.                 }
  46.             }
  47.             else
  48.             {
  49.                 Connected[i]--;
  50.             }
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment