Advertisement
Guest User

Untitled

a guest
Sep 13th, 2014
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.01 KB | None | 0 0
  1. //Credits to Y_Less, Dracoblue and Kush.
  2.  
  3. #include <a_samp>
  4. #include <YSI\y_ini>
  5.  
  6. #define DIALOG_REGISTER 1
  7. #define DIALOG_LOGIN 2
  8. #define DIALOG_SUCCESS_1 3
  9. #define DIALOG_SUCCESS_2 4
  10.  
  11. #define PATH "/Users/%s.ini"
  12.  
  13. new Text:NitroAmount[MAX_PLAYERS];
  14. new Text:NitroLabel;
  15. new timer1;
  16. new timer2;
  17.  
  18. forward NitroBarUpdate(playerid);
  19. forward NosUpdate(playerid);
  20.  
  21. #define COL_RED 0xFF0000FF
  22. #define COL_GREEN 0x00FF44FF
  23. #define COL_YELLOW 0xFFFF00FF
  24.  
  25. #define COL_WHITE "{FFFFFF}"
  26. #define COL_RED "{F81414}"
  27. #define COL_GREEN "{00FF22}"
  28. #define COL_LIGHTBLUE "{00CED1}"
  29.  
  30. #define NosConsumSpeed 2 // Increase to loose Nitro faster or decrase to loose it slower (the number must NOT contain period or comma).
  31. #define NitroBarColor 1340286975 // Change this to the color of progressbar you want to use (you can also put hex numbers e.g. 0xFF0000FF).
  32.  
  33. #define NOS_DIALOG 1596 // The nitro purchase dialog ID (list style)
  34. #define NOS_INPUT 1597 // The custom Nitro purchase dialog ID (input style)
  35.  
  36. #undef MAX_PLAYERS
  37. #define MAX_PLAYERS 100 // Change to the maximum players of your server
  38.  
  39. stock CanUseNitro(vehid)
  40. {
  41. new vehmodel = GetVehicleModel(vehid);
  42. switch(vehmodel)
  43. {
  44. case 522, 481, 441, 468, 448, 446, 513, 521, 510, 430, 520, 476, 463, 509, 462, 581, 461, 523, 586, 471, 472, 473, 493, 595, 484, 453, 452, 454: return false;
  45. }
  46. return true;
  47. }
  48.  
  49. stock IsNumeric(string[]) // Not by me :P
  50. {
  51. for(new i = 0; i < strlen(string); i++) if(string[i] > '9' || string[i] < '0') return false;
  52. return true;
  53. }
  54.  
  55.  
  56. new Text:Textdraw0;
  57. new Text:Textdraw1;
  58. new Text:Textdraw2;
  59. new Text:Textdraw3;
  60. new Text:Textdraw4;
  61. new Text:Textdraw5;
  62. new Text:Textdraw6;
  63. new Text:Textdraw7;
  64. new Text:Textdraw8;
  65. new Text:Textdraw9;
  66. new Text:Textdraw10;
  67. new Text:Textdraw11;
  68. new Text:Textdraw12;
  69. new Text:Textdraw13;
  70. new Text:Textdraw14;
  71. new Text:Textdraw15;
  72. new Text:Textdraw16;
  73. new Text:Textdraw17;
  74. new Text:Textdraw18;
  75. new Text:Textdraw19;
  76. new Text:Textdraw20;
  77. new Text:Textdraw21;
  78. new Text:Textdraw22;
  79. new Text:Textdraw23;
  80. new Text:Textdraw24;
  81. new Text:Textdraw25;
  82. new Text:Textdraw26;
  83. new Text:Textdraw27;
  84. new Text:Textdraw28;
  85. new Text:Textdraw29;
  86. new Text:Textdraw30;
  87. new Text:Textdraw31;
  88. new Text:Textdraw32;
  89.  
  90. enum pInfo
  91. {
  92. pPass,
  93. pCash,
  94. pAdmin,
  95. pKills,
  96. pDeaths
  97. }
  98. new PlayerInfo[MAX_PLAYERS][pInfo];
  99.  
  100. forward LoadUser_data(playerid,name[],value[]);
  101. public LoadUser_data(playerid,name[],value[])
  102. {
  103. INI_Int("Password",PlayerInfo[playerid][pPass]);
  104. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  105. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  106. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  107. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  108. return 1;
  109. }
  110.  
  111. stock GetSpeed(playerid)
  112. {
  113. new Float:ST[4];
  114. if(IsPlayerInAnyVehicle(playerid))
  115. GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  116. else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  117. ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 178.8617875;
  118. return floatround(ST[3]);
  119. }
  120.  
  121. ///////////////////////////////////////////////////////////////////////////
  122. stock VoziloJeAvion(id)
  123. {
  124. if(id == 592 || id == 577 || id == 511 || id == 512 || id == 593 || id == 520 || id == 553 || id == 476 || id == 519 || id == 460 || id == 513) return 1;
  125. else if(id == 548 || id == 425 || id == 417 || id == 487 || id == 488 || id == 497 || id == 563 || id == 447 || id == 469) return 1;
  126. else return 0;
  127. }
  128. ///////////////////////////////////////////////////////////////////////////
  129. stock VoziloJeBrod(id)
  130. {
  131. if(id == 472 || id == 473 || id == 493 || id == 484 || id == 430 || id == 454 || id == 453 || id == 452 || id == 446) return 1;
  132. return 0;
  133. }
  134. ///////////////////////////////////////////////////////////////////////////
  135. stock VoziloJeMotor(id)
  136. {
  137. if(id == 462 || id == 448 || id == 581 || id == 522 || id == 461 || id == 521 || id == 523 || id == 463 || id == 468 || id == 471) return 1;
  138. return 0;
  139. }
  140. ///////////////////////////////////////////////////////////////////////////
  141. stock VoziloJeBicikla(id)
  142. {
  143. if(id == 481 || id == 509 || id == 510) return 1;
  144. return 0;
  145. }
  146. ///////////////////////////////////////////////////////////////////////////
  147. stock VoziloJeKamion(id)
  148. {
  149. if(id == 499 || id == 498 || id == 609 || id == 524 || id == 578 || id == 455 || id == 403 || id == 414 || id == 443 || id == 514 || id == 515 || id == 408 || id == 431 || id == 437 || id == 538) return 1;
  150. return 0;
  151. }
  152.  
  153. new ImenaVozila[212][] =
  154. {
  155. {"Landstal"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"}, {"Dumper"},{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},
  156. {"Washington"},{"Bobcat"},{"Whoopee"},{"BF-INJ"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Article TR"},{"Previon"},{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  157. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Article TR2"},{"Turismo"},{"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC"},{"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},{"Sanchez"},
  158. {"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},{"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},{"Baggage"},{"Dozer"},{"Maverick"},{"Chopper"},{"Rancher"},{"FBI - Ra"},{"Virgo"},{"Greenwood"},{"Jetmax"},{"Hotring"},
  159. {"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},{"Mesa"},{"RC Goblin"},{"HR - A"},{"HR - B"},{"Bloodring Banger"},{"Rancher"},{"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stuntplane"},{"Tanker"},{"Roadtrain"},
  160. {"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},{"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},{"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},{"Blade"},{"Freight"},{"Streak"},{"Vortex"},
  161. {"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},{"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},
  162. {"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},{"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Dunerider"},{"Sweeper"},{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},{"Tug"},{"Article Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Mobile Hotdog"},
  163. {"Club"},{"Carriage"},{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police"},{"Police"},{"Police"},{"LSDP-Ranger"},{"Picador"},{"SWAT Van"},{"Alpha"},{"Phoenix"},{"Glendale"},{"Sadler"},{"Luggage TR A"},{"Luggage TR B"},{"Stair Trailer"},
  164. {"Boxville"},{"Farm Plow"},{"Utility TR"}
  165. };
  166.  
  167. stock UserPath(playerid)
  168. {
  169. new string[128],playername[MAX_PLAYER_NAME];
  170. GetPlayerName(playerid,playername,sizeof(playername));
  171. format(string,sizeof(string),PATH,playername);
  172. return string;
  173. }
  174.  
  175. forward RandomMessage();
  176. new RandomMessages[][] =
  177. {
  178. "~y~Welcome too ~w~Server ~g~name.",
  179. "~y~Welcome too ~w~Server ~r~name.",
  180. "~y~Welcome too ~w~Server ~y~name.",
  181. "~y~Welcome too ~w~Server ~b~name."
  182. };
  183. /*Credits to Dracoblue*/
  184. stock udb_hash(buf[]) {
  185. new length=strlen(buf);
  186. new s1 = 1;
  187. new s2 = 0;
  188. new n;
  189. for (n=0; n<length; n++)
  190. {
  191. s1 = (s1 + buf[n]) % 65521;
  192. s2 = (s2 + s1) % 65521;
  193. }
  194. return (s2 << 16) + s1;
  195. }
  196.  
  197. main()
  198. {
  199. print("\n----------------------------------");
  200. print(" Blank Gamemode by your name here");
  201. print("----------------------------------\n");
  202. }
  203.  
  204. public OnGameModeInit()
  205. {
  206. SetGameModeText("Blank Script");
  207. SetTimer("RandomMessage",8000,1);
  208. timer2 = SetTimer("NitroBarUpdate", 100, true);
  209. //Global Textdraws:
  210. Textdraw0 = TextDrawCreate(642.380004, 431.673309, "usebox");
  211. TextDrawLetterSize(Textdraw0, 0.000000, 1.101055);
  212. TextDrawTextSize(Textdraw0, -3.440000, 0.000000);
  213. TextDrawAlignment(Textdraw0, 1);
  214. TextDrawColor(Textdraw0, 0);
  215. TextDrawUseBox(Textdraw0, true);
  216. TextDrawBoxColor(Textdraw0, 102);
  217. TextDrawSetShadow(Textdraw0, 0);
  218. TextDrawSetOutline(Textdraw0, 0);
  219. TextDrawFont(Textdraw0, 0);
  220.  
  221. Textdraw1 = TextDrawCreate(-0.319991, 428.437377, "LD_SPAC:white");
  222. TextDrawLetterSize(Textdraw1, 0.000000, 0.000000);
  223. TextDrawTextSize(Textdraw1, 640.000000, 0.970656);
  224. TextDrawAlignment(Textdraw1, 1);
  225. TextDrawColor(Textdraw1, -5963521);
  226. TextDrawSetShadow(Textdraw1, 0);
  227. TextDrawSetOutline(Textdraw1, 0);
  228. TextDrawFont(Textdraw1, 4);
  229.  
  230. Textdraw2 = TextDrawCreate(-0.040000, 443.549316, "LD_SPAC:white");
  231. TextDrawLetterSize(Textdraw2, 0.000000, 0.000000);
  232. TextDrawTextSize(Textdraw2, 639.759948, 1.866657);
  233. TextDrawAlignment(Textdraw2, 1);
  234. TextDrawColor(Textdraw2, -5963521);
  235. TextDrawSetShadow(Textdraw2, 0);
  236. TextDrawSetOutline(Textdraw2, 0);
  237. TextDrawFont(Textdraw2, 4);
  238.  
  239. Textdraw3 = TextDrawCreate(2.080002, 429.258636, "SN");
  240. TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
  241. TextDrawAlignment(Textdraw3, 1);
  242. TextDrawColor(Textdraw3, -5963521);
  243. TextDrawSetShadow(Textdraw3, 0);
  244. TextDrawSetOutline(Textdraw3, 0);
  245. TextDrawBackgroundColor(Textdraw3, 51);
  246. TextDrawFont(Textdraw3, 3);
  247. TextDrawSetProportional(Textdraw3, 1);
  248.  
  249. Textdraw4 = TextDrawCreate(244.240036, 432.767974, "welcome to server name");
  250. TextDrawLetterSize(Textdraw4, 0.240399, 0.927999);
  251. TextDrawAlignment(Textdraw4, 1);
  252. TextDrawColor(Textdraw4, -1);
  253. TextDrawSetShadow(Textdraw4, 1);
  254. TextDrawSetOutline(Textdraw4, 0);
  255. TextDrawBackgroundColor(Textdraw4, 51);
  256. TextDrawFont(Textdraw4, 2);
  257. TextDrawSetProportional(Textdraw4, 1);
  258.  
  259. Textdraw5 = TextDrawCreate(372.319793, 417.393432, "usebox");
  260. TextDrawLetterSize(Textdraw5, 0.000000, 0.903775);
  261. TextDrawTextSize(Textdraw5, 666.479980, 0.000000);
  262. TextDrawAlignment(Textdraw5, 1);
  263. TextDrawColor(Textdraw5, 0);
  264. TextDrawUseBox(Textdraw5, true);
  265. TextDrawBoxColor(Textdraw5, 102);
  266. TextDrawSetShadow(Textdraw5, 0);
  267. TextDrawSetOutline(Textdraw5, 0);
  268. TextDrawFont(Textdraw5, 0);
  269.  
  270. Textdraw6 = TextDrawCreate(454.680297, 415.458496, "online~w~1");
  271. TextDrawLetterSize(Textdraw6, 0.275600, 1.129600);
  272. TextDrawAlignment(Textdraw6, 1);
  273. TextDrawColor(Textdraw6, -5963521);
  274. TextDrawSetShadow(Textdraw6, 1);
  275. TextDrawSetOutline(Textdraw6, 0);
  276. TextDrawBackgroundColor(Textdraw6, 51);
  277. TextDrawFont(Textdraw6, 2);
  278. TextDrawSetProportional(Textdraw6, 1);
  279.  
  280. Textdraw7 = TextDrawCreate(379.040069, 415.205352, "record~w~1");
  281. TextDrawLetterSize(Textdraw7, 0.275600, 1.129600);
  282. TextDrawAlignment(Textdraw7, 1);
  283. TextDrawColor(Textdraw7, -5963521);
  284. TextDrawSetShadow(Textdraw7, 1);
  285. TextDrawSetOutline(Textdraw7, 0);
  286. TextDrawBackgroundColor(Textdraw7, 51);
  287. TextDrawFont(Textdraw7, 2);
  288. TextDrawSetProportional(Textdraw7, 1);
  289.  
  290. Textdraw8 = TextDrawCreate(369.319793, 412.488128, "LD_SPAC:white");
  291. TextDrawLetterSize(Textdraw8, 0.000000, 0.000000);
  292. TextDrawTextSize(Textdraw8, 638.400024, 1.493323);
  293. TextDrawAlignment(Textdraw8, 1);
  294. TextDrawColor(Textdraw8, -5963521);
  295. TextDrawSetShadow(Textdraw8, 0);
  296. TextDrawSetOutline(Textdraw8, 0);
  297. TextDrawFont(Textdraw8, 4);
  298.  
  299. Textdraw9 = TextDrawCreate(364.880065, 409.381256, "/");
  300. TextDrawLetterSize(Textdraw9, 0.484239, 2.221227);
  301. TextDrawAlignment(Textdraw9, 1);
  302. TextDrawColor(Textdraw9, -5963521);
  303. TextDrawSetShadow(Textdraw9, 0);
  304. TextDrawSetOutline(Textdraw9, 0);
  305. TextDrawBackgroundColor(Textdraw9, 51);
  306. TextDrawFont(Textdraw9, 1);
  307. TextDrawSetProportional(Textdraw9, 1);
  308.  
  309. Textdraw10 = TextDrawCreate(393.439941, 424.038787, "usebox");
  310. TextDrawLetterSize(Textdraw10, 0.000000, 0.104369);
  311. TextDrawTextSize(Textdraw10, 383.359924, 0.000000);
  312. TextDrawAlignment(Textdraw10, 1);
  313. TextDrawColor(Textdraw10, 0);
  314. TextDrawUseBox(Textdraw10, true);
  315. TextDrawBoxColor(Textdraw10, 102);
  316. TextDrawSetShadow(Textdraw10, 0);
  317. TextDrawSetOutline(Textdraw10, 0);
  318. TextDrawFont(Textdraw10, 0);
  319.  
  320. Textdraw11 = TextDrawCreate(506.199829, 408.962585, "/");
  321. TextDrawLetterSize(Textdraw11, 0.484239, 2.221227);
  322. TextDrawAlignment(Textdraw11, 1);
  323. TextDrawColor(Textdraw11, -5963521);
  324. TextDrawSetShadow(Textdraw11, 0);
  325. TextDrawSetOutline(Textdraw11, 0);
  326. TextDrawBackgroundColor(Textdraw11, 51);
  327. TextDrawFont(Textdraw11, 1);
  328. TextDrawSetProportional(Textdraw11, 1);
  329.  
  330. Textdraw12 = TextDrawCreate(439.159912, 408.679901, "/");
  331. TextDrawLetterSize(Textdraw12, 0.484239, 2.221227);
  332. TextDrawAlignment(Textdraw12, 1);
  333. TextDrawColor(Textdraw12, -5963521);
  334. TextDrawSetShadow(Textdraw12, 0);
  335. TextDrawSetOutline(Textdraw12, 0);
  336. TextDrawBackgroundColor(Textdraw12, 51);
  337. TextDrawFont(Textdraw12, 1);
  338. TextDrawSetProportional(Textdraw12, 1);
  339.  
  340. Textdraw13 = TextDrawCreate(584.960021, 408.842590, "/");
  341. TextDrawLetterSize(Textdraw13, 0.484239, 2.221227);
  342. TextDrawAlignment(Textdraw13, 1);
  343. TextDrawColor(Textdraw13, -5963521);
  344. TextDrawSetShadow(Textdraw13, 0);
  345. TextDrawSetOutline(Textdraw13, 0);
  346. TextDrawBackgroundColor(Textdraw13, 51);
  347. TextDrawFont(Textdraw13, 1);
  348. TextDrawSetProportional(Textdraw13, 1);
  349.  
  350. Textdraw14 = TextDrawCreate(518.000549, 415.487792, "00:00:2014");
  351. TextDrawLetterSize(Textdraw14, 0.275600, 1.129600);
  352. TextDrawAlignment(Textdraw14, 1);
  353. TextDrawColor(Textdraw14, -1);
  354. TextDrawSetShadow(Textdraw14, 1);
  355. TextDrawSetOutline(Textdraw14, 0);
  356. TextDrawBackgroundColor(Textdraw14, 51);
  357. TextDrawFont(Textdraw14, 2);
  358. TextDrawSetProportional(Textdraw14, 1);
  359.  
  360. Textdraw15 = TextDrawCreate(600.680358, 415.293182, "00:00");
  361. TextDrawLetterSize(Textdraw15, 0.275600, 1.129600);
  362. TextDrawAlignment(Textdraw15, 1);
  363. TextDrawColor(Textdraw15, -1);
  364. TextDrawSetShadow(Textdraw15, 1);
  365. TextDrawSetOutline(Textdraw15, 0);
  366. TextDrawBackgroundColor(Textdraw15, 51);
  367. TextDrawFont(Textdraw15, 2);
  368. TextDrawSetProportional(Textdraw15, 1);
  369.  
  370. Textdraw16 = TextDrawCreate(702.719848, 415.825378, "usebox");
  371. TextDrawLetterSize(Textdraw16, 0.000000, -2.544816);
  372. TextDrawTextSize(Textdraw16, 369.919860, 0.000000);
  373. TextDrawAlignment(Textdraw16, 1);
  374. TextDrawColor(Textdraw16, 0);
  375. TextDrawUseBox(Textdraw16, true);
  376. TextDrawBoxColor(Textdraw16, 102);
  377. TextDrawSetShadow(Textdraw16, 0);
  378. TextDrawSetOutline(Textdraw16, 0);
  379. TextDrawFont(Textdraw16, 0);
  380.  
  381. Textdraw17 = TextDrawCreate(510.159790, 391.818572, "/");
  382. TextDrawLetterSize(Textdraw17, 0.484239, 2.221227);
  383. TextDrawAlignment(Textdraw17, 1);
  384. TextDrawColor(Textdraw17, -5963521);
  385. TextDrawSetShadow(Textdraw17, 0);
  386. TextDrawSetOutline(Textdraw17, 0);
  387. TextDrawBackgroundColor(Textdraw17, 51);
  388. TextDrawFont(Textdraw17, 1);
  389. TextDrawSetProportional(Textdraw17, 1);
  390.  
  391. Textdraw18 = TextDrawCreate(649.000000, 398.979919, "usebox");
  392. TextDrawLetterSize(Textdraw18, 0.000000, -2.464816);
  393. TextDrawTextSize(Textdraw18, 514.560119, 0.000000);
  394. TextDrawAlignment(Textdraw18, 1);
  395. TextDrawColor(Textdraw18, 0);
  396. TextDrawUseBox(Textdraw18, true);
  397. TextDrawBoxColor(Textdraw18, 102);
  398. TextDrawSetShadow(Textdraw18, 0);
  399. TextDrawSetOutline(Textdraw18, 0);
  400. TextDrawFont(Textdraw18, 0);
  401.  
  402. Textdraw19 = TextDrawCreate(654.479858, 382.507812, "usebox");
  403. TextDrawLetterSize(Textdraw19, 0.000000, -2.464816);
  404. TextDrawTextSize(Textdraw19, 519.039978, 0.000000);
  405. TextDrawAlignment(Textdraw19, 1);
  406. TextDrawColor(Textdraw19, 0);
  407. TextDrawUseBox(Textdraw19, true);
  408. TextDrawBoxColor(Textdraw19, 102);
  409. TextDrawSetShadow(Textdraw19, 0);
  410. TextDrawSetOutline(Textdraw19, 0);
  411. TextDrawFont(Textdraw19, 0);
  412.  
  413. Textdraw20 = TextDrawCreate(513.960083, 375.794647, "/");
  414. TextDrawLetterSize(Textdraw20, 0.484239, 2.221227);
  415. TextDrawAlignment(Textdraw20, 1);
  416. TextDrawColor(Textdraw20, -5963521);
  417. TextDrawSetShadow(Textdraw20, 0);
  418. TextDrawSetOutline(Textdraw20, 0);
  419. TextDrawBackgroundColor(Textdraw20, 51);
  420. TextDrawFont(Textdraw20, 1);
  421. TextDrawSetProportional(Textdraw20, 1);
  422.  
  423. Textdraw21 = TextDrawCreate(517.840087, 359.695953, "/");
  424. TextDrawLetterSize(Textdraw21, 0.484239, 2.221227);
  425. TextDrawAlignment(Textdraw21, 1);
  426. TextDrawColor(Textdraw21, -5963521);
  427. TextDrawSetShadow(Textdraw21, 0);
  428. TextDrawSetOutline(Textdraw21, 0);
  429. TextDrawBackgroundColor(Textdraw21, 51);
  430. TextDrawFont(Textdraw21, 1);
  431. TextDrawSetProportional(Textdraw21, 1);
  432.  
  433. Textdraw22 = TextDrawCreate(658.239990, 366.454559, "usebox");
  434. TextDrawLetterSize(Textdraw22, 0.000000, -2.384816);
  435. TextDrawTextSize(Textdraw22, 522.720092, 0.000000);
  436. TextDrawAlignment(Textdraw22, 1);
  437. TextDrawColor(Textdraw22, 0);
  438. TextDrawUseBox(Textdraw22, true);
  439. TextDrawBoxColor(Textdraw22, 102);
  440. TextDrawSetShadow(Textdraw22, 0);
  441. TextDrawSetOutline(Textdraw22, 0);
  442. TextDrawFont(Textdraw22, 0);
  443.  
  444. Textdraw23 = TextDrawCreate(522.200134, 343.373291, "/");
  445. TextDrawLetterSize(Textdraw23, 0.484239, 2.221227);
  446. TextDrawAlignment(Textdraw23, 1);
  447. TextDrawColor(Textdraw23, -5963521);
  448. TextDrawSetShadow(Textdraw23, 0);
  449. TextDrawSetOutline(Textdraw23, 0);
  450. TextDrawBackgroundColor(Textdraw23, 51);
  451. TextDrawFont(Textdraw23, 1);
  452. TextDrawSetProportional(Textdraw23, 1);
  453.  
  454. Textdraw24 = TextDrawCreate(526.399780, 346.960174, "LD_SPAC:white");
  455. TextDrawLetterSize(Textdraw24, 0.000000, 0.000000);
  456. TextDrawTextSize(Textdraw24, 638.400024, 2.165323);
  457. TextDrawAlignment(Textdraw24, 1);
  458. TextDrawColor(Textdraw24, -5963521);
  459. TextDrawSetShadow(Textdraw24, 0);
  460. TextDrawSetOutline(Textdraw24, 0);
  461. TextDrawFont(Textdraw24, 4);
  462.  
  463. Textdraw25 = TextDrawCreate(369.160156, 392.312011, "/");
  464. TextDrawLetterSize(Textdraw25, 0.484239, 2.221227);
  465. TextDrawAlignment(Textdraw25, 1);
  466. TextDrawColor(Textdraw25, -5963521);
  467. TextDrawSetShadow(Textdraw25, 0);
  468. TextDrawSetOutline(Textdraw25, 0);
  469. TextDrawBackgroundColor(Textdraw25, 51);
  470. TextDrawFont(Textdraw25, 1);
  471. TextDrawSetProportional(Textdraw25, 1);
  472.  
  473. Textdraw26 = TextDrawCreate(374.159790, 395.792175, "LD_SPAC:white");
  474. TextDrawLetterSize(Textdraw26, 0.000000, 0.000000);
  475. TextDrawTextSize(Textdraw26, 141.600128, 2.389321);
  476. TextDrawAlignment(Textdraw26, 1);
  477. TextDrawColor(Textdraw26, -5963521);
  478. TextDrawSetShadow(Textdraw26, 0);
  479. TextDrawSetOutline(Textdraw26, 0);
  480. TextDrawFont(Textdraw26, 4);
  481.  
  482. Textdraw27 = TextDrawCreate(378.039886, 399.165283, "////////////////////////////////");
  483. TextDrawLetterSize(Textdraw27, 0.272239, 1.138560);
  484. TextDrawAlignment(Textdraw27, 1);
  485. TextDrawColor(Textdraw27, -5963521);
  486. TextDrawSetShadow(Textdraw27, 0);
  487. TextDrawSetOutline(Textdraw27, 0);
  488. TextDrawBackgroundColor(Textdraw27, 51);
  489. TextDrawFont(Textdraw27, 1);
  490. TextDrawSetProportional(Textdraw27, 1);
  491.  
  492. Textdraw28 = TextDrawCreate(565.840026, 335.775970, "s~w~peedo");
  493. TextDrawLetterSize(Textdraw28, 0.361999, 1.226666);
  494. TextDrawAlignment(Textdraw28, 1);
  495. TextDrawColor(Textdraw28, -5963521);
  496. TextDrawSetShadow(Textdraw28, 103);
  497. TextDrawSetOutline(Textdraw28, 0);
  498. TextDrawBackgroundColor(Textdraw28, 51);
  499. TextDrawFont(Textdraw28, 3);
  500. TextDrawSetProportional(Textdraw28, 1);
  501.  
  502. Textdraw29 = TextDrawCreate(430.359924, 385.010589, "n~w~os");
  503. TextDrawLetterSize(Textdraw29, 0.361999, 1.226666);
  504. TextDrawAlignment(Textdraw29, 1);
  505. TextDrawColor(Textdraw29, -5963521);
  506. TextDrawSetShadow(Textdraw29, 103);
  507. TextDrawSetOutline(Textdraw29, 0);
  508. TextDrawBackgroundColor(Textdraw29, 51);
  509. TextDrawFont(Textdraw29, 3);
  510. TextDrawSetProportional(Textdraw29, 1);
  511.  
  512. Textdraw30 = TextDrawCreate(560.719970, 350.634704, "infernus");
  513. TextDrawLetterSize(Textdraw30, 0.246799, 1.226666);
  514. TextDrawAlignment(Textdraw30, 1);
  515. TextDrawColor(Textdraw30, -5963521);
  516. TextDrawSetShadow(Textdraw30, 0);
  517. TextDrawSetOutline(Textdraw30, 0);
  518. TextDrawBackgroundColor(Textdraw30, 51);
  519. TextDrawFont(Textdraw30, 2);
  520. TextDrawSetProportional(Textdraw30, 1);
  521.  
  522. Textdraw31 = TextDrawCreate(545.840087, 361.386718, "-");
  523. TextDrawLetterSize(Textdraw31, 5.266800, 0.285866);
  524. TextDrawAlignment(Textdraw31, 1);
  525. TextDrawColor(Textdraw31, -5963521);
  526. TextDrawSetShadow(Textdraw31, 1);
  527. TextDrawSetOutline(Textdraw31, 0);
  528. TextDrawBackgroundColor(Textdraw31, 51);
  529. TextDrawFont(Textdraw31, 1);
  530. TextDrawSetProportional(Textdraw31, 1);
  531.  
  532. Textdraw32 = TextDrawCreate(526.040039, 365.970733, "speed~w~100 km/h");
  533. TextDrawLetterSize(Textdraw32, 0.246799, 1.226666);
  534. TextDrawAlignment(Textdraw32, 1);
  535. TextDrawColor(Textdraw32, -5963521);
  536. TextDrawSetShadow(Textdraw32, 0);
  537. TextDrawSetOutline(Textdraw32, 0);
  538. TextDrawBackgroundColor(Textdraw32, 51);
  539. TextDrawFont(Textdraw32, 2);
  540. TextDrawSetProportional(Textdraw32, 1);
  541.  
  542. Textdraw33 = TextDrawCreate(522.560058, 380.261413, "fuel ~w~100%");
  543. TextDrawLetterSize(Textdraw33, 0.246799, 1.226666);
  544. TextDrawAlignment(Textdraw33, 1);
  545. TextDrawColor(Textdraw33, -5963521);
  546. TextDrawSetShadow(Textdraw33, 0);
  547. TextDrawSetOutline(Textdraw33, 0);
  548. TextDrawBackgroundColor(Textdraw33, 51);
  549. TextDrawFont(Textdraw33, 2);
  550. TextDrawSetProportional(Textdraw33, 1);
  551.  
  552. return 1;
  553. }
  554.  
  555. public NitroBarUpdate(playerid)
  556. {
  557. new nitro = GetPVarInt(playerid, "Nitro");
  558. if(nitro > 0 && nitro < 5) TextDrawSetString(Textdraw26, "/");
  559. else if(nitro >= 5 && nitro < 10) TextDrawSetString(Textdraw26, "//");
  560. else if(nitro >= 10 && nitro < 15) TextDrawSetString(Textdraw26, "///");
  561. else if(nitro >= 15 && nitro < 20) TextDrawSetString(Textdraw26, "////");
  562. else if(nitro >= 20 && nitro < 25) TextDrawSetString(Textdraw26, "/////");
  563. else if(nitro >= 25 && nitro < 30) TextDrawSetString(Textdraw26, "//////");
  564. else if(nitro >= 30 && nitro < 35) TextDrawSetString(Textdraw26, "////////");
  565. else if(nitro >= 35 && nitro < 40) TextDrawSetString(Textdraw26, "/////////");
  566. else if(nitro >= 40 && nitro < 45) TextDrawSetString(Textdraw26, "//////////");
  567. else if(nitro >= 45 && nitro < 50) TextDrawSetString(Textdraw26, "///////////");
  568. else if(nitro >= 50 && nitro < 55) TextDrawSetString(Textdraw26, "////////////");
  569. else if(nitro >= 55 && nitro < 60) TextDrawSetString(Textdraw26, "/////////////");
  570. else if(nitro >= 60 && nitro < 65) TextDrawSetString(Textdraw26, "//////////////");
  571. else if(nitro >= 65 && nitro < 70) TextDrawSetString(Textdraw26, "///////////////");
  572. else if(nitro >= 70 && nitro < 75) TextDrawSetString(Textdraw26, "/////////////////");
  573. else if(nitro >= 75 && nitro < 80) TextDrawSetString(Textdraw26, "///////////////////");
  574. else if(nitro >= 80 && nitro < 85) TextDrawSetString(Textdraw26, "//////////////////////");
  575. else if(nitro >= 85 && nitro < 90) TextDrawSetString(Textdraw26, "/////////////////////////");
  576. else if(nitro >= 90 && nitro < 95) TextDrawSetString(Textdraw26, "////////////////////////////");
  577. else if(nitro >= 95 && nitro <= 100) TextDrawSetString(Textdraw26,"////////////////////////////////");
  578. else TextDrawSetString(Textdraw26, "_");
  579. return 1;
  580. }
  581. public RandomMessage()
  582. {
  583. TextDrawSetString(Textdraw4, RandomMessages[random(sizeof(RandomMessages))]); // We need this to make the timer working
  584. return 1;
  585. }
  586. public OnGameModeExit()
  587. {
  588. for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
  589. {
  590. TextDrawDestroy(NitroLabel);
  591. TextDrawDestroy(NitroAmount[playerid]);
  592. KillTimer(timer2);
  593. }
  594. return 1;
  595. }
  596.  
  597. public OnPlayerRequestClass(playerid, classid)
  598. {
  599. return 1;
  600. }
  601.  
  602. public OnPlayerConnect(playerid)
  603. {
  604. SetPVarInt(playerid, "Nitro", 100);
  605. if(fexist(UserPath(playerid)))
  606. {
  607. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  608. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  609. }
  610. else
  611. {
  612. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  613. }
  614. return 1;
  615. }
  616.  
  617. public OnPlayerDisconnect(playerid, reason)
  618. {
  619. new INI:File = INI_Open(UserPath(playerid));
  620. INI_SetTag(File,"data");
  621. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  622. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  623. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  624. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  625. INI_Close(File);
  626. return 1;
  627. }
  628.  
  629. public OnPlayerSpawn(playerid)
  630. {
  631. TextDrawShowForPlayer(playerid,Textdraw0);
  632. TextDrawShowForPlayer(playerid,Textdraw1);
  633. TextDrawShowForPlayer(playerid,Textdraw2);
  634. TextDrawShowForPlayer(playerid,Textdraw3);
  635. TextDrawShowForPlayer(playerid,Textdraw4);
  636. TextDrawShowForPlayer(playerid,Textdraw5);
  637. TextDrawShowForPlayer(playerid,Textdraw6);
  638. TextDrawShowForPlayer(playerid,Textdraw7);
  639. TextDrawShowForPlayer(playerid,Textdraw8);
  640. TextDrawShowForPlayer(playerid,Textdraw9);
  641. TextDrawShowForPlayer(playerid,Textdraw10);
  642. TextDrawShowForPlayer(playerid,Textdraw11);
  643. TextDrawShowForPlayer(playerid,Textdraw12);
  644. TextDrawShowForPlayer(playerid,Textdraw13);
  645. TextDrawShowForPlayer(playerid,Textdraw14);
  646. return 1;
  647. }
  648.  
  649. public OnPlayerDeath(playerid, killerid, reason)
  650. {
  651. PlayerInfo[killerid][pKills]++;
  652. PlayerInfo[playerid][pDeaths]++;
  653. return 1;
  654. }
  655.  
  656. public OnVehicleSpawn(vehicleid)
  657. {
  658. return 1;
  659. }
  660.  
  661. public OnVehicleDeath(vehicleid, killerid)
  662. {
  663. return 1;
  664. }
  665.  
  666. public OnPlayerText(playerid, text[])
  667. {
  668. return 1;
  669. }
  670.  
  671. public OnPlayerCommandText(playerid, cmdtext[])
  672. {
  673. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  674. {
  675. // Do something here
  676. return 1;
  677. }
  678. return 0;
  679. }
  680.  
  681. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  682. {
  683. return 1;
  684. }
  685.  
  686. public OnPlayerExitVehicle(playerid, vehicleid)
  687. {
  688. return 1;
  689. }
  690.  
  691. public OnPlayerStateChange(playerid, newstate, oldstate)
  692. {
  693. new vozilo = GetPlayerVehicleID(playerid);
  694. if(!VoziloJeBicikla(GetVehicleModel(GetPlayerVehicleID(playerid))))
  695. {
  696. new string[128];
  697. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw15);
  698. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw17);
  699. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw18);
  700. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw19);
  701. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw20);
  702. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw21);
  703. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw22);
  704. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw23);
  705. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw24);
  706. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw25);
  707. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw26);
  708. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw27);
  709. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw28);
  710. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw29);
  711. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw30);
  712. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw31);
  713. if(oldstate-1 && newstate) TextDrawShowForPlayer(playerid,Textdraw32);
  714. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw15);
  715. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw16);
  716. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw17);
  717. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw18);
  718. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw19);
  719. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw20);
  720. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw21);
  721. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw22);
  722. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw23);
  723. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw24);
  724. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw25);
  725. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw26);
  726. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw27);
  727. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw28);
  728. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw29);
  729. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw30);
  730. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw31);
  731. else if(newstate == PLAYER_STATE_DRIVER) TextDrawShowForPlayer(playerid,Textdraw32);
  732. format(string, sizeof(string), "%s", ImenaVozila[GetVehicleModel(vozilo) - 400]), TextDrawSetString(Textdraw29, string);
  733. }
  734. return 1;
  735. }
  736.  
  737. public OnPlayerEnterCheckpoint(playerid)
  738. {
  739. return 1;
  740. }
  741.  
  742. public OnPlayerLeaveCheckpoint(playerid)
  743. {
  744. return 1;
  745. }
  746.  
  747. public OnPlayerEnterRaceCheckpoint(playerid)
  748. {
  749. return 1;
  750. }
  751.  
  752. public OnPlayerLeaveRaceCheckpoint(playerid)
  753. {
  754. return 1;
  755. }
  756.  
  757. public OnRconCommand(cmd[])
  758. {
  759. return 1;
  760. }
  761.  
  762. public OnPlayerRequestSpawn(playerid)
  763. {
  764. return 1;
  765. }
  766.  
  767. public OnObjectMoved(objectid)
  768. {
  769. return 1;
  770. }
  771.  
  772. public OnPlayerObjectMoved(playerid, objectid)
  773. {
  774. return 1;
  775. }
  776.  
  777. public OnPlayerPickUpPickup(playerid, pickupid)
  778. {
  779. return 1;
  780. }
  781.  
  782. public OnVehicleMod(playerid, vehicleid, componentid)
  783. {
  784. return 1;
  785. }
  786.  
  787. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  788. {
  789. return 1;
  790. }
  791.  
  792. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  793. {
  794. return 1;
  795. }
  796.  
  797. public OnPlayerSelectedMenuRow(playerid, row)
  798. {
  799. return 1;
  800. }
  801.  
  802. public OnPlayerExitedMenu(playerid)
  803. {
  804. return 1;
  805. }
  806.  
  807. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  808. {
  809. return 1;
  810. }
  811.  
  812. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  813. {
  814. new Nitro = GetPVarInt(playerid, "Nitro");
  815. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || !CanUseNitro(GetPlayerVehicleID(playerid))) return false;
  816. else if ((((newkeys & (4)) == (4)) && ((oldkeys & (4)) != (4))))
  817. {
  818. if(Nitro > 0)
  819. {
  820. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  821. timer1 = SetTimerEx("NosUpdate", 100, true, "d", playerid);
  822. }
  823. }
  824. else if ((((newkeys & (4)) != (4)) && ((oldkeys & (4)) == (4))))
  825. {
  826. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  827. KillTimer(timer1);
  828. SetPVarInt(playerid, "Nitro", Nitro);
  829. }
  830. return 1;
  831. }
  832. public NosUpdate(playerid)
  833. {
  834. new Nitro = GetPVarInt(playerid, "Nitro");
  835. if(Nitro > 0)
  836. {
  837. Nitro -= NosConsumSpeed;
  838. SetPVarInt(playerid, "Nitro", Nitro);
  839. }
  840. else if(Nitro <= 0)
  841. {
  842. Nitro = 0;
  843. SetPVarInt(playerid, "Nitro", Nitro);
  844. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  845. }
  846. return 1;
  847. }
  848. public OnRconLoginAttempt(ip[], password[], success)
  849. {
  850. return 1;
  851. }
  852.  
  853. public OnPlayerUpdate(playerid)
  854. {
  855. if(IsPlayerInAnyVehicle(playerid))
  856. {
  857. if(!VoziloJeBicikla(GetVehicleModel(GetPlayerVehicleID(playerid))))
  858. {
  859. new sspeed[50];
  860. format(sspeed, sizeof(sspeed), "Speed: %d KM/H", GetSpeed(playerid));
  861. TextDrawSetString(Textdraw31, sspeed);
  862. new Float: Pos[4];
  863. GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  864. }
  865. }
  866. return 1;
  867. }
  868.  
  869. public OnPlayerStreamIn(playerid, forplayerid)
  870. {
  871. return 1;
  872. }
  873.  
  874. public OnPlayerStreamOut(playerid, forplayerid)
  875. {
  876. return 1;
  877. }
  878.  
  879. public OnVehicleStreamIn(vehicleid, forplayerid)
  880. {
  881. return 1;
  882. }
  883.  
  884. public OnVehicleStreamOut(vehicleid, forplayerid)
  885. {
  886. return 1;
  887. }
  888.  
  889. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  890. {
  891. switch( dialogid )
  892. {
  893. case DIALOG_REGISTER:
  894. {
  895. if (!response) return Kick(playerid);
  896. if(response)
  897. {
  898. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  899. new INI:File = INI_Open(UserPath(playerid));
  900. INI_SetTag(File,"data");
  901. INI_WriteInt(File,"Password",udb_hash(inputtext));
  902. INI_WriteInt(File,"Cash",0);
  903. INI_WriteInt(File,"Admin",0);
  904. INI_WriteInt(File,"Kills",0);
  905. INI_WriteInt(File,"Deaths",0);
  906. INI_Close(File);
  907.  
  908. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  909. SpawnPlayer(playerid);
  910. ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
  911. }
  912. }
  913.  
  914. case DIALOG_LOGIN:
  915. {
  916. if ( !response ) return Kick ( playerid );
  917. if( response )
  918. {
  919. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  920. {
  921. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  922. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  923. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
  924. }
  925. else
  926. {
  927. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  928. }
  929. return 1;
  930. }
  931. }
  932. }
  933. return 1;
  934. }
  935.  
  936. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  937. {
  938. return 1;
  939. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement