Advertisement
Rapha3L

[FS]Sistema AFK

Jun 17th, 2013
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.94 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //                               [FS]Sistema AFK                              //
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // Autor: Rapha3L                                                             //
  5. // Versão: 1.0                                                                   //
  6. // Ultima Modificação: 17-06-2013                                             //
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // Créditos: SA-MP Team/Wiki                                                  //
  9. ////////////////////////////////////////////////////////////////////////////////
  10.  
  11. //---[Includes]---//
  12.  
  13. #include <a_samp>
  14. #include <zcmd>
  15.  
  16. //---[Defines]---//
  17.  
  18. #define TEXTO_UM 0xFFFF00AA
  19. #define TEXTO_DOIS 0x33AA33AA
  20. #define ID_Player 0x2E8B57AA
  21. #define Nome_Player 0x3CB371AA
  22. #define texto_normal 0x20B2AAAA
  23.  
  24. //---[Variáveis]---//
  25.  
  26. new AFK[MAX_PLAYERS];
  27.  
  28. //---[Comandos]---//
  29.  
  30. CMD:afk(playerid,params[])
  31. {
  32.         new string[128];
  33.         format(string,sizeof(string),"{3CB371}%s{2E8B57}(%d) {20B2AA}Está neste momento AFK.", PlayerName(playerid), playerid);
  34.         SendClientMessageToAll(TEXTO_UM, string);
  35.         SendClientMessage(playerid,TEXTO_DOIS,"Quando voltares faz o comando /voltar");
  36.         AFK[playerid] =1;
  37.         TogglePlayerControllable(playerid, 0);
  38.         return 1;
  39.     }
  40.  
  41. CMD:voltar(playerid,params[])
  42. {
  43.         new string[128];
  44.         format(string,sizeof(string),"{3CB371}%s{2E8B57}(%d) {20B2AA}Está novamente activo.", PlayerName(playerid), playerid);
  45.         SendClientMessageToAll(TEXTO_UM, string);
  46.         SendClientMessage(playerid,TEXTO_DOIS,"Faz o comando /afk se ficares longe do teclado.");
  47.         AFK[playerid] =0;
  48.         TogglePlayerControllable(playerid, 1);
  49.         return 1;
  50.     }
  51.  
  52. //---[%s e %d]---//
  53.  
  54. stock PlayerName(playerid)
  55. {
  56.   new name[255];
  57.   GetPlayerName(playerid, name, 255);
  58.   return name;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement