Advertisement
Guest User

Matuto

a guest
Oct 20th, 2017
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. // SISTEMA DE MATUTO ( ENTREGADOR DE ARMAS ) //
  2. // CRIADO POR: Victor Soares RATO22 //
  3. // DATA: 20/10/2017 //
  4. // OB's: quando estava fazendo isso estava chapadão kaksdkas //
  5. #include <a_samp>
  6. #include <Zcmd>
  7. #include <sscanf2>
  8. #include <cpstream>
  9.  
  10. #define DIALOG_ENTREGA 8596
  11. #define Matuto "Matuto/%s.ini"
  12.  
  13. new EntregandoArmas[MAX_PLAYERS],
  14. EntregandoDrogas[MAX_PLAYERS],
  15. EntregandoMunicoes[MAX_PLAYERS],
  16. Entregou[MAX_PLAYERS];
  17.  
  18. new Armas,
  19. Drogas,
  20. Municoes;
  21.  
  22. #if defined FILTERSCRIPT
  23. main()
  24. {
  25. print("Sistema de Matuto by Rato22");
  26. }
  27.  
  28. public OnFilterScriptInit()
  29. {
  30. CarregarMatuto();
  31. return 1;
  32. }
  33.  
  34. public OnFilterScriptExit()
  35. {
  36. SalvarMatuto();
  37. return 1;
  38. }
  39.  
  40. #else
  41. #endif
  42.  
  43. public OnPlayerConnect(playerid)
  44. {
  45. SendClientMessage(playerid, -1, "Sistema de Matuto feito por Rato22");
  46. EntregandoArmas[playerid] = 0;
  47. EntregandoDrogas[playerid] = 0;
  48. EntregandoMunicoes[playerid] = 0;
  49. Entregou[playerid] = 0;
  50. return 1;
  51. }
  52.  
  53. public OnPlayerDisconnect(playerid, reason)
  54. {
  55. EntregandoArmas[playerid] = 0;
  56. EntregandoDrogas[playerid] = 0;
  57. EntregandoMunicoes[playerid] = 0;
  58. Entregou[playerid] = 0;
  59. return 1;
  60. }
  61.  
  62.  
  63. public OnPlayerCommandText(playerid, cmdtext[])
  64. {
  65. return 0;
  66. }
  67. CMD:entregar(playerid)
  68. {
  69. ShowPlayerDialog(playerid, DIALOG_ENTREGA, DIALOG_STYLE_LIST, "Tipos de entregas", "Armas\nDrogas\nMunições", "Selecionar", "Cancelar");
  70. return 1;
  71. }
  72. CMD:cancelar(playerid)
  73. {
  74. if(EntregandoArmas[playerid] == 1){
  75. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Armas");
  76. EntregandoArmas[playerid] = 0;
  77. //Fim do código
  78. }
  79. if(EntregandoDrogas[playerid] == 1){
  80. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Drogas");
  81. EntregandoDrogas[playerid] = 0;
  82. //Fim do código
  83. }
  84. if(EntregandoMunicoes[playerid] == 1){
  85. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Munições");
  86. EntregandoMunicoes[playerid] = 0;
  87. //Fim do código
  88. }
  89. return 1;
  90. }
  91.  
  92.  
  93. public OnPlayerExitVehicle(playerid, vehicleid)
  94. {
  95. if(EntregandoArmas[playerid] == 1){
  96. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Armas");
  97. EntregandoArmas[playerid] = 0;
  98. //Fim do código
  99. }
  100. if(EntregandoDrogas[playerid] == 1){
  101. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Drogas");
  102. EntregandoDrogas[playerid] = 0;
  103. //Fim do código
  104. }
  105. if(EntregandoMunicoes[playerid] == 1){
  106. SendClientMessage(playerid, -1, "Você cancelou a Entrega de Munições");
  107. EntregandoMunicoes[playerid] = 0;
  108. //Fim do código
  109. }
  110. return 1;
  111. }
  112.  
  113.  
  114. public OnPlayerEnterCheckpoint(playerid)
  115. {
  116. if(EntregandoArmas[playerid] == 1){
  117. SendClientMessage(playerid, -1, "Você efetuou a Entrega de Armas");
  118. Entregou[playerid] = 1;
  119. Armas += 50;
  120. //Fim do código
  121. }
  122. if(EntregandoDrogas[playerid] == 1){
  123. SendClientMessage(playerid, -1, "Você efetuou a Entrega de Drogas");
  124. Entregou[playerid] = 1;
  125. Drogas += 50;
  126. //Fim do código
  127. }
  128. if(EntregandoMunicoes[playerid] == 1){
  129. SendClientMessage(playerid, -1, "Você efetuou a Entrega de Munições");
  130. Entregou[playerid] = 1;
  131. Municoes += 50;
  132. //Fim do código
  133. }
  134. return 1;
  135. }
  136.  
  137. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  138. {
  139. if(dialogid == DIALOG_ENTREGA+1)
  140. {
  141. if(listitem == 0)
  142. {
  143. SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
  144. SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
  145. EntregandoArmas[playerid] = 1;
  146. }
  147. return 1;
  148. }
  149.  
  150. if(dialogid == DIALOG_ENTREGA+2)
  151. {
  152. if(listitem == 0)
  153. {
  154. SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
  155. SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
  156. EntregandoDrogas[playerid] = 1;
  157. }
  158. return 1;
  159. }
  160.  
  161.  
  162. if(dialogid == DIALOG_ENTREGA+3)
  163. {
  164. if(listitem == 0)
  165. {
  166. SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
  167. SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
  168. EntregandoMunicoes[playerid] = 1;
  169. }
  170. return 1;
  171. }
  172.  
  173. if(dialogid == DIALOG_ENTREGA)
  174. {
  175. if(listitem == 0)
  176. {
  177. ShowPlayerDialog(playerid, DIALOG_ENTREGA+1, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
  178. }
  179. if(listitem == 1)
  180. {
  181. ShowPlayerDialog(playerid, DIALOG_ENTREGA+2, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
  182. }
  183. if(listitem == 2)
  184. {
  185. ShowPlayerDialog(playerid, DIALOG_ENTREGA+3, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
  186. }
  187. }
  188. return 1;
  189. }
  190.  
  191. stock SalvarMatuto()
  192. {
  193. new string[128];
  194. format(string, sizeof(string), Matuto);
  195. if(!DOF2_FileExists(Matuto)) DOF2_CreateFile(Matuto);
  196. DOF2_SetInt(string,"Armas",Armas;
  197. DOF2_SetInt(string,"Drogas",Drogas);
  198. DOF2_SetInt(string,"Munições",Municoes);
  199. DOF2_SaveFile();
  200. }
  201. stock CarregarMatuto()
  202. {
  203. new string[128];
  204. format(string, sizeof(string), Matuto);
  205. if(!DOF2_FileExists(Matuto)) DOF2_CreateFile(Matuto);
  206. Armas = DOF2_GetInt(string,"Armas");
  207. Drogas = DOF2_GetInt(string,"Drogas");
  208. Municoes = DOF2_GetInt(string,"Munições");
  209. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement