Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2011
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.68 KB | None | 0 0
  1. /*
  2.             +-----------------------------------------------------------+
  3.             |                     Smart AFK Tabbing                     |
  4.             |                       by varthshenon                      |
  5.             |                        <<<<<<>>>>>>                       |
  6.             |                             V1                            |
  7.             |http://forum.sa-mp.com/showthread.php?t=281590             |
  8.             |Stay tuned folks                                           |
  9.             +-----------------------------------------------------------+
  10.                                                                                     */
  11. #if defined _SmartAFKTabbing
  12.     #endinput
  13. #endif
  14. #define _SmartAFKTabbing
  15.  
  16. #include <a_samp>
  17.  
  18. #if !defined AltTabbing
  19.     #define AltTabbing 500
  20. #endif
  21.  
  22. #if !defined AFKing
  23.     #define AFKing 600000
  24. #endif
  25.  
  26. #if !defined Range
  27.     #define Range 20
  28. #endif
  29.  
  30. new bool:IsPlayerAltTabbing[MAX_PLAYERS char],
  31.     bool:IsPlayerAFKing[MAX_PLAYERS char],
  32.     bool:IsPlayerMacroing[MAX_PLAYERS char],
  33.     SAFKTTimer[MAX_PLAYERS][3],
  34.     SAFKTCount[MAX_PLAYERS char],
  35.     Float:SAFKTFloat[MAX_PLAYERS][3],
  36.     Float:SAFKTFloats[3];
  37.  
  38. forward AltTabber(playerid);
  39. forward AFKer(playerid);
  40. forward Macroer(playerid);
  41.  
  42. #if !defined FILTERSCRIPT
  43. public OnGameModeInit()
  44. {
  45.     print( "       +-----------------------------------------------------------+       " );
  46.     print( "       |                     Smart AFK Tabbing                     |       " );
  47.     print( "       |                       by varthshenon                      |       " );
  48.     print( "       |                        <<<<<<>>>>>>                       |       " );
  49.     print( "       |                             V1                            |       " );
  50.     print( "       |http://forum.sa-mp.com/showthread.php?t=281590             |       " );
  51.     print( "       |Stay tuned folks                                           |       " );
  52.     print( "       |Thanks to Y_Less for his foreach and y_ini                 |       " );
  53.     print( "       +-----------------------------------------------------------+       " );
  54.     return CallLocalFunction("SAT_OnGameModeInit","");
  55. }
  56.  
  57. public OnGameModeExit()
  58. {
  59.     print( "       +-----------------------------------------------------------+       " );
  60.     print( "       |                     Smart AFK Tabbing                     |       " );
  61.     print( "       +-----------------------------------------------------------+       " );
  62.     return CallLocalFunction("SAT_OnGameModeExit","");
  63. }
  64. #else
  65. public OnFilterScriptInit()
  66. {
  67.     print( "       +-----------------------------------------------------------+       " );
  68.     print( "       |                     Smart AFK Tabbing                     |       " );
  69.     print( "       |                       by varthshenon                      |       " );
  70.     print( "       |                        <<<<<<>>>>>>                       |       " );
  71.     print( "       |                             V1                            |       " );
  72.     print( "       |http://forum.sa-mp.com/showthread.php?t=281590             |       " );
  73.     print( "       |Stay tuned folks                                           |       " );
  74.     print( "       |Thanks to Y_Less for his foreach and y_ini                 |       " );
  75.     print( "       +-----------------------------------------------------------+       " );
  76.     return CallLocalFunction("SAT_OnFilterScriptInit","");
  77. }
  78.  
  79. public OnFilterScriptExit()
  80. {
  81.     print( "       +-----------------------------------------------------------+       " );
  82.     print( "       |                     Smart AFK Tabbing                     |       " );
  83.     print( "       +-----------------------------------------------------------+       " );
  84.     return CallLocalFunction("SAT_OnFilterScriptExit","");
  85. }
  86. #endif
  87.  
  88. public OnPlayerConnect(playerid)
  89. {
  90.     SAFKTTimer[playerid][0] = SetTimerEx("AltTabber",AltTabbing,1,"d",playerid);
  91.     SAFKTTimer[playerid][1] = SetTimerEx("AFKer",AFKing/10,1,"d",playerid);
  92.     return CallLocalFunction("SAT_OnPlayerConnect","d",playerid);
  93. }
  94.  
  95. public OnPlayerDisconnect(playerid,reason)
  96. {
  97.     KillTimer(SAFKTTimer[playerid][0]);
  98.     KillTimer(SAFKTTimer[playerid][1]);
  99.     KillTimer(SAFKTTimer[playerid][2]);
  100.     return CallLocalFunction("SAT_OnPlayerDisconnect","dd",playerid,reason);
  101. }
  102.  
  103. public OnPlayerUpdate(playerid)
  104. {
  105.     IsPlayerAltTabbing{playerid} = false;
  106.     return CallLocalFunction("SAT_OnPlayerUpdate","d",playerid);
  107. }
  108.  
  109. public AltTabber(playerid)
  110. {
  111.     IsPlayerAltTabbing{playerid} = true;
  112.     return 1;
  113. }
  114.  
  115. public AFKer(playerid)
  116. {
  117.     if(IsPlayerAltTabbing{playerid})
  118.     {
  119.         IsPlayerAFKing{playerid} = false;
  120.         return 1;
  121.     }
  122.     GetPlayerPos(playerid,SAFKTFloats[0],SAFKTFloats[1],SAFKTFloats[2]);
  123.     if(SAFKTFloat[playerid][0] == SAFKTFloats[0] && SAFKTFloat[playerid][1] == SAFKTFloats[1] && SAFKTFloat[playerid][2] == SAFKTFloats[2])
  124.     {
  125.         SAFKTCount{playerid}++;
  126.         if(SAFKTCount{playerid} == 10 && IsPlayerAltTabbing{playerid} == false) IsPlayerAFKing{playerid} = true;
  127.     }
  128.     else
  129.     {
  130.         SAFKTTimer[playerid][2] = SetTimerEx("Macroer",AFKing - 1000,0,"d",playerid);
  131.         IsPlayerAFKing{playerid} = false;
  132.         SAFKTCount{playerid} = 0;
  133.     }
  134.     SAFKTFloat[playerid][0] = SAFKTFloats[0];
  135.     SAFKTFloat[playerid][1] = SAFKTFloats[1];
  136.     SAFKTFloat[playerid][2] = SAFKTFloats[2];
  137.     return 1;
  138. }
  139.  
  140. public Macroer(playerid)
  141. {
  142.     IsPlayerMacroing{playerid} = (IsPlayerInRangeOfPoint(playerid,Range,SAFKTFloat[playerid][0],SAFKTFloat[playerid][1] = SAFKTFloats[1],SAFKTFloat[playerid][2] = SAFKTFloats[2])) ? true : false;
  143.     return 1;
  144. }
  145.  
  146. #if !defined FILTERSCRIPT
  147. #if defined _ALS_OnGameModeInit
  148.     #undef OnGameModeInit
  149. #else
  150.     #define _ALS_OnGameModeInit
  151. #endif
  152. #define OnGameModeInit SAT_OnGameModeInit
  153. forward OnGameModeInit();
  154.  
  155. #if defined _ALS_OnGameModeExit
  156.     #undef OnGameModeExit
  157. #else
  158.     #define _ALS_OnGameModeExit
  159. #endif
  160. #define OnGameModeExit SAT_OnGameModeExit
  161. forward OnGameModeExit();
  162. #else
  163. #if defined _ALS_OnFilterScriptInit
  164.     #undef OnFilterScriptInit
  165. #else
  166.     #define _ALS_OnFilterScriptInit
  167. #endif
  168. #define OnFilterScriptInit SAT_OnFilterScriptInit
  169. forward OnFilterScriptInit();
  170.  
  171. #if defined _ALS_OnFilterScriptExit
  172.     #undef OnFilterScriptExit
  173. #else
  174.     #define _ALS_OnFilterScriptExit
  175. #endif
  176. #define OnFilterScriptExit SAT_OnFilterScriptExit
  177. forward OnFilterScriptExit();
  178. #endif
  179.  
  180. #if defined _ALS_OnPlayerConnect
  181.     #undef OnPlayerConnect
  182. #else
  183.     #define _ALS_OnPlayerConnect
  184. #endif
  185. #define OnPlayerConnect SAT_OnPlayerConnect
  186. forward OnPlayerConnect(playerid);
  187.  
  188. #if defined _ALS_OnPlayerDisconnect
  189.     #undef OnPlayerDisconnect
  190. #else
  191.     #define _ALS_OnPlayerDisconnect
  192. #endif
  193. #define OnPlayerDisconnect SAT_OnPlayerDisconnect
  194. forward OnPlayerDisconnect(playerid,reason);
  195.  
  196. #if defined _ALS_OnPlayerUpdate
  197.     #undef OnPlayerUpdate
  198. #else
  199.     #define _ALS_OnPlayerUpdate
  200. #endif
  201. #define OnPlayerUpdate SAT_OnPlayerUpdate
  202. forward OnPlayerUpdate(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement