Advertisement
Guest User

Pastebin Strcmp

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