JJB562

DJTunes Script

Jun 18th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 24.88 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. // Name: Call of Duty 2 [COD2]                                                //
  3. // Author: Rapha3L, Hollywood/DJTunes                                         //
  4. // Script Version: 0.1                                                        //
  5. // Last Update: Never                                                         //
  6. // Helpers: [_MS_]BodyBuilder                                                 //
  7. // Thanks to: [_MS_]BodyBuilder                                               //
  8. // Info: This is a simple base to DM Servers. Check out the updates.          //
  9. // Notice: This is an edited version of Rapha3L's TDM script.                 //
  10. ////////////////////////////////////////////////////////////////////////////////
  11. // Updates                                                                    //
  12. // 6/17/2013 - Added Random Messages.                                         //
  13. ////////////////////////////////////////////////////////////////////////////////
  14.  
  15. //---[Includes]---//
  16.  
  17. #include <a_samp>
  18. #include <zcmd>
  19. #include <YSI\y_ini>
  20.  
  21. //---[Login Dialogs]---//
  22. #define DIALOG_REGISTER 1
  23. #define DIALOG_LOGIN 2
  24. #define DIALOG_SUCCESS_1 3
  25. #define DIALOG_SUCCESS_2 4
  26.  
  27. #define PATH "/Users/%s.ini"
  28.  
  29. //---[Colors---//
  30. #define COL_WHITE "{FFFFFF}"
  31. #define COL_RED "{F81414}"
  32. #define COL_GREEN "{00FF22}"
  33.  
  34. #define COLOR_GREY 0xAFAFAFAA
  35. #define COLOR_GREEN 0x33AA33AA
  36. #define COLOR_RED 0xFF0000
  37. #define COLOR_YELLOW 0xFFFF00AA
  38. #define COLOR_WHITE 0xFFFFFFAA
  39. #define COLOR_BLUE 0x0000BBAA
  40. #define COLOR_LIGHTBLUE 0x33CCFFAA
  41. #define COLOR_ORANGE 0xFF9900AA
  42. #define COLOR_LIME 0x10F441AA
  43. #define COLOR_MAGENTA 0xFF00FFFF
  44. #define COLOR_NAVY 0x000080AA
  45. #define COLOR_AQUA 0xF0F8FFAA
  46. #define COLOR_CRIMSON 0xDC143CAA
  47. #define COLOR_FLBLUE 0x6495EDAA
  48. #define COLOR_BISQUE 0xFFE4C4AA
  49. #define COLOR_BLACK 0x000000AA
  50. #define COLOR_CHARTREUSE 0x7FFF00AA
  51. #define COLOR_BROWN 0XA52A2AAA
  52. #define COLOR_CORAL 0xFF7F50AA
  53. #define COLOR_GOLD 0xB8860BAA
  54. #define COLOR_GREENYELLOW 0xADFF2FAA
  55. #define COLOR_INDIGO 0x4B00B0AA
  56. #define COLOR_IVORY 0xFFFF82AA
  57. #define COLOR_LAWNGREEN 0x7CFC00AA
  58. #define COLOR_SEAGREEN 0x20B2AAAA
  59. #define COLOR_LIMEGREEN 0x32CD32AA
  60. #define COLOR_MIDNIGHTBLUE 0X191970AA
  61. #define COLOR_MAROON 0x800000AA
  62. #define COLOR_OLIVE 0x808000AA
  63. #define COLOR_ORANGERED 0xFF4500AA
  64. #define COLOR_PINK 0xFFC0CBAA
  65. #define COLOR_SPRINGGREEN 0x00FF7FAA
  66. #define COLOR_TOMATO 0xFF6347AA
  67. #define COLOR_YELLOWGREEN 0x9ACD32AA
  68. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  69. #define COLOR_MEDIUMMAGENTA 0x8B008BAA
  70.  
  71. //---[Login & Register System Variables]---//
  72.  
  73. enum pInfo
  74. {
  75.     pPass,
  76.     pCash,
  77.     pAdmin,
  78.     pKills,
  79.     pDeaths
  80. }
  81. new PlayerInfo[MAX_PLAYERS][pInfo];
  82.  
  83. //---[Login & Register System Stocks]---//
  84.  
  85. stock UserPath(playerid)
  86. {
  87.     new string[128], playername[MAX_PLAYER_NAME];
  88.     GetPlayerName(playerid,playername,sizeof(playername));
  89.     format(string,sizeof(string),PATH,playername);
  90.     return string;
  91. }
  92. stock udb_hash(buf[]) {
  93.     new length=strlen(buf);
  94.     new s1 = 1;
  95.     new s2 = 0;
  96.     new n;
  97.     for (n=0; n<length; n++)
  98.     {
  99.        s1 = (s1 + buf[n]) % 65521;
  100.        s2 = (s2 + s1)     % 65521;
  101.     }
  102.     return (s2 << 16) + s1;
  103. }
  104.  
  105. //---[Login & Register System Functions]---//
  106.  
  107. forward LoadUser_data(playerid,name[],value[]);
  108. public LoadUser_data(playerid,name[],value[])
  109. {
  110.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  111.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  112.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  113.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  114.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  115.     return 1;
  116. }
  117.  
  118. //---[Random Messages Settings (Settings)---//
  119.  
  120. new RandomMSG[][] =
  121. {
  122.     "Welcome to Call of Duty 2, scripted by Hollywood (DJTunes)!",
  123.     "The release of this script is posted on SA-MP forums.",
  124.     "Please be sure to add reputation to DJTunes!"
  125. };
  126.  
  127. //---[Random Messages Settings (Foward)]---//
  128.  
  129. forward SendMSG();
  130.  
  131. //---[Random Messages Settings (Settings)---//
  132. public SendMSG()
  133. {
  134.     new randMSG = random(sizeof(RandomMSG));
  135.     SendClientMessageToAll(COLOR_GREEN, RandomMSG[randMSG]);
  136. }
  137.  
  138. //---[Random Spawns]---//
  139.  
  140. new Float:RandomSpawns[][] =
  141. {
  142.     {-1513.3469,2536.8325,55.6875,46.0863},
  143.     {-1534.5206,2543.3533,55.8359,64.1873},
  144.     {-1537.3022,2560.8057,55.8359,9.9801},
  145.     {-1537.1564,2592.4919,55.8359,347.1066},
  146.     {-1552.3397,2600.5630,55.8359,36.6137},
  147.     {-1523.5328,2608.2029,55.8359,289.7661},
  148.     {-1489.5654,2607.8162,55.8359,291.6460},
  149.     {-1479.0426,2595.0493,55.8359,39.5787},
  150.     {-1460.0007,2619.5195,58.7734,152.6931},
  151.     {-1435.4955,2608.3745,55.8359,274.4125},
  152.     {-1420.5632,2613.4656,55.8359,146.4264},
  153.     {-1414.7498,2594.2373,55.8403,51.7988},
  154.     {-1458.2444,2641.4443,55.8359,38.4703},
  155.     {-1476.6389,2661.3892,55.8359,56.9571},
  156.     {-1507.6934,2663.9001,55.8359,81.7107},
  157.     {-1528.0374,2677.3118,55.8359,171.7108},
  158.     {-1562.5850,2662.7412,55.8359,349.1795},
  159.     {-1539.6945,2623.1128,55.8359,196.7286},
  160.     {-1513.9823,2594.6506,55.8359,279.3923}
  161. };
  162.  
  163. //---[Textdraw - Server Name]---//
  164.  
  165. new Text:Textdraw1;
  166.  
  167. //---[Server Configs + Objects & Skins]---//
  168.  
  169. public OnGameModeInit()
  170. {
  171.     SetTimer("SendMSG", 120000, true);
  172.     SetGameModeText("COD2");
  173.     SendRconCommand("mapname Downturn");
  174.     UsePlayerPedAnims();
  175.     DisableInteriorEnterExits();
  176.  
  177.     Textdraw1= TextDrawCreate(1.0, 433.0, "Call of Duty 2 v0.1");
  178.     TextDrawAlignment(Textdraw1,0);
  179.     TextDrawBackgroundColor(Textdraw1,0x000000ff);
  180.     TextDrawFont(Textdraw1,2);
  181.     TextDrawLetterSize(Textdraw1,0.2999, 1.4);
  182.     TextDrawBoxColor(Textdraw1,0x00000050);
  183.     TextDrawColor(Textdraw1,0xffffffff);
  184.     TextDrawSetOutline(Textdraw1,1);
  185.     TextDrawSetProportional(Textdraw1,1);
  186.     TextDrawSetShadow(Textdraw1,1);
  187.    
  188.     for(new i; i < MAX_PLAYERS; i ++)
  189.     {
  190.         if(IsPlayerConnected(i))
  191.         {
  192.             TextDrawShowForPlayer(i, Textdraw1);
  193.         }
  194.     }
  195.  
  196. //---[Skins]---//
  197.  
  198.     AddPlayerClass(18, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  199.     AddPlayerClass(19, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  200.     AddPlayerClass(17, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  201.     AddPlayerClass(23, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  202.     AddPlayerClass(29, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  203.     AddPlayerClass(45, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  204.     AddPlayerClass(78, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  205.     AddPlayerClass(97, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  206.     AddPlayerClass(101, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  207.     AddPlayerClass(145, 1958.3783, 1343.1572, 15.3746, 269.1425, 24, 9999, 25, 9999, 34, 500);
  208.  
  209. //---[Cars]---//
  210.  
  211.     AddStaticVehicleEx(475,-1507.6999500,2526.6999500,55.6000000,0.0000000,-1,-1,15);
  212.     AddStaticVehicleEx(542,-1522.6999500,2526.6999500,55.6000000,0.0000000,-1,-1,15);
  213.     AddStaticVehicleEx(562,-1482.6999500,2560.3000500,55.6000000,50.0000000,-1,-1,15);
  214.     AddStaticVehicleEx(562,-1485.8000500,2545.6001000,55.6000000,203.9990000,-1,-1,15);
  215.     AddStaticVehicleEx(477,-1522.5000000,2588.5000000,55.7000000,0.0000000,-1,-1,15);
  216.     AddStaticVehicleEx(477,-1502.0999800,2635.3999000,55.7000000,196.0000000,-1,-1,15);
  217.     AddStaticVehicleEx(411,-1472.1999500,2691.0000000,55.6000000,0.0000000,-1,-1,15);
  218.     AddStaticVehicleEx(411,-1445.1999500,2682.5000000,55.6000000,124.0000000,-1,-1,15);
  219.     AddStaticVehicleEx(411,-1400.0000000,2653.1999500,55.5000000,87.9970000,-1,-1,15);
  220.     AddStaticVehicleEx(411,-1400.0000000,2638.1999500,55.5000000,87.9950000,-1,-1,15);
  221.     AddStaticVehicleEx(555,-1432.4000200,2591.8999000,55.6000000,0.0000000,-1,-1,15);
  222.     AddStaticVehicleEx(555,-1446.4000200,2589.0000000,55.6000000,0.0000000,-1,-1,15);
  223.     AddStaticVehicleEx(555,-1464.1999500,2589.3000500,55.6000000,0.0000000,-1,-1,15);
  224.     AddStaticVehicleEx(536,-1563.9000200,2687.8999000,55.5000000,0.0000000,-1,-1,15);
  225.     AddStaticVehicleEx(567,-1559.8000500,2693.6999500,55.8000000,0.0000000,-1,-1,15);
  226.     AddStaticVehicleEx(535,-1596.0999800,2692.6999500,54.8000000,0.0000000,-1,-1,15);
  227.     AddStaticVehicleEx(401,-1560.0999800,2632.8000500,55.7000000,0.0000000,-1,-1,15);
  228.     AddStaticVehicleEx(506,-1532.0000000,2641.8999000,55.6000000,60.0000000,-1,-1,15);
  229.     AddStaticVehicleEx(477,-1567.9000200,2640.3999000,55.7000000,290.0000000,-1,-1,15);
  230.  
  231. //---[Objects]---//
  232.  
  233.  
  234.  
  235. //---[Drift]---//
  236.  
  237.     AddStaticVehicleEx(411,-342.8999900,1515.5999800,75.2000000,0.0000000,-1,-1,15);
  238.     AddStaticVehicleEx(411,-339.7000100,1515.5000000,75.2000000,0.0000000,-1,-1,15);
  239.     AddStaticVehicleEx(560,-330.2000100,1515.3000500,75.2000000,0.0000000,-1,-1,15);
  240.     AddStaticVehicleEx(560,-333.2000100,1515.5000000,75.2000000,0.0000000,-1,-1,15);
  241.     AddStaticVehicleEx(411,-336.2999900,1514.8000500,75.2000000,0.0000000,-1,-1,15);
  242.     AddStaticVehicleEx(560,-327.3999900,1514.9000200,75.2000000,0.0000000,-1,-1,15);
  243.     AddStaticVehicleEx(562,-324.1000100,1515.4000200,75.1000000,0.0000000,-1,-1,15);
  244.     AddStaticVehicleEx(562,-321.1000100,1515.3000500,75.1000000,0.0000000,-1,-1,15);
  245.     AddStaticVehicleEx(562,-318.0000000,1514.9000200,75.1000000,0.0000000,-1,-1,15);
  246.     CreateObject(3749,-302.2999900,1510.0000000,80.2000000,0.0000000,0.0000000,0.0000000);
  247.     CreateObject(3516,-304.0000000,1511.6999500,77.6000000,0.0000000,0.0000000,192.0000000);
  248.  
  249. //---[Parkour]---//
  250.  
  251.     CreateObject(972,1531.47973600,-1359.22656300,328.45034800,0.00000000,0.00000000,0.00000000);
  252.     CreateObject(972,1550.99121100,-1359.23681600,328.45581100,0.00000000,0.00000000,0.00000000);
  253.     CreateObject(972,1542.70861800,-1365.28625500,328.15380900,0.00000000,0.00000000,-89.38141604);
  254.     CreateObject(974,1551.05700700,-1345.10205100,331.23623700,0.00000000,0.00000000,0.00000000);
  255.     CreateObject(974,1538.19177200,-1345.07312000,331.24121100,0.00000000,0.00000000,0.00000000);
  256.     CreateObject(978,1544.50683600,-1337.02807600,329.04757700,94.53809349,0.00000000,-88.52197935);
  257.     CreateObject(978,1544.70898400,-1345.88708500,327.34652700,-245.79883682,256.97151382,14.61042378);
  258.     CreateObject(978,1544.23742700,-1324.61401400,329.04776000,94.53809349,0.00000000,-88.52197935);
  259.     CreateObject(974,1544.29467800,-1316.17517100,328.01788300,91.95972612,0.00000000,0.00000000);
  260.     CreateObject(974,1544.08886700,-1307.95434600,326.07467700,91.95972612,0.00000000,0.00000000);
  261.     CreateObject(974,1544.86120600,-1299.68432600,328.92422500,91.95972612,0.00000000,0.00000000);
  262.     CreateObject(974,1553.25988800,-1299.90087900,330.80770900,91.95972612,0.00000000,0.00000000);
  263.     CreateObject(974,1560.94299300,-1300.69543500,328.54486100,91.95972612,0.00000000,0.00000000);
  264.     CreateObject(974,1564.03942900,-1299.92248500,331.32266200,183.91950953,0.00000000,-89.38141604);
  265.     CreateObject(974,1561.32983400,-1292.13647500,326.95224000,91.95972612,0.00000000,0.00000000);
  266.     CreateObject(974,1562.18335000,-1287.30468800,324.15411400,91.95972612,0.00000000,0.00000000);
  267.     CreateObject(3258,1559.69677700,-1287.83447300,322.73663300,118.60232089,0.00000000,-88.52197935);
  268.     CreateObject(3257,1555.85412600,-1255.20996100,276.35571300,0.00000000,0.00000000,0.00000000);
  269.     CreateObject(3287,1565.30419900,-1254.09912100,288.89392100,0.00000000,0.00000000,0.00000000);
  270.     CreateObject(3287,1571.85827600,-1254.17468300,288.93530300,0.00000000,0.00000000,0.00000000);
  271.     CreateObject(3502,1537.46252400,-1282.56335400,314.28128100,0.00000000,0.00000000,0.00000000);
  272.     CreateObject(3502,1538.06433100,-1274.25805700,313.83450300,-6.01605685,0.00000000,-7.73493023);
  273.     CreateObject(3502,1539.64648400,-1267.35376000,312.58728000,-12.03211370,0.00000000,-16.32929716);
  274.     CreateObject(3502,1541.58178700,-1256.78161600,307.05413800,-85.08423258,0.00000000,-16.32929716);
  275.     CreateObject(974,1541.15478500,-1254.38464400,311.65838600,91.95972612,0.00000000,0.00000000);
  276.     CreateObject(974,1541.23645000,-1262.01538100,310.14981100,91.95972612,0.00000000,0.00000000);
  277.     CreateObject(974,1546.33313000,-1258.03479000,310.41314700,91.95972612,0.00000000,0.00000000);
  278.     CreateObject(974,1536.39111300,-1257.45532200,310.30587800,91.95972612,0.00000000,11.17267701);
  279.     CreateObject(974,1540.46557600,-1255.21789600,298.40844700,91.95972612,0.00000000,3.43774677);
  280.     CreateObject(974,1544.44763200,-1255.29968300,298.42996200,91.95972612,0.00000000,-4.29718346);
  281.     CreateObject(3257,1585.73034700,-1253.02539100,272.12976100,0.00000000,0.00000000,-88.52197935);
  282.     CreateObject(3257,1585.98681600,-1261.29406700,272.13314800,0.00000000,0.00000000,-268.14419083);
  283.     CreateObject(3631,1594.14160200,-1257.08642600,286.86883500,0.00000000,0.00000000,1.71887339);
  284.     CreateObject(3631,1604.56164600,-1256.77233900,286.85174600,0.00000000,0.00000000,1.71887339);
  285.     CreateObject(3631,1615.55175800,-1256.58337400,286.85958900,0.00000000,0.00000000,1.71887339);
  286.     CreateObject(3636,1633.98425300,-1255.84838900,276.36599700,82.50592250,0.00000000,-1.71887339);
  287.     CreateObject(3636,1650.99963400,-1256.63537600,274.60452300,82.50592250,0.00000000,-1.71887339);
  288.     CreateObject(3636,1666.38598600,-1255.20495600,272.61486800,82.50592250,0.00000000,17.18873385);
  289.     CreateObject(3636,1681.09021000,-1248.78125000,273.70929000,82.50592250,0.00000000,27.50197417);
  290.     CreateObject(3636,1694.77307100,-1239.38745100,274.84780900,82.50592250,0.00000000,39.53408786);
  291.     CreateObject(6867,1714.95483400,-1178.67041000,297.15399200,0.00000000,0.00000000,-51.56620156);
  292.     CreateObject(974,1706.98413100,-1211.47265600,277.03076200,90.24085273,0.00000000,-49.84732818);
  293.     CreateObject(974,1701.03759800,-1204.87646500,276.81738300,90.24085273,0.00000000,-49.84732818);
  294.     CreateObject(974,1693.76635700,-1197.61450200,276.82901000,90.24085273,0.00000000,-49.84732818);
  295.     CreateObject(974,1702.92028800,-1178.17627000,279.18060300,90.24085273,0.00000000,-49.84732818);
  296.     CreateObject(974,1697.31506300,-1182.87817400,279.61947600,90.24085273,0.00000000,-49.84732818);
  297.     CreateObject(974,1690.98498500,-1185.70861800,280.65783700,90.24085273,0.00000000,-49.84732818);
  298.     CreateObject(974,1707.23571800,-1118.80554200,273.88061500,90.24085273,0.00000000,-49.84732818);
  299.     CreateObject(974,1711.80139200,-1115.36169400,276.67355300,90.24085273,0.00000000,-49.84732818);
  300.     CreateObject(974,1716.70105000,-1121.03784200,278.09811400,90.24085273,0.00000000,-49.84732818);
  301.     CreateObject(974,1722.69030800,-1124.65515100,279.08462500,90.24085273,0.00000000,-49.84732818);
  302.     CreateObject(974,1727.63134800,-1129.97741700,280.64492800,90.24085273,0.00000000,-49.84732818);
  303.     CreateObject(974,1732.61572300,-1125.55322300,282.77932700,90.24085273,0.00000000,-49.84732818);
  304.     CreateObject(974,1740.99438500,-1120.95617700,280.22213700,90.24085273,0.00000000,-49.84732818);
  305.     CreateObject(974,1744.08374000,-1121.66052200,281.85693400,183.06007284,0.00000000,39.53408786);
  306.     CreateObject(974,1779.22509800,-1161.04113800,280.83062700,268.14419083,0.00000000,39.53408786);
  307.     CreateObject(3330,1804.41137700,-1187.47509800,270.03402700,-31.79915763,0.00000000,37.81521448);
  308.     CreateObject(3330,1820.63317900,-1210.19104000,233.51001000,-55.00394833,0.00000000,37.81521448);
  309.     CreateObject(3411,1879.03271500,-1241.67932100,183.44625900,0.00000000,0.00000000,-53.28501765);
  310.     CreateObject(4550,1957.40417500,-1183.40344200,126.30550400,124.61832044,0.00000000,126.33730842);
  311.  
  312. //---[Biz 1 - Config]---//
  313.  
  314.     CreatePickup(1239, 1,-1519.2203,2609.5698,55.8359, 0);
  315.     Create3DTextLabel("Biz", COLOR_GREENYELLOW, -1519.1837,2609.2742,56.3359, 20, 0);
  316.     return 1;
  317. }
  318.  
  319. //---[Server Configs #2]---//
  320.  
  321. public OnGameModeExit()
  322. {
  323.     TextDrawHideForAll(Textdraw1);
  324.     TextDrawDestroy(Textdraw1);
  325.     return 1;
  326. }
  327.  
  328. public OnPlayerRequestClass(playerid, classid)
  329. {
  330.     SetPlayerPos(playerid, 2004.7404,1913.8379,40.3516);
  331.     SetPlayerFacingAngle(playerid,264.7556);
  332.     SetPlayerTime(playerid, 0,0);
  333.     InterpolateCameraPos(playerid,2013.6698,1913.9120,35.0304,2013.6698,1913.9120,35.0304+100,10000);
  334.     InterpolateCameraLookAt(playerid,2004.7404,1913.8379,40.3516,2004.7404,1913.8379,40.3516+50,10000);
  335.     return 1;
  336. }
  337.  
  338. //---[Server Opening]---//
  339.  
  340. public OnPlayerConnect(playerid)
  341. {
  342.     if(fexist(UserPath(playerid)))
  343.     {
  344.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  345.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  346.     }
  347.     else
  348.     {
  349.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  350.     }
  351.  
  352.     new string[78], pnome[MAX_PLAYER_NAME];
  353.     GetPlayerName(playerid, pnome, sizeof(pnome));
  354.     format(string, sizeof(string), "{1E90FF}%s {006400}(ID:%d) {B22222}Connected to Call of Duty 2.", pnome, playerid);
  355.     SendClientMessageToAll(-1, string);
  356.     TextDrawShowForPlayer(playerid, Textdraw1);
  357.     PlayAudioStreamForPlayer(playerid, "http://rapha3l.comyr.com/eldm/songs/intro.mp3");
  358.     return 1;
  359. }
  360.  
  361.  
  362. //---[Spawn]---//
  363.  
  364. public OnPlayerSpawn(playerid)
  365. {
  366.     GivePlayerMoney(playerid,5000);
  367.     GivePlayerWeapon(playerid,4,1);
  368.     GivePlayerWeapon(playerid,31,9999);
  369.     GivePlayerWeapon(playerid,1,0);
  370.     new Random = random(sizeof(RandomSpawns));
  371.     SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  372.     SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  373.     StopAudioStreamForPlayer(playerid);
  374.     return 1;
  375. }
  376.  
  377. //---[Leaving Server]---//
  378.  
  379. public OnPlayerDisconnect(playerid, reason)
  380. {
  381.     new INI:File = INI_Open(UserPath(playerid));
  382.     INI_SetTag(File,"data");
  383.     INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  384.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  385.     INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  386.     INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  387.     INI_Close(File);
  388.  
  389.     new
  390.         string[64],
  391.         playername[MAX_PLAYER_NAME];
  392.     GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
  393.     switch(reason)
  394.     {
  395.         case 0: format(string,sizeof string,"{1E90FF}%s {006400}(ID:%d) {B22222}left the battlefield. {006400}(Timed out)",playername);
  396.         case 1: format(string,sizeof string,"{1E90FF}%s {006400}(ID:%d) {B22222}left the battlefield. {006400}(Leaving)",playername);
  397.         case 2: format(string,sizeof string,"{1E90FF}%s {006400}(ID:%d) {B22222}left the battlefield. {006400}(Kicked/Banned)",playername);
  398.     }
  399.     return 1;
  400. }
  401.  
  402. //---[Commands]---//
  403.  
  404. //---[Kill]---//
  405.  
  406. CMD:kill(playerid)
  407. {
  408.     SetPlayerHealth(playerid,0.0);
  409.     new str[78], pnome[MAX_PLAYER_NAME];
  410.     GetPlayerName(playerid, pnome, sizeof(pnome));
  411.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}has been killed. {FFA54F}/kill.", pnome, playerid);
  412.     SendClientMessageToAll(-1, str);
  413.     return 1;
  414. }
  415.  
  416. //---[Run Weapons Arena]---//
  417.  
  418. CMD:runw(playerid)
  419. {
  420.     SetPlayerPos(playerid, 1373.8341, 2196.1016, 14.2495);
  421.     ResetPlayerWeapons(playerid);
  422.     GivePlayerWeapon(playerid,4,1);
  423.     GivePlayerWeapon(playerid,24,9999);
  424.     GivePlayerWeapon(playerid,26,9999);
  425.     GivePlayerWeapon(playerid,28,9999);
  426.     SetPlayerHealth(playerid, 100);
  427.     SetPlayerArmour(playerid, 100);
  428.     new str[78], pnome[MAX_PLAYER_NAME];
  429.     GetPlayerName(playerid, pnome, sizeof(pnome));
  430.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}Teleported to the Arena.", pnome, playerid);
  431.     SendClientMessageToAll(-1, str);
  432.     return 1;
  433. }
  434.  
  435. //---[Drift]---//
  436.  
  437. CMD:drift(playerid)
  438. {
  439.     SetPlayerPos(playerid, -303.8535,1532.6465,75.3594);
  440.     ResetPlayerWeapons(playerid);
  441.     new str[78], pnome[MAX_PLAYER_NAME];
  442.     GetPlayerName(playerid, pnome, sizeof(pnome));
  443.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}Teleported to the Drift Zone.", pnome, playerid);
  444.     SendClientMessageToAll(-1, str);
  445.     return 1;
  446. }
  447.  
  448. //---[Parkour]---//
  449.  
  450. CMD:parkour(playerid)
  451. {
  452.     SetPlayerPos(playerid,1544.9849,-1353.7681,329.4735);
  453.     new name[128];
  454.     new string[256];
  455.     GetPlayerName(playerid,name,128);
  456.     format(string, sizeof(string), "{1E90FF}%s {006400}(ID:%d) {B22222}Teleported to the Parkour Zone.",name);
  457.     SendClientMessageToAll(0x99FFFFAA, string);
  458.     SetPlayerInterior(playerid, 0);
  459.     PlayerPlaySound(playerid, 1054, 0.0, 0.0, 0.0);
  460.     return 1;
  461. }
  462.  
  463. //---[Biz Commands]---//
  464.  
  465. CMD:enter(playerid)
  466. {
  467.     if(IsPlayerInRangeOfPoint(playerid,5.0,-1519.2583,2608.9690,55.8359))
  468.     {
  469.     SetPlayerPos(playerid, 1118.8878,-10.2737,1002.0859);
  470.     SetPlayerInterior(playerid, 12);
  471.     }
  472.     return 1;
  473. }
  474.  
  475. CMD:exit(playerid)
  476. {
  477.     if(IsPlayerInRangeOfPoint(playerid,5.0,1118.8878,-10.2737,1002.0859))
  478.     {
  479.     SetPlayerPos(playerid, -1519.2583,2608.9690,55.8359);
  480.     SetPlayerInterior(playerid, 0);
  481.     }
  482.     return 1;
  483. }
  484.  
  485. CMD:heal(playerid)
  486. {
  487.     if(IsPlayerInRangeOfPoint(playerid,5.0,1118.8878,-10.2737,1002.0859))
  488.     {
  489.     SetPlayerHealth(playerid, 100);
  490.     SetPlayerArmour(playerid, 100);
  491.     new str[78], pnome[MAX_PLAYER_NAME];
  492.     GetPlayerName(playerid, pnome, sizeof(pnome));
  493.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}Bought a medical kit!", pnome, playerid);
  494.     SendClientMessageToAll(-1, str);
  495.     }
  496.     return 1;
  497. }
  498.  
  499. CMD:nadepack(playerid)
  500. {
  501.     if(IsPlayerInRangeOfPoint(playerid,5.0,1118.8878,-10.2737,1002.0859))
  502.     {
  503.     GivePlayerWeapon(playerid,16,10);
  504.     new str[78], pnome[MAX_PLAYER_NAME];
  505.     GetPlayerName(playerid, pnome, sizeof(pnome));
  506.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}Bought a frag package!", pnome, playerid);
  507.     SendClientMessageToAll(-1, str);
  508.     }
  509.     return 1;
  510. }
  511.  
  512. CMD:pack2(playerid)
  513. {
  514.     if(IsPlayerInRangeOfPoint(playerid,5.0,1118.8878,-10.2737,1002.0859))
  515.     {
  516.     ResetPlayerWeapons(playerid);
  517.     GivePlayerWeapon(playerid,8,1);
  518.     GivePlayerWeapon(playerid,23,9999);
  519.     GivePlayerWeapon(playerid,27,9999);
  520.     GivePlayerWeapon(playerid,33,9999);
  521.     GivePlayerWeapon(playerid,29,9999);
  522.     new str[78], pnome[MAX_PLAYER_NAME];
  523.     GetPlayerName(playerid, pnome, sizeof(pnome));
  524.     format(str, sizeof(str), "{1E90FF}%s {006400}(ID:%d) {B22222}Bought Weapons Package 2!", pnome, playerid);
  525.     SendClientMessageToAll(-1, str);
  526.     }
  527.     return 1;
  528. }
  529.  
  530. //---[Death's]---//
  531.  
  532. public OnPlayerDeath(playerid, killerid, reason)
  533. {
  534.     PlayerInfo[killerid][pKills]++;
  535.     PlayerInfo[playerid][pDeaths]++;
  536.  
  537.     SendDeathMessage(killerid, playerid, reason);
  538.     return 1;
  539. }
  540.  
  541. //---[Login & Register System OnDialogResponse]---//
  542. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  543. {
  544.     switch( dialogid )
  545.     {
  546.         case DIALOG_REGISTER:
  547.         {
  548.             if (!response) return Kick(playerid);
  549.             if(response)
  550.             {
  551.                 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");
  552.                 new INI:File = INI_Open(UserPath(playerid));
  553.                 INI_SetTag(File,"data");
  554.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  555.                 INI_WriteInt(File,"Cash",0);
  556.                 INI_WriteInt(File,"Admin",0);
  557.                 INI_WriteInt(File,"Kills",0);
  558.                 INI_WriteInt(File,"Deaths",0);
  559.                 INI_Close(File);
  560.  
  561.                 SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  562.                 SpawnPlayer(playerid);
  563.                 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","");
  564.             }
  565.         }
  566.  
  567.         case DIALOG_LOGIN:
  568.         {
  569.             if ( !response ) return Kick ( playerid );
  570.             if( response )
  571.             {
  572.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  573.                 {
  574.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  575.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  576.                     ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
  577.                 }
  578.                 else
  579.                 {
  580.                     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");
  581.                 }
  582.                 return 1;
  583.             }
  584.         }
  585.     }
  586.     return 1;
  587. }
Advertisement
Add Comment
Please, Sign In to add comment