Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.33 KB | None | 0 0
  1. #include <a_samp>
  2. #include <DOF2>
  3. #include <zcmd>
  4. #include <sscanf2>
  5.  
  6. enum pInfo {
  7. Level,
  8. Dinheiro,
  9. Senha[16]
  10. }
  11. new PlayerInfo[MAX_PLAYERS][pInfo];
  12.  
  13. #define PASTA_CONTAS "Contas/%s.ini"
  14. #define DIALOG_REGISTRO 1
  15. #pragma tabsize 0
  16.  
  17. main()
  18. {
  19. print("\n==================================");
  20. print(" {FF0000}GAMEMODE CRIADO POR: BARROS BR");
  21. print("==================================\n");
  22. }
  23.  
  24.  
  25. public OnGameModeInit()
  26. {
  27. SetGameModeText("Barros BR");
  28. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  29. return 1;
  30. }
  31.  
  32. public OnGameModeExit()
  33. {
  34. DOF2_Exit();
  35. return 1;
  36. }
  37.  
  38. public OnPlayerRequestClass(playerid, classid)
  39. {
  40. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  41. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  42. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  43. return 1;
  44. }
  45.  
  46. public OnPlayerConnect(playerid)
  47. {
  48. return 1;
  49. }
  50.  
  51. public OnPlayerDisconnect(playerid, reason)
  52. {
  53. return 1;
  54. }
  55.  
  56. public OnPlayerSpawn(playerid)
  57. {
  58. return 1;
  59. }
  60.  
  61. public OnPlayerDeath(playerid, killerid, reason)
  62. {
  63. return 1;
  64. }
  65.  
  66. public OnVehicleSpawn(vehicleid)
  67. {
  68. return 1;
  69. }
  70.  
  71. public OnVehicleDeath(vehicleid, killerid)
  72. {
  73. return 1;
  74. }
  75.  
  76. public OnPlayerText(playerid, text[])
  77. {
  78. return 1;
  79. }
  80.  
  81. public OnPlayerCommandText(playerid, cmdtext[])
  82. {
  83. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  84. {
  85. // Do something here
  86. return 1;
  87. }
  88. return 0;
  89. }
  90.  
  91. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  92. {
  93. return 1;
  94. }
  95.  
  96. public OnPlayerExitVehicle(playerid, vehicleid)
  97. {
  98. return 1;
  99. }
  100.  
  101. public OnPlayerStateChange(playerid, newstate, oldstate)
  102. {
  103. return 1;
  104. }
  105.  
  106. public OnPlayerEnterCheckpoint(playerid)
  107. {
  108. return 1;
  109. }
  110.  
  111. public OnPlayerLeaveCheckpoint(playerid)
  112. {
  113. return 1;
  114. }
  115.  
  116. public OnPlayerEnterRaceCheckpoint(playerid)
  117. {
  118. return 1;
  119. }
  120.  
  121. public OnPlayerLeaveRaceCheckpoint(playerid)
  122. {
  123. return 1;
  124. }
  125.  
  126. public OnRconCommand(cmd[])
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnPlayerRequestSpawn(playerid)
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnObjectMoved(objectid)
  137. {
  138. return 1;
  139. }
  140.  
  141. public OnPlayerObjectMoved(playerid, objectid)
  142. {
  143. return 1;
  144. }
  145.  
  146. public OnPlayerPickUpPickup(playerid, pickupid)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnVehicleMod(playerid, vehicleid, componentid)
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnPlayerSelectedMenuRow(playerid, row)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnPlayerExitedMenu(playerid)
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnRconLoginAttempt(ip[], password[], success)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnPlayerUpdate(playerid)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnPlayerStreamIn(playerid, forplayerid)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnPlayerStreamOut(playerid, forplayerid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnVehicleStreamIn(vehicleid, forplayerid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnVehicleStreamOut(vehicleid, forplayerid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  217. {
  218. new file[90];
  219. format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
  220. switch(dialogid) {
  221. case DIALOG_REGISTRO:
  222. if(response) {
  223. if(!strlen(inputtext)) {
  224. new string[124];
  225. SendClientMessage(playerid, 0xFF0000AA, "[ERRO] Digite uma senha para se registrar!");
  226. format(string,sizeof(string), "{FF0000}Nome: {FFFFFF}%s/n{FF0000}Conta: {FFFFFF}Sem registro./n/n{FFFFFF}Insira uma senha para se registrar!");
  227. ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Vida Carioca RP - Registro", string, "Registrar", "Cancelar");
  228. } else {
  229. DOF2_CreateFile(file);
  230. PlayerInfo[playerid][Dinheiro] = 500;
  231. DOF2_SetInt(file, "Level", PlayerInfo[playerid][Level]);
  232. DOF2_SetInt(file, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
  233. DOF2_SaveFile();
  234. SendClientMessage(playerid, 0xFF0000AA, "[VCRP] Sua conta foi criada com sucesso! Bom Jogo!");
  235. SpawnPlayer(playerid);
  236. }
  237. }
  238. }
  239. return 1;
  240. }
  241.  
  242. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  243. {
  244. return 1;
  245. }
  246. stock PlayerName(playerid) {
  247. new aname[MAX_PLAYER_NAME];
  248. GetPlayerName(playerid, aname, sizeof(aname));
  249. return aname;
  250. }
  251. stock CarregarContas(playerid) {
  252. new file[90];
  253. format(file, sizeof(file), "Contas/%s.ini", PlayerName(playerid));
  254. PlayerInfo[playerid][Level] = DOF2_GetInt(file, "Level");
  255. PlayerInfo[playerid][Dinheiro] = DOF2_GetInt(file, "Dinheiro");
  256. SendClientessage(playerid, 0xFF0000AA, "[VCRP] Sua conta foi carregada com sucesso."
  257. }
  258.  
  259. stock SalvarContas(playerid) {
  260. new file[90];
  261. format(file, sizeof(file), "Contas/%s.ini", PlayerName(playerid));
  262. DOF2_SetInt(file, "Level", PlayerInfo[playerid][Level]);
  263. DOF2_SetInt(file, "Dinheiro", PlayerInfo[playerid][Dinheiro]);
  264. DOF2_SaveFile();
  265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement