Advertisement
Guest User

Cash System HomeHots

a guest
May 24th, 2014
1,362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. /* Criador : Danniel_Cooper.
  2. Comandos : /meucash , /darcash (Admin RCON), /comprarvip, /jetpack, /rvip, /nitrovip
  3.  
  4. -------------------------------
  5.  
  6. Não remova os créditos, você não ganha absolutamente nada fazendo isso!
  7.  
  8. */
  9.  
  10. #include <a_samp>
  11. #include <zcmd>
  12. #include <sscanf>
  13. #include <dof2>
  14.  
  15. #define FILTERSCRIPT
  16.  
  17. #if defined FILTERSCRIPT
  18.  
  19. #define Msg SendClientMessage
  20.  
  21. #define ERRO 0xFF030FFF
  22. #define ROXO 0xB360FDFF
  23.  
  24. new Cash[MAX_PLAYERS], VIP[MAX_PLAYERS];
  25.  
  26. public OnFilterScriptInit()
  27. {
  28. print("\n--------------------------------------");
  29. print(" Cash System 1.0 by Danniel_Cooper iniciado.");
  30. print("--------------------------------------\n");
  31. return 1;
  32. }
  33.  
  34. public OnFilterScriptExit()
  35. {
  36. print("\n--------------------------------------");
  37. print(" Cash System 1.0 by Danniel_Cooper fechado.");
  38. print("--------------------------------------\n");
  39. DOF2_Exit();
  40. return 1;
  41. }
  42.  
  43.  
  44. #endif
  45.  
  46.  
  47. public OnPlayerConnect(playerid)
  48. {
  49. CarregarCash(playerid);
  50. CarregarVip(playerid);
  51. Msg(playerid, -1, "Este servidor tem o sistema Cash System criado por Danniel_Cooper!");
  52. return 1;
  53. }
  54.  
  55. stock pNome(playerid){
  56.  
  57. static Nome[MAX_PLAYER_NAME];
  58. GetPlayerName(playerid, Nome, sizeof(Nome));
  59. return Nome;
  60. }
  61. stock CarregarCash(playerid){
  62.  
  63. new arquivo[30], string[18], valor;
  64. format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
  65. if(DOF2_FileExists(arquivo)){
  66. DOF2_GetInt(arquivo, "Cash");
  67. valor = Cash[playerid];
  68. Cash[playerid] = valor;
  69. }
  70. return 1;
  71. }
  72. stock CarregarVip(playerid){
  73.  
  74. new arquivo[30], string[50];
  75. format(string, sizeof(string), "CashSystem/%sVIP.cfg", arquivo);
  76. if(DOF2_FileExists(arquivo)){
  77. DOF2_GetInt(arquivo, "VIP");
  78. VIP[playerid] = 1;
  79. }
  80. return 1;
  81. }
  82. CMD:darcash(playerid, params[]){
  83.  
  84. new string[100], plid, nome2[MAX_PLAYER_NAME], arquivo[30];
  85. GetPlayerName(plid, nome2, sizeof(nome2));
  86. if(!IsPlayerAdmin(playerid)) return Msg(playerid, ERRO, "Você não tem autorização para usar este comando!");
  87. if(sscanf(params, "ud", plid, params[0])) return Msg(playerid, ERRO, " Use /darlevel [ID] [Quantidade]");
  88. if(params[0] < 1 && params[1] > 10000000) return Msg(playerid, ERRO, "Cash mínimo 1, máximo 10000000.");
  89. if(!IsPlayerConnected(plid)) return Msg(playerid, ERRO, "Jogador não conectado!");
  90.  
  91. Cash[plid] += params[0];
  92.  
  93. format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
  94. DOF2_CreateFile(arquivo);
  95. DOF2_SetInt(arquivo, "Cash", Cash[playerid]);
  96. DOF2_SaveFile();
  97.  
  98. format(string, sizeof(string), "Você deu %d de cash para %s!", params[0], nome2);
  99. Msg(playerid, ROXO, string);
  100. format(string, sizeof(string), "Administrador %s te deu %d de cash!", pNome(playerid), params[0]);
  101. Msg(plid, ROXO, string);
  102. printf("[CONSOLE] - %s deu %d de cash para %s", pNome(playerid), params[0], nome2);
  103. return 1;
  104. }
  105. CMD:meucash(playerid){
  106.  
  107. new string[100], arquivo[30];
  108. format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
  109. if(!DOF2_FileExists(arquivo)){
  110. return Msg(playerid, -1, "Você não tem Cash!");
  111. }
  112. else{
  113. format(string, sizeof(string), "Você tem %d de cash!", Cash[playerid]);
  114. Msg(playerid, ROXO, string);
  115. }
  116. return 1;
  117. }
  118. CMD:comprarvip(playerid){
  119.  
  120. if(Cash[playerid] < 10000){ // Valor que você editará se quiser abaixar ou almentar o preço . . .
  121. return Msg(playerid, -1, "Você precisa ter 10000 de Cash para comprar VIP!");
  122. }
  123. else
  124. {
  125. new string[50], arquivo[30];
  126. format(string, sizeof(string), "CashSystem/%sVIP.cfg");
  127. DOF2_CreateFile(arquivo);
  128. DOF2_SetInt(arquivo, "VIP", VIP[playerid]);
  129. DOF2_SaveFile();
  130. VIP[playerid] = 1;
  131. Msg(playerid, -1, "Parabéns, você adquiriu seu VIP, foi descontado 10000 de Cash, e você ganhou 1kk!");
  132. GivePlayerMoney(playerid, 1000000);
  133. Cash[playerid] -= 10000;
  134. }
  135. return 1;
  136. }
  137. CMD:jetpack(playerid){
  138.  
  139. if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
  140. SetPlayerSpecialAction(playerid, 2);
  141. return 1;
  142. }
  143. CMD:rvip(playerid){
  144.  
  145. new vehicle;
  146. vehicle = GetPlayerVehicleID(playerid);
  147. if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
  148. if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid, ERRO, "Você não está em um veiculo!");
  149. SetVehicleHealth(vehicle, 1000);
  150. Msg(playerid, ROXO, "Vehiculo reparado!");
  151. return 1;
  152. }
  153. CMD:nitrovip(playerid){
  154.  
  155. new vehicle;
  156. vehicle = GetPlayerVehicleID(playerid);
  157. if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
  158. if(vehicle > 0){
  159. AddVehicleComponent(vehicle, 1010);
  160. Msg(playerid, ROXO, "Nitro setado!");
  161. }
  162. return 1;
  163. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement