Advertisement
Guest User

Agendar Cadeia.

a guest
Dec 13th, 2012
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5. #include <sscanf>
  6.  
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print(" Blank Filterscript by Danniel ");
  13. print("--------------------------------------\n");
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. #else
  23.  
  24. CMD:agendarcadeia(sscanf,playerid, params[])
  25. {
  26. if(IsPlayerConnected(playerid))
  27. {
  28. new playa[64];
  29. new money;
  30. playa = strtok(cmdtext, idx);
  31. tmp = strtok(cmdtext, idx);
  32. if(!strlen(playa))
  33. {
  34. SendClientMessage(playerid, COLOR_GRAD2, "USE: /agendarcadeia [Nome] [Tempo(Minutos)] [Motivo]");
  35. return 1;
  36. }
  37. money = strval(tmp);
  38. if (PlayerInfo[playerid][pAdmin] >= 1)
  39. {
  40. if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1341)
  41. {
  42. SendClientMessage(playerid, COLOR_GRAD1, "Você não está trabalhando! (/trabalhar)");
  43. return 1;
  44. }
  45. new length = strlen(cmdtext);
  46. while ((idx < length) && (cmdtext[idx] <= ' '))
  47. {
  48. idx++;
  49. }
  50. new offset = idx;
  51. new result[64];
  52. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  53. {
  54. result[idx - offset] = cmdtext[idx];
  55. idx++;
  56. }
  57. result[idx - offset] = EOS;
  58. if(!strlen(result))
  59. {
  60. SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo(Minutos)] [motivo]");
  61. return 1;
  62. }
  63. new arquivo[64];
  64. format(arquivo, sizeof(arquivo), "AgendarCadeia/%s.log",playa);
  65. GetPlayerName(playerid, sendername, sizeof(sendername));
  66. if(!dini_Exists(arquivo))
  67. {
  68. SendClientMessage(playerid, COLOR_GRAD1, " Este Player Não está Registrado no Servidor!");
  69. return true;
  70. }
  71. format(arquivo, sizeof(arquivo), "AgendadorCadeia%s.log",playa);
  72. if(dini_Exists(arquivo))
  73. {
  74. dini_Set(arquivo,"Admin",sendername);
  75. dini_Set(arquivo,"Motivo",result);
  76. dini_IntSet(arquivo,"Tempo",money);
  77. }
  78. else
  79. {
  80. dini_Create(arquivo);
  81. dini_Set(arquivo,"Admin",sendername);
  82. dini_Set(arquivo,"Motivo",result);
  83. dini_IntSet(arquivo,"Tempo",money);
  84. }
  85. format(gstring,sizeof(gstring), "AdmAviso: %s Agendou %s, Tempo %d Minutos, Motivo: %s", sendername,playa,money,result);
  86. ABroadCast(COLOR_YELLOW,gstring,1);
  87. }
  88. else
  89. {
  90. SendClientMessage(playerid, COLOR_GRAD1, " Você não tem permissao para usar esse comando!");
  91. }
  92. }
  93. return 1;
  94. }
  95. public StatusPlayer(idcheck, playerid)
  96. {
  97. new arquivo[64], dannielowna, NomedaOrg[64], DemitiuMotivo[64],
  98. DemitiuNome[64], PresoMotivo[64], PresoNome[64];
  99. if(idcheck == 1)
  100. {
  101. format(arquivo, sizeof(arquivo), "Agendados/JAIL%s.ini",PlayerName(playerid));
  102. if(dini_Exists(arquivo))
  103. {
  104. strmid(PresoNome, dini_Get(arquivo,"Admin"), 0, strlen(dini_Get(arquivo,"Admin")), 255);
  105. strmid(PresoMotivo, dini_Get(arquivo,"Motivo"), 0, strlen(dini_Get(arquivo,"Motivo")), 255);
  106. dannielowna = dini_Int(arquivo,"Tempo");
  107. format(gstring, sizeof(gstring), "* Admin %s Agendou Sua Prisão, Motivo: %s.", PresoNome,PresoMotivo);
  108. SendClientMessage(playerid, COLOR_LIGHTRED, gstring);
  109. format(gstring, sizeof(gstring), "Você foi preso por %d Minutos Automaticamente, Agendado pelo Admin.", dannielowna);
  110. SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
  111. GameTextForPlayer(playerid, "~b~Bem Vindo a ~n~~r~~h~Cadeia Admin", 5000, 3);
  112. WantedPoints[playerid] = 0;
  113. ResetPlayerWeapons(playerid);
  114. SetPlayerWantedLevel(playerid, 0);
  115. PlayerInfo[playerid][pJailed] = 2;
  116. PlayerInfo[playerid][pJailTime] = dannielowna * 60;
  117. SetPlayerPos(playerid, 346.5848, 306.1026, 999.1484);
  118. SetPlayerInterior(playerid,6);
  119. format(gstring, sizeof(gstring), "AdmAviso: {80E3FF}%s {E84F33} Está Agendado e Foi preso, Motivo: %s",PlayerName(playerid) ,PresoMotivo);
  120. ABroadCast(COLOR_LIGHTRED,gstring,1);
  121. fremove(arquivo);
  122. }
  123. return 1;
  124. }
  125.  
  126. #endif
  127.  
  128. //Baixado na www.HomeHots.net, Sistema criado por Danniel_Style, não retire os créditos!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement