Niko_Hs

N-Afk

Jul 7th, 2011
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.98 KB | None | 0 0
  1. /*
  2. ********************************************************************************
  3. *                      ---=== [Niko_Hs Afk_System] ===---                      *
  4. *                                  "N-Afk System"                              *
  5. *                             *** Versione 1.0 ***                             *
  6. *                              "Copyright @ Niko_Hs"                           *
  7. *                      "In Basso la descrizione dell'[FS]©"                    *
  8. ********************************************************************************
  9. */
  10.  
  11. ////////////////////////////////////////////////////////////////////////////////
  12.  
  13. //Include
  14. #include <a_samp>
  15. ////////////////////////////////////////////////////////////////////////////////
  16.  
  17. //Colori define
  18. #define COLORE_ARANCIONE 0xFF9011AA  // arancione
  19. #define COLORE_BLU 0x33CCFFAA       // blu
  20. #define COLORE_ROSSO 0xED0700AA    // rosso
  21. #define COLORE_BIANCO 0xFFFFFFAA  // bianco
  22. #define COLORE_VERDE 0x33AA33AA  // verde
  23. #define COLORE_VG 0xADFF2FAA     //verde giallastro
  24. #define COLORE_LR 0xF60000AA    //rosso acceso
  25. ////////////////////////////////////////////////////////////////////////////////
  26.  
  27. //Altri define
  28. #define FILTERSCRIPT
  29. #if defined FILTERSCRIPT
  30. ////////////////////////////////////////////////////////////////////////////////
  31.  
  32.  
  33. ////////////////////////////////////////////////////////////////////////////////
  34.  
  35. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  36. //New
  37. new afknome[MAX_PLAYER_NAME];
  38. new string[256];
  39. new BRB[MAX_PLAYERS];
  40. new AFK[MAX_PLAYERS];
  41.  
  42. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  43.  
  44. public OnFilterScriptInit()
  45. {
  46.    print("\n--------------------------------------");
  47.    print(" AFK System V.1.0 By Niko_Hs Caricato.");
  48.    print("--------------------------------------\n");
  49.    return 1;
  50. }
  51.  
  52. public OnFilterScriptExit()
  53. {
  54.    print("\n--------------------------------------");
  55.    print(" [FS] AFK System V.1.0 By Niko_Hs Chiuso.");
  56.    print("--------------------------------------\n");
  57.    return 1;
  58. }
  59.  
  60. #endif
  61. ////////////////////////////////////////////////////////////////////////////////
  62.  
  63. public OnPlayerConnect(playerid)
  64. {
  65. AFK[playerid] = 0;
  66. BRB[playerid] = 0;
  67. return 1;
  68. }
  69. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  70.  
  71. public OnPlayerCommandText(playerid, cmdtext[])
  72. {
  73. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  74.  
  75. if(strcmp(cmdtext, "/afklista", true) == 0)
  76. {
  77. SendClientMessage(playerid,COLORE_ARANCIONE,"Lista Player AFK:");
  78. for(new i = 0; i < MAX_PLAYERS; i++)
  79. {
  80. if(IsPlayerConnected(i))
  81. {
  82. if(BRB[i] == 1 || AFK[i] == 1)
  83. {
  84. GetPlayerName(i,afknome,sizeof(afknome));
  85. format(string,256,"Nome: %s || ID: %i",afknome,i);
  86. SendClientMessage(playerid,COLORE_BIANCO,string);
  87. }
  88. }
  89. }
  90. return 1;
  91. }
  92. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  93.  
  94. if(strcmp(cmdtext, "/brb", true) == 0)  {
  95. if(BRB[playerid] == 0 && AFK[playerid] == 0)
  96. {
  97. GetPlayerName(playerid, afknome, sizeof(afknome));
  98. format(string, sizeof(string), "%s è in una breve pausa! (/brb)", afknome);
  99. SendClientMessageToAll(COLORE_VG, string);
  100. SendClientMessage(playerid, COLORE_BLU, "Sei attualmente BRB. Usa /back per tornare in gioco.");
  101. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 210);
  102.  
  103. BRB[playerid] = 1;
  104. AFK[playerid] = 0;
  105. return 1;
  106. }
  107. else
  108. {
  109. SendClientMessage(playerid,COLORE_BLU, "Sei attualmente BRB. Usa /back per tornare in gioco.");
  110. return 1;
  111. }
  112. }
  113. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  114.  
  115. if(strcmp(cmdtext, "/back", true) == 0)
  116. {
  117. if(BRB[playerid] == 1 || AFK[playerid] == 1)
  118. {
  119. GetPlayerName(playerid, afknome, sizeof(afknome));
  120. format(string, sizeof(string), "%s è tornato in gioco. (/back)", afknome);
  121. SendClientMessageToAll(COLORE_VG, string);
  122. SetPlayerVirtualWorld(playerid, 0);
  123. BRB[playerid] = 0;
  124. AFK[playerid] = 0;
  125. return 1;
  126. }
  127. else
  128. {
  129. SendClientMessage(playerid,COLORE_BLU, "Sei tornato in gioco.");
  130. return 1;
  131. }
  132. }
  133. //><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
  134.  
  135. if(strcmp(cmdtext, "/afk", true) == 0)
  136. {
  137. if(BRB[playerid] == 0 && AFK[playerid] == 0)
  138. {
  139. GetPlayerName(playerid, afknome, sizeof(afknome));
  140. format(string, sizeof(string), "%s è andato in Pausa.(/afk)", afknome);
  141. SendClientMessageToAll(COLORE_VG, string);
  142. SendClientMessage(playerid, COLORE_BLU, "Sei AFK digita (/back) per tornare in gioco.");
  143. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid) + 123);
  144. BRB[playerid] = 0;
  145. AFK[playerid] = 1;
  146. return 1;
  147. }
  148. else
  149. {
  150. SendClientMessage(playerid, COLORE_BLU, "Sei AFK digita (/back) per tornare in gioco.");
  151. return 1;
  152. }
  153. }
  154. return 0;
  155. }
  156. ////////////////////////////////////////////////////////////////////////////////
  157. //Usa /brb , /afk , /back , /afklista.
  158.  
  159. //NON RIMUOVERE I CREDITI :D
  160. ////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment