Guest User

[FS] Sistema AFK + Motivo [zcmd] | @Riichard

a guest
Apr 14th, 2012
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.55 KB | None | 0 0
  1. /*
  2.                   ______________________________
  3.                  |  System AFK Dialog [Motivo]  |
  4.                  |  By - @Riichard (OwnPlaay)   |
  5.                  |  Não Retire os Creditos!     |
  6.                  |______________________________|
  7.  
  8. */
  9. #include < a_samp >
  10. #include < zcmd >
  11. #define SystemAFK 420 // ID Já Usada? Modifique.
  12. #define Vermelho 0xFF0000AA
  13. #define Amarelo 0xFFFF28AA
  14. new Afk[MAX_PLAYERS];
  15. // ======= [ AFK ] ======= //
  16. #if defined FILTERSCRIPT
  17.  
  18. public OnFilterScriptInit() {
  19.     print("\n AFK Em Dialog + Motivo - @Riichard");
  20.     return 1;
  21. }
  22. #else
  23.  
  24. #endif
  25. // Entrou AFK
  26. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  27.     if (dialogid == SystemAFK) {
  28.         if (response) {
  29.             new Float: X,
  30.             Float: Y,
  31.             Float: Z;
  32.             new str[200];
  33.             GetPlayerName(playerid, str, sizeof(str));
  34.             format(str, sizeof(str), "{41FF20}%s(ID:%d){9C9C9C} » Entrou em Modo {41FF20}(AFK/Ausente) {9C9C9C}[Motivo: %s]", str, playerid, inputtext[0]);
  35.             SendClientMessageToAll(-1, str);
  36.             SendClientMessageToAll(0x9C9C9CAA, "Vejá quem está em Modo Ausente/AFK » {FFFF00}/AFKs");
  37.             TogglePlayerControllable(playerid, 0);
  38.             SetPlayerHealth(playerid, 99999999.9);
  39.             SetCameraBehindPlayer(playerid);
  40.             GetPlayerPos(playerid, X, Y, Z);
  41.             SetPlayerPos(playerid, X, Y, Z + 80);
  42.             SendClientMessage(playerid, 0x20B2AAAA, "Você entrou em Modo Ausente. Use : /On.");
  43.         }
  44.     }
  45.     return 1;
  46. }
  47. // Connect Mensagem FS
  48. public OnPlayerConnect(playerid) {
  49.     SendClientMessage(playerid, Amarelo, "» Sistema AFK em Dialog + Motivo. /AFK");
  50.     Afk[playerid] = 0;
  51.     return 1;
  52. }
  53. // Comando AFK
  54.  
  55. CMD:on(playerid)
  56. {
  57. if (Afk[playerid] == 1)
  58. {
  59.             Afk[playerid] = 0;
  60.             new str[200];
  61.             GetPlayerName(playerid, str, sizeof(str));
  62.             format(str, sizeof(str), "{41FF20}%s(ID:%d){9C9C9C} » Saiu do Modo {41FF20}(AFK/Ausente)", str, playerid);
  63.             SendClientMessageToAll(-1, str);
  64.             new Float: X,
  65.             Float: Y,
  66.             Float: Z;
  67.             TogglePlayerControllable(playerid, 1);
  68.             SetPlayerHealth(playerid, 100.0);
  69.             GetPlayerPos(playerid, X, Y, Z);
  70.             SetPlayerPos(playerid, X, Y, Z - 80);
  71.             SendClientMessage(playerid, 0x00FF7FAA, "Bem Vindo de Volta :)");
  72.             }
  73.             else
  74.             {
  75.             SendClientMessage(playerid, Vermelho, "[FAIL] » Você não Está Ausente ");
  76.             return 1;
  77.         }
  78. return 1;
  79. }
  80.  
  81.  
  82. CMD:afk(playerid)
  83. {
  84. if (Afk[playerid] == 0)
  85. {
  86.             Afk[playerid] = 1;
  87.             ShowPlayerDialog(playerid, SystemAFK, DIALOG_STYLE_INPUT, "» AFK System V1", "Porque Motivo Vai Ficar Ausente:", "Ausentar", "Cancelar");
  88.                     }
  89.             else
  90.             {
  91.             SendClientMessage(playerid, Vermelho, "[FAIL] » Você ja Está Ausente ");
  92.             return 1;
  93.         }
  94. return 1;
  95. }
  96.  
  97. CMD:afks(playerid)
  98. {
  99.         SendClientMessage(playerid, -1, "{696969}______[ {00CED1}Jogadores Ausente {696969}]______");
  100.         for (new i = 0; i < MAX_PLAYERS; i++)
  101.         {
  102.             if (IsPlayerConnected(i))
  103.             {
  104.                 if (Afk[i] == 1)
  105.                 {
  106.                     new Name[24];
  107.                     new String1[258];
  108.                     GetPlayerName(i, Name, sizeof(Name));
  109.                     format(String1, 256, "{696969}Player : {00CED1}%s(ID:%d)", Name, playerid);
  110.                     SendClientMessage(playerid, -1, String1);
  111.                 }
  112.             }
  113. }
  114.         return 1;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment