Gguiz007

Untitled

Apr 18th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. new bool:AFKv [MAX_PLAYERS];
  2. CMD:afk(playerid, params[])
  3. {
  4. if (APlayerData[playerid][LoggedIn] == false) return 0;
  5.  
  6. if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{FF0000}Você está num evento!");
  7. if (InCMEvent[playerid] == true) return SCM(playerid, 0xFF0000FF, "Você está em um evento!");
  8.  
  9. if( GetPVarInt( playerid, "TempoComandoAFK" ) > GetTickCount() ) return SCM( playerid, -1, "{FF0000}Espere um pouco para usar novamente!" );
  10. SetPVarInt( playerid, "TempoComandoAFK", GetTickCount() + 10000 );
  11. APlayerData[playerid][TempoConectado] = false;
  12.  
  13. if (AFKv[playerid] == false)
  14. {
  15.  
  16.  
  17. SCM(playerid, 0xFFFF00FF, "{FFFF00}Você está AFK! Use: {FFFFFF}/afksair{FFFF00} para voltar!");
  18. TogglePlayerControllable(playerid,0);
  19. AFKv[playerid] = true;
  20. new name[128];
  21. GetPlayerName(playerid,name,128);
  22. format(string1, sizeof(string1), "{FFFFFF}%s{FFFF00} está AFK!", name);
  23. SCMA(0xFFFF00FF, string1);
  24. }
  25. return 1;
  26. }
  27.  
  28. CMD:afksair(playerid, params[])
  29. {
  30. if (APlayerData[playerid][LoggedIn] == false) return 0;
  31.  
  32. if(PlayerInfo[playerid][NoEvento] == 1) return SendClientMessage(playerid, -1, "{FF0000}Você está num evento!");
  33. if (InCMEvent[playerid] == true) return SCM(playerid, 0xFF0000FF, "Você está em um evento!");
  34.  
  35. if( GetPVarInt( playerid, "TempoComandoAFK" ) > GetTickCount() ) return SCM( playerid, -1, "{FF0000}Espere um pouco para usar novamente!" );
  36. SetPVarInt( playerid, "TempoComandoAFK", GetTickCount() + 10000 );
  37. APlayerData[playerid][TempoConectado] = 0;
  38.  
  39. if (AFKv[playerid] == true)
  40. {
  41.  
  42.  
  43. AFKv[playerid] = false;
  44. TogglePlayerControllable(playerid,1);
  45. new name[128];
  46. GetPlayerName(playerid,name,128);
  47. format(string1, sizeof(string1), "{FFFFFF}%s{FFFF00} saiu do AFK!", name);
  48. SendClientMessageToAll(0xFFFF00FF, string1);
  49. }
  50. return 1;
  51. }
  52.  
  53. CMD:ausentes(playerid){
  54. new mensagem2[128], nome[MAX_PLAYER_NAME];
  55. for (new i;i <MAX_PLAYERS; i++){
  56. if(AFKv[i] == true){
  57. GetPlayerName(i, nome, sizeof(nome));
  58. format(mensagem2, sizeof(mensagem2), "%s {FFA500}%s (id: {FFA500}%i{FFFFFF}) está {FFA500}ausente {FFFFFF}por: [{FFA500}%s{FFFFFF}]\n", mensagem2, nome, i, Convert(APlayerData[i][TempoConectado]));}}
  59.  
  60. if (strlen(mensagem2) > 0)
  61. ShowPlayerDialog(playerid, adminsoff, DIALOG_STYLE_MSGBOX, "Jogadores ausentes:", mensagem2, "FECHAR", "");
  62. else
  63. SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Não há jogadores ausentes.");
  64. return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment