Guest User

Untitled

a guest
Oct 17th, 2010
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.68 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define Vermelho                                                                0xFF0000AA
  4. #define Amarelo                                                                 0xFFFF00AA
  5.  
  6.  
  7.  
  8. new
  9.  
  10.         SistemaAFK[MAX_PLAYERS],
  11.         Nome[30],
  12.         PegarNome[MAX_PLAYERS],
  13.         pNameOriginal[MAX_PLAYERS][MAX_PLAYER_NAME],
  14.         Text:Text,Text:textoafk
  15. ;
  16.  
  17.  
  18.  
  19.  
  20. public OnPlayerCommandText(playerid, cmdtext[])
  21. {
  22.     if(SistemaAFK[playerid] == 1 && strcmp(cmdtext,"/AFK", true) != 0) return SendClientMessage(playerid,Vermelho,"Você não pode falar e nem digitar comand enquanto estiver AFK!");
  23.  
  24.     if(strcmp(cmdtext,"/AFK", true) == 0)
  25.         {
  26.             if(SistemaAFK[playerid] == 0)
  27.                  {
  28.                       SistemaAFK[playerid] = 1;
  29.                       TogglePlayerControllable(playerid, 0);
  30.                       TextDrawShowForPlayer(playerid,Text);
  31.                       TextDrawShowForPlayer(playerid,textoafk);
  32.                       PegarNome[playerid] = GetPlayerName(playerid, Nome, sizeof(Nome));
  33.                       SendClientMessage(playerid,Amarelo,"Você está em AFK, e não pode digitar nenhum comando e nem falar.");
  34.  
  35.                       GetPlayerName(playerid, pNameOriginal[playerid], sizeof pNameOriginal);
  36.  
  37.                       new nometemp[MAX_PLAYER_NAME];
  38.                       format(nometemp, sizeof nometemp, "[AFK]%s", pNameOriginal[playerid]);
  39.                       SetPlayerName(playerid, nometemp);
  40.                       new string[128];
  41.                       format(string, sizeof string,"%s está em modo AFK! ( /AFK )",nometemp);SendClientMessageToAll(Amarelo,string);
  42.                       SetPlayerVirtualWorld(playerid, 5);//
  43.                  }
  44.             else if(SistemaAFK[playerid] == 1)
  45.                  {
  46.                       SistemaAFK[playerid] = 0;
  47.                       TogglePlayerControllable(playerid, 1);
  48.                       TextDrawHideForPlayer(playerid,Text);
  49.                       TextDrawHideForPlayer(playerid,textoafk);
  50.                       SetPlayerName(playerid,PegarNome[playerid]);
  51.                       SendClientMessage(playerid,Amarelo,"Você saiu do AFK,poriso Está Livre Para Jogar :D");
  52.                       new string[128];
  53.                       SetPlayerName(playerid, pNameOriginal[playerid]);
  54.                       format(string, sizeof string,"%s saiu do modo AFK, pode mata-lo ( /AFK ).",pNameOriginal[playerid]);SendClientMessageToAll(Amarelo,string);
  55.                       SetPlayerVirtualWorld(playerid, 0);//
  56.                  }
  57.             return 1;
  58.     }
  59.     return 0;
  60. }
  61.  
  62. public OnPlayerText(playerid, text[])
  63. {
  64.  if(SistemaAFK[playerid] == 1)
  65.     {
  66.        SendClientMessage(playerid,Vermelho," Você não pode falar em quanto tiver em AFK, Digite /AFK novamente para sair");
  67.        return 0;
  68.     }
  69.  return 1;
  70. }
  71.  
  72.  
  73. public OnGameModeInit()
  74. {
  75.     Text = TextDrawCreate(0,0,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
  76.     TextDrawUseBox(Text, 1);
  77.     TextDrawBoxColor(Text, 0x2E2E2E55);
  78.  
  79.  
  80.     textoafk = TextDrawCreate(46.000000, 170.000000, "Para Sair AFK digite /AFK novamente.~n~emquando estiver AFK, nao podera digitar comandos e~n~ nem falar");
  81.     TextDrawBackgroundColor(textoafk, -16776961);
  82.     TextDrawFont(textoafk, 1);
  83.     TextDrawLetterSize(textoafk, 0.519999, 2.000000);
  84.     TextDrawColor(textoafk, 255);
  85.     TextDrawSetOutline(textoafk, 1);
  86.     TextDrawSetProportional(textoafk, 1);
  87.     return 1;
  88. }
Advertisement
Add Comment
Please, Sign In to add comment