Advertisement
Guest User

xd

a guest
Mar 4th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.67 KB | None | 0 0
  1. /* I don't fuckin know what this is gonna be
  2. Started March 1st, 2018 4:13 PM CST
  3. you're mom gay*/
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <YSI\y_ini>
  8. #include <streamer>
  9.  
  10. //Colors
  11. #define COLOR_WHITE 0xFFFFFFFF
  12. #define COLOR_BLACK 0x000000FF
  13. #define COLOR_RED 0xFF0000FF
  14. #define COLOR_BROWN 0x800000FF
  15. #define COLOR_LIME 0x00FF00FF
  16. #define COLOR_GREEN 0x008000FF
  17. #define COLOR_CYAN 0x00FFFFFF
  18. #define COLOR_YELLOW 0xFFFF00FF
  19. #define COLOR_BLUE 0x0000FFFF
  20. #define COLOR_ORANGE 0xFF8000FF
  21. #define COLOR_PINK 0xFF00FFFF
  22. #define COLOR_PURPLE 0x8000FFFF
  23.  
  24. //Gay shit
  25. #define PATH "/Users/%s.ini"
  26.  
  27. //Dialogs
  28. #define DIALOG_REGISTER 1
  29. #define DIALOG_LOGIN 2
  30. #define DIALOG_SUCCESS_1 3
  31. #define DIALOG_SUCCESS_2 4
  32. #define DIALOG_TEAM_SELECTION 5
  33.  
  34. //Teams
  35. #define TEAM_USA 5000
  36. #define TEAM_CANADA 5001
  37. #define TEAM_BRITAIN 5002
  38. #define TEAM_AUSTRALIA 5003
  39. #define TEAM_RUSSIA 5004
  40. #define TEAM_GERMANY 5005
  41. #define TEAM_ITALY 5006
  42. #define TEAM_FRANCE 5007
  43. #define TEAM_CHINA 5008
  44. #define TEAM_INDIA 5009
  45.  
  46. #define COLOR_USA 0x0000FFFF
  47. #define COLOR_CANADA 0x008000FF
  48. #define COLOR_BRITAIN 0xFF0000FF
  49. #define COLOR_AUSTRALIA 0x0080FFFF
  50. #define COLOR_RUSSIA 0x800000FF
  51. #define COLOR_GERMANY 0xFFFF00FF
  52. #define COLOR_ITALY 0x408080FF
  53. #define COLOR_FRANCE 0x80FF80FF
  54. #define COLOR_CHINA 0xFF8000FF
  55. #define COLOR_INDIA 0x0080C0FF
  56.  
  57. #define COLOR_USA_EMBED "{0000FF}"
  58. #define COLOR_CANADA_EMBED "{008000}"
  59. #define COLOR_BRITAIN_EMBED "{FF0000}"
  60. #define COLOR_AUSTRALIA_EMBED "{0080FF}"
  61. #define COLOR_RUSSIA_EMBED "{800000}"
  62. #define COLOR_GERMANY_EMBED "{408080}"
  63. #define COLOR_ITALY_EMBED "{80FF80}"
  64. #define COLOR_FRANCE_EMBED "{0080C0}"
  65. #define COLOR_CHINA_EMBED "{FFFF00}"
  66. #define COLOR_INDIA_EMBED "{FF8000}"
  67.  
  68. //Player data
  69. enum pInfo
  70. {
  71. pPass,
  72. pCash,
  73. pAdmin,
  74. pKills,
  75. pDeaths,
  76. pVIP,
  77. pXP,
  78. pLevel,
  79. pLevelName[128],
  80. pTeam
  81. }
  82.  
  83. new PlayerInfo[MAX_PLAYERS][pInfo];
  84.  
  85.  
  86. main()
  87. {
  88. print("\n----------------------------------");
  89. print(" Maude Freeroam");
  90. print("----------------------------------\n");
  91. }
  92. public OnGameModeInit()
  93. {
  94. // Don't use these lines if it's a filterscript
  95. SetGameModeText("MAUDE FREEROAM");
  96. return 1;
  97. }
  98.  
  99. public OnGameModeExit()
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerRequestClass(playerid, classid)
  105. {
  106. SpawnPlayer(playerid);
  107. SpawnPlayerAtTeam(playerid);
  108. return 1;
  109. }
  110.  
  111. public OnPlayerConnect(playerid)
  112. {
  113. new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
  114. GetPlayerName(playerid, name, sizeof(name));
  115. format(string, sizeof(string), "-| %s has connected to the server |-", name);
  116. SendClientMessageToAll(COLOR_LIME, string);
  117.  
  118. if(fexist(UserPath(playerid)))
  119. {
  120. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  121. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Type your password below to login.","Login","Quit");
  122. }
  123. else
  124. {
  125. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Registering...","Type your password below to register a new account.","Register","Quit");
  126. }
  127. return 1;
  128. }
  129.  
  130. public OnPlayerDisconnect(playerid, reason)
  131. {
  132. new name[MAX_PLAYER_NAME], string[23 + MAX_PLAYER_NAME];
  133. GetPlayerName(playerid, name, sizeof(name));
  134.  
  135. new DisconnectReason[3][] =
  136. {
  137. "Timeout/Crash",
  138. "Quit",
  139. "Kick/Ban"
  140. };
  141.  
  142. format(string, sizeof(string), "-| %s has left the server (%s) |-", name, DisconnectReason[reason]);
  143. SendClientMessageToAll(COLOR_YELLOW, string);
  144.  
  145. new INI:File = INI_Open(UserPath(playerid));
  146. INI_SetTag(File,"data");
  147. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  148. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  149. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  150. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  151. INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]);
  152. INI_WriteInt(File,"XP",PlayerInfo[playerid][pXP]);
  153. INI_WriteInt(File,"Score",PlayerInfo[playerid][pLevel]);
  154. INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
  155. INI_Close(File);
  156. return 1;
  157. }
  158.  
  159. public OnPlayerSpawn(playerid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerDeath(playerid, killerid, reason)
  165. {
  166. SendDeathMessage(killerid, playerid, reason);
  167. PlayerInfo[playerid][pDeaths]++;
  168.  
  169. if(killerid != INVALID_PLAYER_ID)
  170. {
  171. new string1[128];
  172. new string2[128];
  173. format(string1, sizeof(string1), "You have been killed by %u!", killerid);
  174. format(string2, sizeof(string2), "You have killed %u, and received $1000!", playerid);
  175. SendClientMessage(playerid, COLOR_RED, string1);
  176. SendClientMessage(killerid, COLOR_LIME, string2);
  177. PlayerInfo[killerid][pKills]++;
  178. GivePlayerXP(killerid, 100);
  179. GivePlayerMoney(killerid, 1000);
  180. }
  181. return 1;
  182. }
  183.  
  184. public OnVehicleSpawn(vehicleid)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnVehicleDeath(vehicleid, killerid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerText(playerid, text[])
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnPlayerCommandText(playerid, cmdtext[])
  200. {
  201. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  202. {
  203. // Do something here
  204. return 1;
  205. }
  206. return 0;
  207. }
  208.  
  209. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerExitVehicle(playerid, vehicleid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerStateChange(playerid, newstate, oldstate)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerEnterCheckpoint(playerid)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerLeaveCheckpoint(playerid)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnPlayerEnterRaceCheckpoint(playerid)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerLeaveRaceCheckpoint(playerid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnRconCommand(cmd[])
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnPlayerRequestSpawn(playerid)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnObjectMoved(objectid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnPlayerObjectMoved(playerid, objectid)
  260. {
  261. return 1;
  262. }
  263.  
  264. public OnPlayerPickUpPickup(playerid, pickupid)
  265. {
  266. return 1;
  267. }
  268.  
  269. public OnVehicleMod(playerid, vehicleid, componentid)
  270. {
  271. return 1;
  272. }
  273.  
  274. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  275. {
  276. return 1;
  277. }
  278.  
  279. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  280. {
  281. return 1;
  282. }
  283.  
  284. public OnPlayerSelectedMenuRow(playerid, row)
  285. {
  286. return 1;
  287. }
  288.  
  289. public OnPlayerExitedMenu(playerid)
  290. {
  291. return 1;
  292. }
  293.  
  294. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  295. {
  296. return 1;
  297. }
  298.  
  299. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  300. {
  301. return 1;
  302. }
  303.  
  304. public OnRconLoginAttempt(ip[], password[], success)
  305. {
  306. return 1;
  307. }
  308.  
  309. public OnPlayerUpdate(playerid)
  310. {
  311. return 1;
  312. }
  313.  
  314. public OnPlayerStreamIn(playerid, forplayerid)
  315. {
  316. return 1;
  317. }
  318.  
  319. public OnPlayerStreamOut(playerid, forplayerid)
  320. {
  321. return 1;
  322. }
  323.  
  324. public OnVehicleStreamIn(vehicleid, forplayerid)
  325. {
  326. return 1;
  327. }
  328.  
  329. public OnVehicleStreamOut(vehicleid, forplayerid)
  330. {
  331. return 1;
  332. }
  333.  
  334. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  335. {
  336. switch( dialogid )
  337. {
  338. case DIALOG_REGISTER:
  339. {
  340. if (!response) return Kick(playerid);
  341. if(response)
  342. {
  343. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
  344. new INI:File = INI_Open(UserPath(playerid));
  345. INI_SetTag(File,"data");
  346. INI_WriteInt(File,"Password",udb_hash(inputtext));
  347. INI_WriteInt(File,"Cash",0);
  348. INI_WriteInt(File,"Admin",0);
  349. INI_WriteInt(File,"Kills",0);
  350. INI_WriteInt(File,"Deaths",0);
  351. INI_WriteInt(File,"VIP",0);
  352. INI_WriteInt(File,"XP",0);
  353. INI_WriteInt(File,"Level",0);
  354. INI_Close(File);
  355.  
  356. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  357. SpawnPlayer(playerid);
  358. ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"You have registered, please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
  359. }
  360. }
  361.  
  362. case DIALOG_LOGIN:
  363. {
  364. if ( !response ) return Kick ( playerid );
  365. if( response )
  366. {
  367. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  368. {
  369. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  370. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  371. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  372. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"Success!","You have successfully logged in!","Ok","");
  373. SpawnPlayer(playerid);
  374. SpawnPlayerAtTeam(playerid);
  375. }
  376. else
  377. {
  378. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
  379. }
  380. return 1;
  381. }
  382. }
  383. }
  384.  
  385. if(dialogid == DIALOG_TEAM_SELECTION)
  386. {
  387. if(response)
  388. {
  389. switch(listitem)
  390. {
  391. case 0: AltSetPlayerTeam(playerid, TEAM_USA);
  392. case 1: AltSetPlayerTeam(playerid, TEAM_CANADA);
  393. case 2: AltSetPlayerTeam(playerid, TEAM_BRITAIN);
  394. case 3: AltSetPlayerTeam(playerid, TEAM_AUSTRALIA);
  395. case 4: AltSetPlayerTeam(playerid, TEAM_RUSSIA);
  396. case 5: AltSetPlayerTeam(playerid, TEAM_GERMANY);
  397. case 6: AltSetPlayerTeam(playerid, TEAM_ITALY);
  398. case 7: AltSetPlayerTeam(playerid, TEAM_FRANCE);
  399. case 8: AltSetPlayerTeam(playerid, TEAM_CHINA);
  400. case 9: AltSetPlayerTeam(playerid, TEAM_INDIA);
  401. }
  402. }
  403. return 1;
  404. }
  405.  
  406. return 0;
  407. }
  408.  
  409. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  410. {
  411. return 1;
  412. }
  413.  
  414. /*////////////////////////////////////
  415. COMMANDS
  416. *//////////////////////////////////////
  417. CMD:changeteam(playerid, params[])
  418. {
  419. ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"You have registered, please select your team.",""COLOR_USA_EMBED"United States\n"COLOR_CANADA_EMBED"Canada\n"COLOR_BRITAIN_EMBED"Britain\n"COLOR_AUSTRALIA_EMBED"Australia\n"COLOR_RUSSIA_EMBED"Russia\n"COLOR_CHINA_EMBED"China\n"COLOR_GERMANY_EMBED"Germany\n"COLOR_ITALY_EMBED"Italy\n"COLOR_INDIA_EMBED"India\n"COLOR_FRANCE_EMBED"France","Select","");
  420. return 1;
  421. }
  422.  
  423. /*////////////////////////////////////////////////////
  424. YEET DAB
  425. *////////////////////////////////////////////////////
  426. forward LoadUser_data(playerid,name[],value[]);
  427. public LoadUser_data(playerid,name[],value[])
  428. {
  429. INI_Int("Password",PlayerInfo[playerid][pPass]);
  430. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  431. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  432. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  433. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  434. INI_Int("VIP",PlayerInfo[playerid][pVIP]);
  435. INI_Int("XP",PlayerInfo[playerid][pXP]);
  436. INI_Int("Level",PlayerInfo[playerid][pLevel]);
  437. return 1;
  438. }
  439.  
  440. stock UserPath(playerid)
  441. {
  442. new string[128],playername[MAX_PLAYER_NAME];
  443. GetPlayerName(playerid,playername,sizeof(playername));
  444. format(string,sizeof(string),PATH,playername);
  445. return string;
  446. }
  447.  
  448. /*Credits to Dracoblue*/
  449. stock udb_hash(buf[]) {
  450. new length=strlen(buf);
  451. new s1 = 1;
  452. new s2 = 0;
  453. new n;
  454. for (n=0; n<length; n++)
  455. {
  456. s1 = (s1 + buf[n]) % 65521;
  457. s2 = (s2 + s1) % 65521;
  458. }
  459. return (s2 << 16) + s1;
  460. }
  461.  
  462. stock PlayerLevelUp(playerid)
  463. {
  464. PlayerInfo[playerid][pLevel]++;
  465. }
  466.  
  467. stock GivePlayerXP(playerid, xpamount)
  468. {
  469. PlayerInfo[playerid][pXP] += xpamount;
  470. LevelUpCheck(playerid);
  471. }
  472.  
  473. /*//////////////////////////////////////////////////
  474. LEVELS
  475. *//////////////////////////////////////////////////
  476.  
  477. stock GetPlayerLevel(playerid)
  478. {
  479. if(PlayerInfo[playerid][pLevel] == 1) return 1;
  480. if(PlayerInfo[playerid][pLevel] == 2) return 2;
  481. if(PlayerInfo[playerid][pLevel] == 3) return 3;
  482. if(PlayerInfo[playerid][pLevel] == 4) return 4;
  483. if(PlayerInfo[playerid][pLevel] == 5) return 5;
  484. if(PlayerInfo[playerid][pLevel] == 6) return 6;
  485. if(PlayerInfo[playerid][pLevel] == 7) return 7;
  486. if(PlayerInfo[playerid][pLevel] == 8) return 8;
  487. if(PlayerInfo[playerid][pLevel] == 9) return 9;
  488. if(PlayerInfo[playerid][pLevel] == 10) return 10;
  489. if(PlayerInfo[playerid][pLevel] == 11) return 11;
  490. if(PlayerInfo[playerid][pLevel] == 12) return 12;
  491. if(PlayerInfo[playerid][pLevel] == 13) return 13;
  492. if(PlayerInfo[playerid][pLevel] == 14) return 14;
  493. if(PlayerInfo[playerid][pLevel] == 15) return 15;
  494. if(PlayerInfo[playerid][pLevel] == 16) return 16;
  495. if(PlayerInfo[playerid][pLevel] == 17) return 17;
  496. if(PlayerInfo[playerid][pLevel] == 18) return 18;
  497. if(PlayerInfo[playerid][pLevel] == 19) return 19;
  498. if(PlayerInfo[playerid][pLevel] == 20) return 20;
  499. if(PlayerInfo[playerid][pLevel] == 21) return 21;
  500. if(PlayerInfo[playerid][pLevel] == 22) return 22;
  501. if(PlayerInfo[playerid][pLevel] == 23) return 23;
  502. if(PlayerInfo[playerid][pLevel] == 24) return 24;
  503. if(PlayerInfo[playerid][pLevel] == 25) return 25;
  504. if(PlayerInfo[playerid][pLevel] == 26) return 26;
  505. if(PlayerInfo[playerid][pLevel] == 27) return 27;
  506. if(PlayerInfo[playerid][pLevel] == 28) return 28;
  507. if(PlayerInfo[playerid][pLevel] == 29) return 29;
  508. if(PlayerInfo[playerid][pLevel] == 30) return 30;
  509. }
  510.  
  511. stock LevelUpCheck(playerid)
  512. {
  513. if(PlayerInfo[playerid][pXP] == 100) PlayerLevelUp(playerid); //To level 2
  514. if(PlayerInfo[playerid][pXP] == 250) PlayerLevelUp(playerid); //To level 3
  515. if(PlayerInfo[playerid][pXP] == 500) PlayerLevelUp(playerid); //To level 4
  516. if(PlayerInfo[playerid][pXP] == 750) PlayerLevelUp(playerid); //To level 5
  517. if(PlayerInfo[playerid][pXP] == 1000) PlayerLevelUp(playerid); //To level 6
  518. if(PlayerInfo[playerid][pXP] == 1250) PlayerLevelUp(playerid); //To level 7
  519. if(PlayerInfo[playerid][pXP] == 1500) PlayerLevelUp(playerid); //To level 8
  520. if(PlayerInfo[playerid][pXP] == 1750) PlayerLevelUp(playerid); //To level 9
  521. if(PlayerInfo[playerid][pXP] == 2000) PlayerLevelUp(playerid); //To level 10
  522. if(PlayerInfo[playerid][pXP] == 2500) PlayerLevelUp(playerid); //To level 11
  523. if(PlayerInfo[playerid][pXP] == 3000) PlayerLevelUp(playerid); //To level 12
  524. if(PlayerInfo[playerid][pXP] == 3500) PlayerLevelUp(playerid); //To level 13
  525. if(PlayerInfo[playerid][pXP] == 4000) PlayerLevelUp(playerid); //To level 14
  526. if(PlayerInfo[playerid][pXP] == 4500) PlayerLevelUp(playerid); //To level 15
  527. if(PlayerInfo[playerid][pXP] == 5000) PlayerLevelUp(playerid); //To level 16
  528. if(PlayerInfo[playerid][pXP] == 5500) PlayerLevelUp(playerid); //To level 17
  529. if(PlayerInfo[playerid][pXP] == 6000) PlayerLevelUp(playerid); //To Level 18
  530. if(PlayerInfo[playerid][pXP] == 6500) PlayerLevelUp(playerid); //To level 19
  531. if(PlayerInfo[playerid][pXP] == 7000) PlayerLevelUp(playerid); //To Level 20
  532. if(PlayerInfo[playerid][pXP] == 7500) PlayerLevelUp(playerid); //To Level 21
  533. if(PlayerInfo[playerid][pXP] == 8000) PlayerLevelUp(playerid); //To Level 22
  534. if(PlayerInfo[playerid][pXP] == 8500) PlayerLevelUp(playerid); //To Level 23
  535. if(PlayerInfo[playerid][pXP] == 9000) PlayerLevelUp(playerid); //To level 24
  536. if(PlayerInfo[playerid][pXP] == 10000) PlayerLevelUp(playerid); //To level 25
  537. if(PlayerInfo[playerid][pXP] == 11000) PlayerLevelUp(playerid); //To level 26
  538. if(PlayerInfo[playerid][pXP] == 12000) PlayerLevelUp(playerid); //To level 27
  539. if(PlayerInfo[playerid][pXP] == 13000) PlayerLevelUp(playerid); //To level 28
  540. if(PlayerInfo[playerid][pXP] == 14000) PlayerLevelUp(playerid); //To level 29
  541. if(PlayerInfo[playerid][pXP] == 15000) PlayerLevelUp(playerid); //To level 30
  542. }
  543.  
  544. stock SetPlayerLevelName(playerid)
  545. {
  546. if(PlayerInfo[playerid][pLevel] == 1) pInfo[playerid][pLevelName] = "Private I";
  547. if(PlayerInfo[playerid][pLevel] == 2) pInfo[playerid][pLevelName] = "Private II";
  548. if(PlayerInfo[playerid][pLevel] == 3) pInfo[playerid][pLevelName] = "Private III";
  549. if(PlayerInfo[playerid][pLevel] == 4) pInfo[playerid][pLevelName] = "Private First Class";
  550. if(PlayerInfo[playerid][pLevel] == 5) pInfo[playerid][pLevelName] = "Specialist";
  551. if(PlayerInfo[playerid][pLevel] == 6) pInfo[playerid][pLevelName] = "Corporal";
  552. if(PlayerInfo[playerid][pLevel] == 7) pInfo[playerid][pLevelName] = "Sergeant";
  553. if(PlayerInfo[playerid][pLevel] == 8) pInfo[playerid][pLevelName] = "Staff Sergeant";
  554. if(PlayerInfo[playerid][pLevel] == 9) pInfo[playerid][pLevelName] = "Sergeant First Class";
  555. if(PlayerInfo[playerid][pLevel] == 10) pInfo[playerid][pLevelName] = "Master Sergeant";
  556. if(PlayerInfo[playerid][pLevel] == 11) pInfo[playerid][pLevelName] = "First Sergeant";
  557. if(PlayerInfo[playerid][pLevel] == 12) pInfo[playerid][pLevelName] = "Sergeant Major";
  558. if(PlayerInfo[playerid][pLevel] == 13) pInfo[playerid][pLevelName] = "Command Sergeant Major";
  559. if(PlayerInfo[playerid][pLevel] == 14) pInfo[playerid][pLevelName] = "Sergeant Major of the Army";
  560. if(PlayerInfo[playerid][pLevel] == 15) pInfo[playerid][pLevelName] = "Warrant Officer";
  561. if(PlayerInfo[playerid][pLevel] == 16) pInfo[playerid][pLevelName] = "Chief Warrant Officer II";
  562. if(PlayerInfo[playerid][pLevel] == 17) pInfo[playerid][pLevelName] = "Chief Warrant Officer III";
  563. if(PlayerInfo[playerid][pLevel] == 18) pInfo[playerid][pLevelName] = "Chief Warrant Officer IV";
  564. if(PlayerInfo[playerid][pLevel] == 19) pInfo[playerid][pLevelName] = "Chief Warrant Officer V";
  565. if(PlayerInfo[playerid][pLevel] == 20) pInfo[playerid][pLevelName] = "Second Lieutenant";
  566. if(PlayerInfo[playerid][pLevel] == 21) pInfo[playerid][pLevelName] = "First Lieutenant";
  567. if(PlayerInfo[playerid][pLevel] == 22) pInfo[playerid][pLevelName] = "Captain";
  568. if(PlayerInfo[playerid][pLevel] == 23) pInfo[playerid][pLevelName] = "Major";
  569. if(PlayerInfo[playerid][pLevel] == 24) pInfo[playerid][pLevelName] = "Lieutenant Colonel";
  570. if(PlayerInfo[playerid][pLevel] == 25) pInfo[playerid][pLevelName] = "Colonel";
  571. if(PlayerInfo[playerid][pLevel] == 26) pInfo[playerid][pLevelName] = "Brigadier General";
  572. if(PlayerInfo[playerid][pLevel] == 27) pInfo[playerid][pLevelName] = "Major General";
  573. if(PlayerInfo[playerid][pLevel] == 28) pInfo[playerid][pLevelName] = "Lieutenant General";
  574. if(PlayerInfo[playerid][pLevel] == 29) pInfo[playerid][pLevelName] = "General";
  575. if(PlayerInfo[playerid][pLevel] == 30) pInfo[playerid][pLevelName] = "General of the Army";
  576. }
  577.  
  578. stock GetPlayerLevelName(playerid)
  579. {
  580. SetPlayerLevelName(playerid);
  581. return pInfo[playerid][pLevelName];
  582. }
  583.  
  584. /*/////////////////////////////////////////
  585. TEAMS
  586. *///////////////////////////////////////////
  587. stock AltSetPlayerTeam(playerid, team)
  588. {
  589. SetPlayerTeam(playerid, team);
  590. PlayerInfo[playerid][pTeam] = team;
  591. SpawnPlayerAtTeam(playerid);
  592. if(team == TEAM_USA) SetPlayerColor(playerid, COLOR_USA);
  593. if(team == TEAM_CANADA) SetPlayerColor(playerid, COLOR_CANADA);
  594. if(team == TEAM_BRITAIN) SetPlayerColor(playerid, COLOR_BRITAIN);
  595. if(team == TEAM_AUSTRALIA) SetPlayerColor(playerid, COLOR_AUSTRALIA);
  596. if(team == TEAM_RUSSIA) SetPlayerColor(playerid, COLOR_RUSSIA);
  597. if(team == TEAM_GERMANY) SetPlayerColor(playerid, COLOR_GERMANY);
  598. if(team == TEAM_ITALY) SetPlayerColor(playerid, COLOR_ITALY);
  599. if(team == TEAM_FRANCE) SetPlayerColor(playerid, COLOR_FRANCE);
  600. if(team == TEAM_CHINA) SetPlayerColor(playerid, COLOR_CHINA);
  601. if(team == TEAM_INDIA) SetPlayerColor(playerid, COLOR_INDIA);
  602. }
  603.  
  604. stock SpawnPlayerAtTeam(playerid)
  605. {
  606. new Float:USASpawns[3][4] =
  607. {
  608. {154.0558,1912.6029,18.8228,4.6064},
  609. {213.6994,1874.9786,17.6406,3.0163},
  610. {153.7363,1847.5313,17.6406,356.7496}
  611. };
  612. new Float:CanadaSpawns[3][4] =
  613. {
  614. {-472.4701,-194.1285,78.0881,20.1248},
  615. {-541.7864,-151.8316,77.0442,359.2529},
  616. {-536.2971,-98.5008,63.2969,273.6887}
  617. };
  618. new Float:BritainSpawns[3][4] =
  619. {
  620. {-1521.9277,481.4308,7.1875,180.5736},
  621. {-1348.7789,500.1924,18.2344,348.6155},
  622. {-1563.8306,316.6201,7.1875,131.1303}
  623. };
  624. new Float:AustraliaSpawns[3][4] =
  625. {
  626. {-688.0345,944.7898,13.6328,0.0469},
  627. {-686.2051,979.6094,12.1262,87.5167},
  628. {-687.8675,929.7429,13.6293,181.1319}
  629. };
  630. new Float:RussiaSpawns[3][4] =
  631. {
  632. {-2520.4351,-624.5309,132.7848,0.8743},
  633. {-2487.4331,-621.0484,132.5872,87.1375},
  634. {-2374.1062,-583.5718,132.1172,118.5435}
  635. };
  636. new Float:GermanySpawns[3][4] =
  637. {
  638. {1106.4036,-299.6010,74.5391,99.9817},
  639. {1073.4133,-345.0207,73.9922,356.5807},
  640. {1023.7352,-316.0926,73.9889,175.7202}
  641. };
  642. new Float:ItalySpawns[3][4] =
  643. {
  644. {-1070.8738,-1170.6907,129.6406,234.3037},
  645. {-1060.0549,-1205.3832,129.2188,267.3490},
  646. {-1067.8376,-1299.5409,129.2188,276.0990}
  647. };
  648. new Float:FranceSpawns[3][4] =
  649. {
  650. {-2237.7219,2353.6807,4.9803,132.8337},
  651. {-2241.0059,2333.7966,4.9918,99.6200},
  652. {-2281.6807,2288.4836,4.9704,271.9083}
  653. };
  654. new Float:ChinaSpawns[3][4] =
  655. {
  656. {2735.4065,-2452.2302,17.5938,359.3937},
  657. {2721.3025,-2386.2537,17.3403,266.3329},
  658. {2752.5508,-2513.4436,13.6402,19.0380}
  659. };
  660. new Float:IndiaSpawns[3][4] =
  661. {
  662. {2841.2942,1285.7273,11.3906,88.5804},
  663. {2794.3298,1256.1736,11.0299,4.2696},
  664. {2837.1394,1337.4557,11.0877,82.9403}
  665. };
  666.  
  667. new rnd;
  668. if(PlayerInfo[playerid][pTeam] == TEAM_USA) rnd = random(sizeof(USASpawns)); SetPlayerPos(playerid,USASpawns[rnd][0],USASpawns[rnd][1],USASpawns[rnd][2]); SetPlayerFacingAngle(playerid, USASpawns[rnd][3]);
  669. if(PlayerInfo[playerid][pTeam] == TEAM_CANADA) rnd = random(sizeof(CanadaSpawns)); SetPlayerPos(playerid,CanadaSpawns[rnd][0],CanadaSpawns[rnd][1],CanadaSpawns[rnd][2]); SetPlayerFacingAngle(playerid, CanadaSpawns[rnd][3]);
  670. if(PlayerInfo[playerid][pTeam] == TEAM_BRITAIN) rnd = random(sizeof(BritainSpawns)); SetPlayerPos(playerid,BritainSpawns[rnd][0],BritainSpawns[rnd][1],BritainSpawns[rnd][2]); SetPlayerFacingAngle(playerid, BritainSpawns[rnd][3]);
  671. if(PlayerInfo[playerid][pTeam] == TEAM_AUSTRALIA) rnd = random(sizeof(AustraliaSpawns)); SetPlayerPos(playerid,AustraliaSpawns[rnd][0],AustraliaSpawns[rnd][1],AustraliaSpawns[rnd][2]); SetPlayerFacingAngle(playerid, AustraliaSpawns[rnd][3]);
  672. if(PlayerInfo[playerid][pTeam] == TEAM_RUSSIA) rnd = random(sizeof(RussiaSpawns)); SetPlayerPos(playerid,RussiaSpawns[rnd][0],RussiaSpawns[rnd][1],RussiaSpawns[rnd][2]); SetPlayerFacingAngle(playerid,RussiaSpawns[rnd][3]);
  673. if(PlayerInfo[playerid][pTeam] == TEAM_GERMANY) rnd = random(sizeof(GermanySpawns)); SetPlayerPos(playerid,GermanySpawns[rnd][0],GermanySpawns[rnd][1],GermanySpawns[rnd][2]); SetPlayerFacingAngle(playerid, GermanySpawns[rnd][3]);
  674. if(PlayerInfo[playerid][pTeam] == TEAM_ITALY) rnd = random(sizeof(ItalySpawns)); SetPlayerPos(playerid,ItalySpawns[rnd][0],ItalySpawns[rnd][1],ItalySpawns[rnd][2]); SetPlayerFacingAngle(playerid, ItalySpawns[rnd][3]);
  675. if(PlayerInfo[playerid][pTeam] == TEAM_FRANCE) rnd = random(sizeof(FranceSpawns)); SetPlayerPos(playerid,FranceSpawns[rnd][0],FranceSpawns[rnd][1],FranceSpawns[rnd][2]); SetPlayerFacingAngle(playerid, FranceSpawns[rnd][3]);
  676. if(PlayerInfo[playerid][pTeam] == TEAM_CHINA) rnd = random(sizeof(ChinaSpawns)); SetPlayerPos(playerid,ChinaSpawns[rnd][0],ChinaSpawns[rnd][1],ChinaSpawns[rnd][2]); SetPlayerFacingAngle(playerid, ChinaSpawns[rnd][3]);
  677. if(PlayerInfo[playerid][pTeam] == TEAM_INDIA) rnd = random(sizeof(IndiaSpawns)); SetPlayerPos(playerid,IndiaSpawns[rnd][0],IndiaSpawns[rnd][1],IndiaSpawns[rnd][2]); SetPlayerFacingAngle(playerid, IndiaSpawns[rnd][3]);
  678. SetCameraBehindPlayer(playerid);
  679. SetPlayerSkin(playerid, 287);
  680. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement