Advertisement
Guest User

System Cartão de Crédito! By: ProKillerPa

a guest
Jul 25th, 2014
1,927
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.70 KB | None | 0 0
  1. /*
  2. Cartao01 >> Corresponde ao VISA.
  3. Cartao02 >> Corresponde ao Master Card
  4. Cartao03 >> Corresponde ao Cielo
  5. Cartao04 >> Corresponde ao Elo
  6.  
  7. O Filterscript foi inteiramente desenvolvido por Gabriel Buttenbender ( ProKillerPa );
  8. A Cópia de partes desse script somente é permitida com o mantimento dos créditos, caso contrário será considerador como CRIME!
  9. Agradecimento aos desenvolvedores das Includes usadas nesse FS ( DOF2 ( Nome )- ZCMD ( Nome ) & KeyPad - ( Nome );;;;
  10.  
  11. Filterscript Inclui:
  12. >>> CANCELADO // Sistema Bancário Completo [ Sacar, Depositar, Transferir, Alterar Senha Bancaria/Cartão, Ver Saldo ];
  13. Sistema de Cartão de Crédito/Débito [ Pagamentos Parcelados c/ ou s/ Juros, Pagamentos á vista ];
  14. Comandos Testes [ /ComprarAlgo ];
  15. TextDraw que informa o cartão ao player [ Igual Aos Reais, c/ Cartão Serial, Titular ];
  16. Totalmente feito em DIALOG, tendo opções para o usuário desse FS escolher entre ambos;
  17. -----------------------------------------------------------------------------------------------------
  18. FilterScript Sistema Bancário & Cartão de Crédito/Débito [ ÚNICO ] ||||| Faça bom aproveito!
  19.  
  20. */
  21.  
  22. #include a_samp
  23. #include DOF2
  24. #include ZCMD
  25. #include keypad
  26.  
  27. new PlayerText:MasterCard0[MAX_PLAYERS];
  28. new PlayerText:MasterCard1[MAX_PLAYERS];
  29. new PlayerText:MasterCard2[MAX_PLAYERS];
  30. new PlayerText:MasterCard3[MAX_PLAYERS];
  31. new PlayerText:MasterCard4[MAX_PLAYERS];
  32. new PlayerText:MasterCard5[MAX_PLAYERS];
  33. new PlayerText:MasterCard6[MAX_PLAYERS];
  34. new PlayerText:MasterCard7[MAX_PLAYERS];
  35. new PlayerText:MasterCard8[MAX_PLAYERS];
  36.  
  37. #define Desparcelando 1 // Ajute o tempo em MINUTOS --- 1 = 1 Min;
  38.  
  39. new VariTemp[MAX_PLAYERS];
  40.  
  41. public OnFilterScriptInit()
  42. {
  43. SetGameModeText("Blank Script");
  44. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  45. print("[INFO] >. Carregado .<");
  46.  
  47.  
  48. SetTimer("DesParcelando", 60000*Desparcelando, true);
  49. return 1;
  50. }
  51.  
  52. public OnFilterScriptExit()
  53. {
  54. return 1;
  55. }
  56.  
  57. #define KeyPad_FimBanco 20
  58.  
  59. #pragma tabsize 0
  60.  
  61. enum EnumCartao{
  62. Cartao01,
  63. TemCartao01,
  64. Debito01,
  65. Credito01,
  66. Parcelando01,
  67. VezesParcelando01,
  68. SerieCartao1_01,
  69. SerieCartao2_01,
  70. SerieCartao3_01,
  71. SerieCartao4_01,
  72. Titular01,
  73. SenhaCartao01,
  74. ValorTotal01,
  75. //
  76. Cartao02,
  77. TemCartao02,
  78. Debito02,
  79. Credito02,
  80. Parcelando02,
  81. VezesParcelado02,
  82. SerieCartao1_02,
  83. SerieCartao2_02,
  84. SerieCartao3_02,
  85. SerieCartao4_02,
  86. Titular02,
  87. SenhaCartao02,
  88. ValorTotal02,
  89. //
  90. Cartao03,
  91. TemCartao03,
  92. Debito03,
  93. Credito03,
  94. Parcelando03,
  95. VezesParcelado03,
  96. SerieCartao1_03,
  97. SerieCartao2_03,
  98. SerieCartao3_03,
  99. SerieCartao4_03,
  100. Titular03,
  101. SenhaCartao03,
  102. ValorTotal03,
  103. //
  104. Cartao04,
  105. TemCartao04,
  106. Debito04,
  107. Credito04,
  108. Parcelando04,
  109. VezesParcelado04,
  110. SerieCartao1_04,
  111. SerieCartao2_04,
  112. SerieCartao3_04,
  113. SerieCartao4_04,
  114. Titular04,
  115. SenhaCartao04,
  116. ValorTotal04
  117. }; new SystemCard[MAX_PLAYERS][EnumCartao];
  118.  
  119. #define PrecoCelu 1250 // Preço do << Item Exemplo >> do comando /compraralgo que serve de Exemplo para uma fatura de cartão.
  120.  
  121. new _Str[128],
  122. VezesParcelado[MAX_PLAYERS],
  123. CartaoOption[MAX_PLAYERS],
  124. SenhaBanco[MAX_PLAYERS] // Variavel que armazena o valor em Numeros do inputtext [ Ao Cadastrar Senha! ];
  125. ;
  126.  
  127. // DESABILITADO! >>
  128. #define DIALOGUSAR 1 /* Manual:
  129. 0 ~ Mostra uma MSG no Chat que a parcela do cartão foi paga.
  130. 1 ~ Mostra um Dialog ao jogador explicando que a parcela do cartão foi paga.
  131. */
  132.  
  133. public OnPlayerConnect(playerid){
  134. format(_Str, sizeof(_Str), "Cartao de Credito/%s.ini", ObterNome(playerid));
  135. if(!DOF2_FileExists(_Str)){
  136. DOF2_CreateFile(_Str);
  137.  
  138. DOF2_SetString(_Str, "Cartao01", "Nenhum");
  139. DOF2_SetInt(_Str, "TemCartao01", 0);
  140. DOF2_SetInt(_Str, "Debito01", 0);
  141. DOF2_SetInt(_Str, "Credito01", 0);
  142. DOF2_SetInt(_Str, "Parcelando01", 0);
  143. DOF2_SetInt(_Str, "VezesParcelando01", 0);
  144. DOF2_SetInt(_Str, "SerieCartao1_01", 0);
  145. DOF2_SetInt(_Str, "SerieCartao2_01", 0);
  146. DOF2_SetInt(_Str, "SerieCartao3_01", 0);
  147. DOF2_SetInt(_Str, "SerieCartao4_01", 0);
  148. DOF2_SetString(_Str, "Titular01", "Não Registrado");
  149. DOF2_SetInt(_Str, "SenhaCartao01", 0);
  150. DOF2_SetInt(_Str, "ValorTotal01", 0);
  151.  
  152. DOF2_SetString(_Str, "------------------", "---------------------------------------------------"); // Separa o Cartão de Outro. !!
  153.  
  154. DOF2_SetString(_Str, "Cartao02", "Nenhum");
  155. DOF2_SetInt(_Str, "TemCartao02", 0);
  156. DOF2_SetInt(_Str, "Debito02", 0);
  157. DOF2_SetInt(_Str, "Credito02", 0);
  158. DOF2_SetInt(_Str, "Parcelado02", 0);
  159. DOF2_SetInt(_Str, "VezesParcelado02", 0);
  160. DOF2_SetInt(_Str, "SerieCartao1_02", 0);
  161. DOF2_SetInt(_Str, "SerieCartao2_02", 0);
  162. DOF2_SetInt(_Str, "SerieCartao3_02", 0);
  163. DOF2_SetInt(_Str, "SerieCartao4_02", 0);
  164. DOF2_SetString(_Str, "Titular02", "Não Registrado");
  165. DOF2_SetInt(_Str, "SenhaCartao02", 1);
  166. DOF2_SetInt(_Str, "ValorTotal02", 0);
  167.  
  168. DOF2_SetString(_Str, "-----------------", "---------------------------------------------------"); // Separa o Cartão de Outro. !!
  169.  
  170. DOF2_SetString(_Str, "Cartao03", "Nenhum");
  171. DOF2_SetInt(_Str, "TemCartao03", 0);
  172. DOF2_SetInt(_Str, "Debito03", 0);
  173. DOF2_SetInt(_Str, "Credito03", 0);
  174. DOF2_SetInt(_Str, "Parcelado03", 0);
  175. DOF2_SetInt(_Str, "VezesParcelado03", 0);
  176. DOF2_SetInt(_Str, "SerieCartao1_03", 0);
  177. DOF2_SetInt(_Str, "SerieCartao2_03", 0);
  178. DOF2_SetInt(_Str, "SerieCartao3_03", 0);
  179. DOF2_SetInt(_Str, "SerieCartao4_03", 0);
  180. DOF2_SetString(_Str, "Titular03", "Não Registrado");
  181. DOF2_SetInt(_Str, "SenhaCartao03", 0);
  182. DOF2_SetInt(_Str, "ValorTotal03", 0);
  183.  
  184. DOF2_SetString(_Str, "----------------", "---------------------------------------------------"); // Separa o Cartão de Outro. !!
  185.  
  186. DOF2_SetString(_Str, "Cartao04", "Nenhum");
  187. DOF2_SetInt(_Str, "TemCartao04", 0);
  188. DOF2_SetInt(_Str, "Debito04", 0);
  189. DOF2_SetInt(_Str, "Credito04", 0);
  190. DOF2_SetInt(_Str, "Parcelado04", 0);
  191. DOF2_SetInt(_Str, "VezesParcelado04", 0);
  192. DOF2_SetInt(_Str, "SerieCartao1_04", 0);
  193. DOF2_SetInt(_Str, "SerieCartao2_04", 0);
  194. DOF2_SetInt(_Str, "SerieCartao3_04", 0);
  195. DOF2_SetInt(_Str, "SerieCartao4_04", 0);
  196. DOF2_SetString(_Str, "Titular04", "Não Registrado");
  197. DOF2_SetInt(_Str, "SenhaCartao04", 0);
  198. DOF2_SetInt(_Str, "ValorTotal04", 0);
  199.  
  200. DOF2_SaveFile();
  201. }
  202. else{
  203. CarregarCartao(playerid);
  204. }
  205.  
  206. MasterCard0[playerid] = CreatePlayerTextDraw(playerid, 214.000000, 157.000000, "_");
  207. PlayerTextDrawBackgroundColor(playerid, MasterCard0[playerid], 255);
  208. PlayerTextDrawFont(playerid, MasterCard0[playerid], 1);
  209. PlayerTextDrawLetterSize(playerid, MasterCard0[playerid], 0.500000, 11.799999);
  210. PlayerTextDrawColor(playerid, MasterCard0[playerid], -1);
  211. PlayerTextDrawSetOutline(playerid, MasterCard0[playerid], 0);
  212. PlayerTextDrawSetProportional(playerid, MasterCard0[playerid], 1);
  213. PlayerTextDrawSetShadow(playerid, MasterCard0[playerid], 1);
  214. PlayerTextDrawUseBox(playerid, MasterCard0[playerid], 1);
  215. PlayerTextDrawBoxColor(playerid, MasterCard0[playerid], -1094795632);
  216. PlayerTextDrawTextSize(playerid, MasterCard0[playerid], 409.000000, 11.000000);
  217.  
  218. MasterCard1[playerid] = CreatePlayerTextDraw(playerid, 260.000000, 161.000000, "MasterCard.");
  219. PlayerTextDrawBackgroundColor(playerid, MasterCard1[playerid], 255);
  220. PlayerTextDrawFont(playerid, MasterCard1[playerid], 1);
  221. PlayerTextDrawLetterSize(playerid, MasterCard1[playerid], 0.500000, 1.800000);
  222. PlayerTextDrawColor(playerid, MasterCard1[playerid], 1182970928);
  223. PlayerTextDrawSetOutline(playerid, MasterCard1[playerid], 0);
  224. PlayerTextDrawSetProportional(playerid, MasterCard1[playerid], 1);
  225. PlayerTextDrawSetShadow(playerid, MasterCard1[playerid], 1);
  226.  
  227. MasterCard2[playerid] = CreatePlayerTextDraw(playerid, 224.000000, 220.000000, "0000 0000 0000 0000");
  228. PlayerTextDrawBackgroundColor(playerid, MasterCard2[playerid], 255);
  229. PlayerTextDrawFont(playerid, MasterCard2[playerid], 1);
  230. PlayerTextDrawLetterSize(playerid, MasterCard2[playerid], 0.310000, 1.700000);
  231. PlayerTextDrawColor(playerid, MasterCard2[playerid], 1887473760);
  232. PlayerTextDrawSetOutline(playerid, MasterCard2[playerid], 0);
  233. PlayerTextDrawSetProportional(playerid, MasterCard2[playerid], 1);
  234. PlayerTextDrawSetShadow(playerid, MasterCard2[playerid], 1);
  235.  
  236. MasterCard3[playerid] = CreatePlayerTextDraw(playerid, 226.000000, 244.000000, "Gabriel Buttenbender");
  237. PlayerTextDrawBackgroundColor(playerid, MasterCard3[playerid], 255);
  238. PlayerTextDrawFont(playerid, MasterCard3[playerid], 1);
  239. PlayerTextDrawLetterSize(playerid, MasterCard3[playerid], 0.250000, 1.699999);
  240. PlayerTextDrawColor(playerid, MasterCard3[playerid], -92245249);
  241. PlayerTextDrawSetOutline(playerid, MasterCard3[playerid], 0);
  242. PlayerTextDrawSetProportional(playerid, MasterCard3[playerid], 1);
  243. PlayerTextDrawSetShadow(playerid, MasterCard3[playerid], 1);
  244.  
  245. MasterCard4[playerid] = CreatePlayerTextDraw(playerid, 371.000000, 211.000000, "@");
  246. PlayerTextDrawBackgroundColor(playerid, MasterCard4[playerid], 255);
  247. PlayerTextDrawFont(playerid, MasterCard4[playerid], 2);
  248. PlayerTextDrawLetterSize(playerid, MasterCard4[playerid], 1.330000, 2.400000);
  249. PlayerTextDrawColor(playerid, MasterCard4[playerid], -1);
  250. PlayerTextDrawSetOutline(playerid, MasterCard4[playerid], 0);
  251. PlayerTextDrawSetProportional(playerid, MasterCard4[playerid], 1);
  252. PlayerTextDrawSetShadow(playerid, MasterCard4[playerid], 1);
  253.  
  254. MasterCard5[playerid] = CreatePlayerTextDraw(playerid, 365.000000, 217.000000, "_");
  255. PlayerTextDrawBackgroundColor(playerid, MasterCard5[playerid], 255);
  256. PlayerTextDrawFont(playerid, MasterCard5[playerid], 1);
  257. PlayerTextDrawLetterSize(playerid, MasterCard5[playerid], 1.680000, 4.099999);
  258. PlayerTextDrawColor(playerid, MasterCard5[playerid], -1);
  259. PlayerTextDrawSetOutline(playerid, MasterCard5[playerid], 0);
  260. PlayerTextDrawSetProportional(playerid, MasterCard5[playerid], 1);
  261. PlayerTextDrawSetShadow(playerid, MasterCard5[playerid], 1);
  262. PlayerTextDrawUseBox(playerid, MasterCard5[playerid], 1);
  263. PlayerTextDrawBoxColor(playerid, MasterCard5[playerid], -522133920);
  264. PlayerTextDrawTextSize(playerid, MasterCard5[playerid], 392.000000, -23.000000);
  265.  
  266. MasterCard6[playerid] = CreatePlayerTextDraw(playerid, 375.000000, 202.000000, ".");
  267. PlayerTextDrawBackgroundColor(playerid, MasterCard6[playerid], 255);
  268. PlayerTextDrawFont(playerid, MasterCard6[playerid], 1);
  269. PlayerTextDrawLetterSize(playerid, MasterCard6[playerid], 1.470000, 6.600000);
  270. PlayerTextDrawColor(playerid, MasterCard6[playerid], -7601921);
  271. PlayerTextDrawSetOutline(playerid, MasterCard6[playerid], 0);
  272. PlayerTextDrawSetProportional(playerid, MasterCard6[playerid], 1);
  273. PlayerTextDrawSetShadow(playerid, MasterCard6[playerid], 1);
  274.  
  275. MasterCard7[playerid] = CreatePlayerTextDraw(playerid, 364.000000, 202.000000, ".");
  276. PlayerTextDrawBackgroundColor(playerid, MasterCard7[playerid], 255);
  277. PlayerTextDrawFont(playerid, MasterCard7[playerid], 1);
  278. PlayerTextDrawLetterSize(playerid, MasterCard7[playerid], 1.470000, 6.600000);
  279. PlayerTextDrawColor(playerid, MasterCard7[playerid], -92245249);
  280. PlayerTextDrawSetOutline(playerid, MasterCard7[playerid], 0);
  281. PlayerTextDrawSetProportional(playerid, MasterCard7[playerid], 1);
  282. PlayerTextDrawSetShadow(playerid, MasterCard7[playerid], 1);
  283.  
  284. MasterCard8[playerid] = CreatePlayerTextDraw(playerid, 364.000000, 239.000000, "MasterCard");
  285. PlayerTextDrawBackgroundColor(playerid, MasterCard8[playerid], 255);
  286. PlayerTextDrawFont(playerid, MasterCard8[playerid], 1);
  287. PlayerTextDrawLetterSize(playerid, MasterCard8[playerid], 0.139999, 1.400000);
  288. PlayerTextDrawColor(playerid, MasterCard8[playerid], -4048);
  289. PlayerTextDrawSetOutline(playerid, MasterCard8[playerid], 0);
  290. PlayerTextDrawSetProportional(playerid, MasterCard8[playerid], 1);
  291. PlayerTextDrawSetShadow(playerid, MasterCard8[playerid], 1);
  292.  
  293. return 0;
  294. }
  295.  
  296. public OnPlayerDisconnect(playerid){
  297. Reset(playerid); // Reseta valores das variáveis, evitando bugs para jogadores que utilizam o ID do antecessor.
  298. return 1;
  299. }
  300.  
  301. public OnPlayerKeypadInput(playerid, keypadID, type, key){
  302. if(keypadID == KeyPad_FimBanco && type == KEYPAD_INPUT_GOOD) {
  303. format(_Str, sizeof(_Str), "Dados do seu cartão:\n\nN° Série: %d.%d.%d.%d\nTitular: %s", DOF2_GetInt(ObterCartao(playerid), "SerieCartao1_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao2_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao3_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao4_01"), DOF2_GetString(_Str, "Titular01")); ShowPlayerDialog(playerid, 922, DIALOG_STYLE_MSGBOX, "Cartão Visa Assinado!", _Str, "Fechar", "");
  304. return 1;
  305. }
  306. if(keypadID == KeyPad_FimBanco && type == KEYPAD_INPUT_BAD){
  307. SetTimerEx("ErrouCadastroBanc", 2000, false, "i", playerid);
  308. return 1;
  309. }
  310. return 1;
  311. }
  312.  
  313. forward ErrouCadastroBanc(playerid);
  314. public ErrouCadastroBanc(playerid){
  315. SendClientMessage(playerid, -1, "Digite a senha coorretamente, caso errar novamente a conta será encerrada!");
  316. ShowPlayerKeypad(playerid, KeyPad_FimBanco, DOF2_GetString(ObterCartao(playerid), "SenhaCartao01"));
  317. return 1;
  318. }
  319.  
  320. CMD:teste(playerid){
  321. VariTemp[playerid] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01");
  322.  
  323. DOF2_SetInt(ObterCartao(playerid), "VezesParcelando01", VariTemp[playerid] -1);
  324. DOF2_SaveFile();
  325.  
  326. format(_Str, sizeof(_Str), "{BEBEBE}| {FFD700}BANCO {BEBEBE}|{FA8072} Uma parcela de sua compra foi descontada! O Dinheiro será retirado do banco! ", DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"));
  327. SendClientMessage(playerid, -1, _Str);
  328.  
  329. format(_Str, sizeof(_Str), "{BEBEBE}| {FFD700}BANCO {BEBEBE}|{FA8072} Restam {BEBEBE}%d {FA8072}parcelas para serem pagas! O Valor pago foi %d,00!", DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"), DOF2_GetInt(ObterCartao(playerid), "ValorTotal01") / DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"));
  330. SendClientMessage(playerid, -1, _Str);
  331. return 1;
  332. }
  333.  
  334. CMD:abrirconta(playerid){
  335. //ShowPlayerKeypad(playerid, DIALOG_Teste, DOF2_GetString(ObterCartao(playerid), "SerieCartao1_01"));
  336. ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "Abrir Conta!", "clique em fim e digite sa senha na proxima msg!", "Fim", "Sair");
  337. return 1;
  338. }
  339.  
  340. CMD:meucartao(playerid){
  341. ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Escolher Cartão!", "Visa\nMaster Card\nCielo\nElo", "Mostrar", "Fechar");
  342. return 1;
  343. }
  344.  
  345. CMD:test(playerid){
  346. new SerieCard1 = random(9000);
  347. new SerieCard2 = random(8000);
  348. new SerieCard3 = random(9000);
  349. new SerieCard4 = random(8000);
  350.  
  351. DOF2_SetInt(ObterCartao(playerid), "SerieCartao1_01", SerieCard1);
  352. DOF2_SetInt(ObterCartao(playerid), "SerieCartao2_01", SerieCard2);
  353. DOF2_SetInt(ObterCartao(playerid), "SerieCartao3_01", SerieCard3);
  354. DOF2_SetInt(ObterCartao(playerid), "SerieCartao4_01", SerieCard4);
  355.  
  356. DOF2_SaveFile();
  357.  
  358. return 1;
  359. }
  360.  
  361. CMD:assinarcartao(playerid){
  362. ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Assinar Cartao","Visa\nMaster Card\nCielo\nElo","Assinar","Cancelar");
  363. return 1;
  364. }
  365.  
  366. CMD:compraralgo(playerid){ // script test
  367. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Comprar Algo", "Celular Teste\n", "Comprar", "Fechar");
  368. return 1;
  369. }
  370.  
  371. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  372. if(dialogid == 1){
  373. if(!response) return 1;
  374. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Comprar Algo", "Á Vista\nParcelado\nDeposito Bancário\nInternet Banking\n", "Comprar", "Fechar");
  375. }
  376. if(dialogid == 2){
  377. if(!response) return 1;
  378. switch(listitem){
  379. case 0:{
  380. new VerificMoney = GetPlayerMoney(playerid);
  381.  
  382. if(VerificMoney <= PrecoCelu) return SendClientMessage(playerid, -1, "{BEBEBE}| INFO | Você não tem dinheiro suficiente para pagar á vista. Use outro modo de pagamento!");
  383. GivePlayerMoney(playerid, VerificMoney-PrecoCelu);
  384. }
  385. case 1: {
  386.  
  387. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Selecione o Cartao", "Visa\nMaster Card\nCielo\nElo", "Pagar", "Cancelar");
  388. }
  389. case 2:{
  390. }
  391. case 3:{
  392. }
  393.  
  394. }
  395. }
  396. if(dialogid == 3){
  397. if(!response) return 1;
  398.  
  399. switch(listitem){
  400. case 0:{
  401. ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Vezes Parcelado","Digite abaixo o n° de vezes que deseja parcelar. \nMax 12 x.","Prossegir","Fechar");
  402.  
  403. }
  404. }
  405. }
  406. if(dialogid == 4){
  407. if(!response) return 1;
  408.  
  409. print("FOII");
  410.  
  411. //if(SystemCard[playerid][TemCartao01] == 1){
  412. VezesParcelado[playerid] = strval(inputtext);
  413.  
  414. DOF2_SetInt(ObterCartao(playerid), "Parcelando01", 1);
  415.  
  416. DOF2_SetInt(ObterCartao(playerid), "VezesParcelando01", VezesParcelado[playerid]);
  417. DOF2_SetInt(ObterCartao(playerid), "ValorTotal01", 9000);
  418. DOF2_SaveFile();
  419.  
  420. format(_Str, sizeof(_Str), "Compra finalizada com sucesso!\nSerá descontado cada parcela ao dia automaticamente.\n\nCartao: Visa\nParcelas: %d", VezesParcelado[playerid]);
  421. ShowPlayerDialog(playerid, 5, DIALOG_STYLE_MSGBOX, "Compra Efetuada!",_Str,"Fechar","");
  422. // }
  423. }
  424. if(dialogid == 6){
  425. if(!response) return 1;
  426.  
  427. switch(listitem){
  428. case 0: DOF2_SetString(ObterCartao(playerid), "Cartao01", "Visa"), CartaoOption[playerid] = 1, ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Crédito ou Débito?", "Cartão de Crédito\nCartão de Débito", "Finalizar", "Sair");
  429. case 1: DOF2_SetString(ObterCartao(playerid), "Cartao02", "Master Card"), CartaoOption[playerid] = 2, ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Crédito ou Débito?", "Cartão de Crédito\nCartão de Débito", "Finalizar", "Sair");//ARRUMAR!
  430. }
  431. }
  432. if(dialogid == 7){
  433. if(!response) return 1;
  434.  
  435. switch(listitem){
  436. case 0: if(CartaoOption[playerid] == 1){
  437. new SerieCard1 = random(9000),
  438. SerieCard2 = random(8000),
  439. SerieCard3 = random(9000),
  440. SerieCard4 = random(8000)
  441. ;
  442. DOF2_SetInt(ObterCartao(playerid), "TemCartao01", 1);
  443. DOF2_SetInt(ObterCartao(playerid), "Credito01", 1);
  444.  
  445. DOF2_SetInt(ObterCartao(playerid), "SerieCartao1_01", SerieCard1);
  446. DOF2_SetInt(ObterCartao(playerid), "SerieCartao2_01", SerieCard2);
  447. DOF2_SetInt(ObterCartao(playerid), "SerieCartao3_01", SerieCard3);
  448. DOF2_SetInt(ObterCartao(playerid), "SerieCartao4_01", SerieCard4);
  449.  
  450. DOF2_SaveFile();
  451. ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Assinando Cartao", "Digite abaixo o nome do Titular do Cartão para Finalizar a Assinatura.", "Prosseguir", "Sair");
  452. }
  453. else if(CartaoOption[playerid] == 2){
  454. new SerieCard1 = random(9000),
  455. SerieCard2 = random(8000),
  456. SerieCard3 = random(9000),
  457. SerieCard4 = random(8000)
  458. ;
  459. DOF2_SetInt(ObterCartao(playerid), "TemCartao02", 1);
  460. DOF2_SetInt(ObterCartao(playerid), "Credito02", 1);
  461.  
  462. DOF2_SetInt(ObterCartao(playerid), "SerieCartao1_02", SerieCard1);
  463. DOF2_SetInt(ObterCartao(playerid), "SerieCartao2_02", SerieCard2);
  464. DOF2_SetInt(ObterCartao(playerid), "SerieCartao3_02", SerieCard3);
  465. DOF2_SetInt(ObterCartao(playerid), "SerieCartao4_02", SerieCard4);
  466.  
  467. DOF2_SaveFile();
  468. //ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT, "Criar Senha!", "Digite uma senha !", "Finalizar", "Sair");
  469. }
  470. else if(CartaoOption[playerid] == 3){
  471. new SerieCard1 = random(9000),
  472. SerieCard2 = random(8000),
  473. SerieCard3 = random(9000),
  474. SerieCard4 = random(8000)
  475. ;
  476. DOF2_SetInt(ObterCartao(playerid), "TemCartao03", 1);
  477. DOF2_SetInt(ObterCartao(playerid), "Credito03", 1);
  478.  
  479. DOF2_SetInt(ObterCartao(playerid), "SerieCartao1_03", SerieCard1);
  480. DOF2_SetInt(ObterCartao(playerid), "SerieCartao2_03", SerieCard2);
  481. DOF2_SetInt(ObterCartao(playerid), "SerieCartao3_03", SerieCard3);
  482. DOF2_SetInt(ObterCartao(playerid), "SerieCartao4_03", SerieCard4);
  483.  
  484. DOF2_SaveFile();
  485. }
  486. else if(CartaoOption[playerid] == 4){
  487. new SerieCard1 = random(9000),
  488. SerieCard2 = random(8000),
  489. SerieCard3 = random(9000),
  490. SerieCard4 = random(8000)
  491. ;
  492. DOF2_SetInt(ObterCartao(playerid), "TemCartao04", 1);
  493. DOF2_SetInt(ObterCartao(playerid), "Credito04", 1);
  494.  
  495. DOF2_SetInt(ObterCartao(playerid), "SerieCartao1_04", SerieCard1);
  496. DOF2_SetInt(ObterCartao(playerid), "SerieCartao2_04", SerieCard2);
  497. DOF2_SetInt(ObterCartao(playerid), "SerieCartao3_04", SerieCard3);
  498. DOF2_SetInt(ObterCartao(playerid), "SerieCartao4_04", SerieCard4);
  499.  
  500. DOF2_SaveFile();
  501. }
  502. }
  503. }
  504. if(dialogid == 8){
  505. if(!response) return 1;
  506.  
  507. if(CartaoOption[playerid] == 1){
  508. DOF2_SetString(ObterCartao(playerid), "Titular01", inputtext);
  509. DOF2_SaveFile();
  510.  
  511. //format(_Str, sizeof(_Str), "Dados do seu cartão:\n\nN° Série: %d.%d.%d.%d\nTitular: %s", DOF2_GetInt(ObterCartao(playerid), "SerieCartao1_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao2_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao3_01"),DOF2_GetInt(ObterCartao(playerid), "SerieCartao4_01"), DOF2_GetString(_Str, "Titular01"));
  512. //ShowPlayerDialog(playerid, 922, DIALOG_STYLE_MSGBOX, "Cartão Visa Assinado!", _Str, "Fechar", "");
  513.  
  514. ShowPlayerDialog(playerid, 11, DIALOG_STYLE_INPUT, "Criar Senha!", "Digite uma senha !", "Finalizar", "Sair");
  515. }
  516. }
  517. if(dialogid == 9){
  518. if(!response) return 1;
  519.  
  520. switch(listitem){
  521. case 0: return 1;
  522. case 1: CartaoMasterCard(playerid);
  523. }
  524. }
  525. if(dialogid == 11){
  526. if(!response) return 1;
  527.  
  528. SenhaBanco[playerid] = strval(inputtext);
  529. DOF2_SetInt(ObterCartao(playerid), "SenhaCartao01", SenhaBanco[playerid]);
  530.  
  531. DOF2_SaveFile();
  532. DOF2_Exit();
  533.  
  534. ShowPlayerKeypad(playerid, KeyPad_FimBanco, DOF2_GetString(ObterCartao(playerid), "SenhaCartao01"));
  535.  
  536. }
  537. return 1;
  538. }
  539.  
  540. CarregarCartao(playerid){
  541.  
  542. SystemCard[playerid][Cartao01] = DOF2_GetInt(ObterCartao(playerid), "Cartao01");
  543. SystemCard[playerid][TemCartao01] = DOF2_GetInt(ObterCartao(playerid), "TemCartao01");
  544. SystemCard[playerid][Debito01] = DOF2_GetInt(ObterCartao(playerid), "Debito01");
  545. SystemCard[playerid][Credito01] = DOF2_GetInt(ObterCartao(playerid), "Credito01");
  546. SystemCard[playerid][Parcelando01] = DOF2_GetInt(ObterCartao(playerid), "Parcelando01");
  547. SystemCard[playerid][VezesParcelando01] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01");
  548. SystemCard[playerid][SenhaCartao01] = DOF2_GetInt(ObterCartao(playerid), "SenhaCartao01");
  549.  
  550. SystemCard[playerid][Cartao02] = DOF2_GetInt(ObterCartao(playerid), "Cartao02");
  551. SystemCard[playerid][TemCartao02] = DOF2_GetInt(ObterCartao(playerid), "TemCartao02");
  552. SystemCard[playerid][Debito02] = DOF2_GetInt(ObterCartao(playerid), "Debito02");
  553. SystemCard[playerid][Credito02] = DOF2_GetInt(ObterCartao(playerid), "Credito02");
  554. SystemCard[playerid][Parcelando02] = DOF2_GetInt(ObterCartao(playerid), "Parcelando02");
  555. SystemCard[playerid][VezesParcelado02] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelando02");
  556. SystemCard[playerid][SenhaCartao02] = DOF2_GetInt(ObterCartao(playerid), "SenhaCartao02");
  557.  
  558. SystemCard[playerid][Cartao03] = DOF2_GetInt(ObterCartao(playerid), "Cartao03");
  559. SystemCard[playerid][TemCartao03] = DOF2_GetInt(ObterCartao(playerid), "TemCartao03");
  560. SystemCard[playerid][Debito03] = DOF2_GetInt(ObterCartao(playerid), "Debito03");
  561. SystemCard[playerid][Credito03] = DOF2_GetInt(ObterCartao(playerid), "Credito03");
  562. SystemCard[playerid][Parcelando03] = DOF2_GetInt(ObterCartao(playerid), "Parcelando03");
  563. SystemCard[playerid][VezesParcelado03] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelado03");
  564. SystemCard[playerid][SenhaCartao03] = DOF2_GetInt(ObterCartao(playerid), "SenhaCartao03");
  565.  
  566. SystemCard[playerid][Cartao04] = DOF2_GetInt(ObterCartao(playerid), "Cartao04");
  567. SystemCard[playerid][TemCartao04] = DOF2_GetInt(ObterCartao(playerid), "TemCartao04");
  568. SystemCard[playerid][Debito04] = DOF2_GetInt(ObterCartao(playerid), "Debito04");
  569. SystemCard[playerid][Credito04] = DOF2_GetInt(ObterCartao(playerid), "Credito04");
  570. SystemCard[playerid][Parcelando04] = DOF2_GetInt(ObterCartao(playerid), "Parcelando04");
  571. SystemCard[playerid][VezesParcelado04] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelado04");
  572. SystemCard[playerid][SenhaCartao04] = DOF2_GetInt(ObterCartao(playerid), "SenhaCartao04");
  573. }
  574.  
  575. forward DesParcelando(playerid);
  576. public DesParcelando(playerid){
  577. print("OKS");
  578. for(new i=0; i < MAX_PLAYERS; i++){
  579. //if(!IsPlayerConnected(playerid)) break;
  580.  
  581. if(SystemCard[playerid][Parcelando01] == 1){
  582. print("OKS2 <<<");
  583. if(SystemCard[playerid][VezesParcelando01] == 0) return DOF2_SetInt(ObterCartao(playerid), "Parcelando01", 0); // Reseta as Parcelas; << @ >>
  584. VariTemp[playerid] = DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01");
  585.  
  586. DOF2_SetInt(ObterCartao(playerid), "VezesParcelando01", VariTemp[playerid] -1);
  587. DOF2_SaveFile();
  588.  
  589. #if DIALOGUSAR == 1
  590. {
  591. format(_Str, sizeof(_Str), "{BEBEBE}| {FFD700}BANCO {BEBEBE}|{FA8072} Uma parcela de sua compra foi descontada! O Dinheiro será retirado do banco! ", DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"));
  592. SendClientMessage(playerid, -1, _Str);
  593.  
  594. format(_Str, sizeof(_Str), "{BEBEBE}| {FFD700}BANCO {BEBEBE}|{FA8072} Restam {BEBEBE}%d {FA8072}parcelas para serem pagas! O Valor pago foi %d,00!", DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"), DOF2_GetInt(ObterCartao(playerid), "ValorTotal01") / DOF2_GetInt(ObterCartao(playerid), "VezesParcelando01"));
  595. SendClientMessage(playerid, -1, _Str);
  596. }
  597. #endif
  598. }
  599. }
  600. return 1;
  601. }
  602.  
  603. Reset(playerid){// Manter essa CallBack ativa; Somente poderá ser utilizada APÓS o salvamento dos dados.
  604. VariTemp[playerid] = 0,
  605. CartaoOption[playerid] = 0
  606. ;
  607.  
  608. }
  609. forward EsconderCartao(playerid);
  610. public EsconderCartao(playerid){
  611. PlayerTextDrawHide(playerid, MasterCard0[playerid]);
  612. PlayerTextDrawHide(playerid, MasterCard1[playerid]);
  613. PlayerTextDrawHide(playerid, MasterCard2[playerid]);
  614. PlayerTextDrawHide(playerid, MasterCard3[playerid]);
  615. PlayerTextDrawHide(playerid, MasterCard4[playerid]);
  616. PlayerTextDrawHide(playerid, MasterCard5[playerid]);
  617. PlayerTextDrawHide(playerid, MasterCard6[playerid]);
  618. PlayerTextDrawHide(playerid, MasterCard7[playerid]);
  619. PlayerTextDrawHide(playerid, MasterCard8[playerid]);
  620.  
  621. TogglePlayerControllable(playerid, true);
  622. return 1;
  623. }
  624.  
  625. ObterNome(playerid){
  626. new GetName[26];
  627. GetPlayerName(playerid, GetName, sizeof(GetName));
  628. return GetName;
  629. }
  630.  
  631. ObterCartao(playerid){
  632. new _Cartao[128];
  633.  
  634. format(_Cartao, sizeof(_Cartao), "Cartao de Credito/%s.ini", ObterNome(playerid));
  635. return _Cartao;
  636. }
  637.  
  638. CartaoMasterCard(playerid){
  639. format(_Str, sizeof(_Str), "%d.%d.%d.%d", DOF2_GetInt(ObterCartao(playerid), "SerieCartao1_01"), DOF2_GetInt(ObterCartao(playerid), "SerieCartao2_01"), DOF2_GetInt(ObterCartao(playerid), "SerieCartao3_01"), DOF2_GetInt(ObterCartao(playerid), "SerieCartao4_01"));
  640. PlayerTextDrawSetString(playerid, MasterCard2[playerid], _Str);
  641.  
  642. PlayerTextDrawShow(playerid, MasterCard0[playerid]);
  643. PlayerTextDrawShow(playerid, MasterCard1[playerid]);
  644. PlayerTextDrawShow(playerid, MasterCard2[playerid]);
  645. PlayerTextDrawShow(playerid, MasterCard3[playerid]);
  646. PlayerTextDrawShow(playerid, MasterCard4[playerid]);
  647. PlayerTextDrawShow(playerid, MasterCard5[playerid]);
  648. PlayerTextDrawShow(playerid, MasterCard6[playerid]);
  649. PlayerTextDrawShow(playerid, MasterCard7[playerid]);
  650. PlayerTextDrawShow(playerid, MasterCard8[playerid]);
  651.  
  652. TogglePlayerControllable(playerid, false);
  653. SendClientMessage(playerid, -1, "{BEBEBE}| INFO | O Cartão será guardado ao bolso em 8 segundos!");
  654.  
  655. SetTimerEx("EsconderCartao", 6000, false, "i", playerid);
  656. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement