Advertisement
Guest User

Untitled

a guest
Feb 19th, 2014
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.74 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <mSelection>
  5. #include <gvc>
  6. #include <streamer>
  7. #undef MAX_PLAYERS
  8. #define MAX_PLAYERS 20 // Or however many slots you have
  9. #define COLOR_GREEN 0x00FF00FF
  10. #define COLOR_RED 0xFF0000FF
  11. #define COLOR_BLUE 0x0000FFFF
  12. #define COLOR_GREY 0xAFAFAFFF
  13. #define COLOR_YELLOW 0xFFFF00FF
  14. #define COLOR_WHITE 0xFFFFFFFF
  15. #define COLOR_PINK 0xFF00FF00
  16. #define COLOR_CYAN 0x00FFFFFF
  17. #define COLOR_ORANGE 0xFF4000FF
  18. #define COLOR_LIGHTBLUE 0x00BFFFFF
  19. new Float:SavedPos[MAX_PLAYERS][3];
  20. new DB:Database,Query[2048],DBResult:Result,Logged[MAX_PLAYERS],SpawnedCar[MAX_PLAYERS],TPTog[MAX_PLAYERS],DMZone[MAX_PLAYERS];
  21. new skins[300] = {
  22. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
  23. 50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,
  24. 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
  25. 132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,
  26. 167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,
  27. 202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
  28. 237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,
  29. 272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299
  30. };
  31. main()
  32. {
  33. print("\n----------------------------------");
  34. print(" Minigame server - By bensmart469");
  35. print("----------------------------------\n");
  36. }
  37. native WP_Hash(buffer[], len, const str[]);
  38. enum pInfo
  39. {
  40. pAdmin,
  41. pKills,
  42. pDeaths,
  43. pMinutes,
  44. pHours,
  45. pVIP,
  46. pVIPTime,
  47. }
  48. new PlayerInfo[MAX_PLAYERS][pInfo];
  49. new Float:randomspawns[][4] =
  50. {
  51. {1434.4896,-2424.4221,13.5547,220.5894},
  52. {1518.6227,1320.3308,10.8732,72.4413},
  53. {2024.0563,1006.8042,10.8203,257.7321},
  54. {-1542.5762,-437.4560,6.0000,132.2378},
  55. {1545.1637,-1675.7916,13.5598,94.7245},
  56. {-2312.1846,-1682.1093,482.1143,6.7922},
  57. {321.1904,-1777.8771,4.8003,183.5680}
  58.  
  59. };
  60. new Float:SMGDMSpawns[][3] = {
  61. {294.0006,177.0260,1007.1719},
  62. {244.7981,187.7100,1008.1719},
  63. {231.9077,145.6122,1003.0234},
  64. {232.0247,161.2848,1003.0234},
  65. {192.4685,158.6347,1003.0234},
  66. {194.9091,178.9510,1003.0234}
  67. };
  68. new Float:SniperDMSpawns[][3] = {
  69. {104.9001,1898.8314,33.8984},
  70. {132.3662,1901.5944,22.7743},
  71. {196.3512,1838.0540,23.2422},
  72. {231.3594,1934.1415,33.8984},
  73. {265.8186,1893.2842,33.8984}
  74. };
  75. new Float:DeagleDMSpawns[][3] = {
  76. {359.4152,207.9029,1008.3828},
  77. {379.9109,163.7939,1014.1875},
  78. {382.0209,172.9366,1008.3828},
  79. {371.8708,187.3543,1008.3893}
  80. };
  81. new Float:RPGDMSpawns[][3] = {
  82. {2620.8188,2758.1904,23.8222},
  83. {2639.8809,2818.2432,38.3222},
  84. {2699.0530,2803.6919,45.8672},
  85. {2652.6750,2662.5278,37.7122}
  86. };
  87. new Seconds[MAX_PLAYERS];
  88. public OnGameModeInit()
  89. {
  90. CreateDynamicObject(18765, 244.04, 2012.04, 1016.56, 0.00, 0.00, 0.00);
  91. CreateDynamicObject(18765, 256.98, 2012.53, 1018.06, 0.00, 0.00, 0.00);
  92. CreateDynamicObject(18765, 269.48, 2012.53, 1018.06, 0.00, 0.00, 0.00);
  93. CreateDynamicObject(18764, 280.38, 2012.52, 1015.06, 0.00, 0.00, 0.00);
  94. CreateDynamicObject(3279, 296.12, 1976.59, 1017.54, 0.00, 0.00, 90.00);
  95. CreateDynamicObject(18783, 303.00, 2009.90, 1013.54, 0.00, 0.00, 0.00);
  96. CreateDynamicObject(18783, 303.00, 1983.90, 1015.54, 0.00, 0.00, 0.00);
  97. CreateDynamicObject(3279, 293.12, 1976.59, 1033.54, 0.00, 0.00, 90.00);
  98. CreateDynamicObject(18808, 294.50, 1945.62, 1051.70, 0.00, 90.00, 90.00);
  99. CreateDynamicObject(18819, 294.50, 1897.12, 1051.70, 90.00, 0.00, 0.00);
  100. CreateDynamicObject(18815, 327.74, 1894.68, 1017.99, 0.00, 0.00, 0.00);
  101. CreateDynamicObject(18815, 292.18, 1858.14, 1017.99, 0.00, 0.00, 0.00);
  102. CreateDynamicObject(18808, 247.86, 1897.08, 1051.70, 0.00, 90.00, 0.00);
  103. CreateDynamicObject(18825, 212.33, 1881.13, 1051.69, 90.00, 0.00, 0.00);
  104. CreateDynamicObject(18825, 232.91, 1849.35, 1051.69, 90.00, 180.00, 0.00);
  105. CreateDynamicObject(18789, 204.47, 1834.73, 1055.57, 0.00, 30.00, 0.00);
  106. CreateDynamicObject(11495, 127.38, 1835.83, 1091.76, 0.00, 0.00, 90.00);
  107. CreateDynamicObject(11495, 117.28, 1825.52, 1091.76, 0.00, 0.00, 180.00);
  108. CreateDynamicObject(969, 112.63, 1824.43, 1090.95, 0.00, 0.00, 0.00);
  109. CreateDynamicObject(2932, 117.24, 1809.15, 1091.96, 0.00, 0.00, 0.00);
  110. CreateDynamicObject(2932, 117.24, 1799.65, 1093.46, 0.00, 0.00, 0.00);
  111. CreateDynamicObject(2932, 117.24, 1790.15, 1094.96, 0.00, 0.00, 0.00);
  112. CreateDynamicObject(3639, 119.76, 1778.39, 1093.41, 0.00, 0.00, 0.00);
  113. CreateDynamicObject(3639, 123.98, 1764.44, 1095.41, 0.00, 0.00, 0.00);
  114. CreateDynamicObject(3639, 123.98, 1746.94, 1088.41, 0.00, 0.00, 0.00);
  115. CreateDynamicObject(18770, 136.66, 1746.25, 991.06, 0.00, 0.00, 0.00);
  116. CreateDynamicObject(18770, 142.29, 1746.12, 991.06, 0.00, 0.00, 0.00);
  117. CreateDynamicObject(18770, 143.08, 1741.72, 991.06, 0.00, 0.00, 0.00);
  118. CreateDynamicObject(18770, 147.19, 1741.17, 991.06, 0.00, 0.00, 0.00);
  119. CreateDynamicObject(19128, 152.42, 1740.93, 1089.59, 0.00, 0.00, 0.00);
  120. CreateDynamicObject(19128, 157.62, 1740.68, 1089.59, 0.00, 0.00, 0.00);
  121. CreateDynamicObject(19128, 159.93, 1735.01, 1089.59, 0.00, 0.00, 0.00);
  122. CreateDynamicObject(19128, 160.02, 1728.60, 1089.59, 0.00, 0.00, 0.00);
  123. CreateDynamicObject(19128, 160.09, 1722.54, 1089.59, 0.00, 0.00, 0.00);
  124. CreateDynamicObject(19128, 159.83, 1716.60, 1089.59, 0.00, 0.00, 0.00);
  125. CreateDynamicObject(19128, 159.40, 1710.27, 1089.59, 0.00, 0.00, 0.00);
  126. CreateDynamicObject(13666, 293.70, 2517.93, 20.36, 0.00, 0.00, 90.00);
  127. CreateDynamicObject(13666, 293.70, 2513.93, 20.36, 0.00, 0.00, 90.00);
  128. CreateDynamicObject(13666, 293.70, 2509.93, 20.36, 0.00, 0.00, 90.00);
  129. CreateDynamicObject(19005, 244.63, 2489.68, 18.49, 0.00, 0.00, 180.00);
  130. CreateDynamicObject(19005, 244.78, 2473.22, 31.49, 30.00, 0.00, 180.00);
  131. CreateDynamicObject(19005, 244.80, 2466.22, 49.49, 60.00, 0.00, 180.00);
  132. CreateDynamicObject(19005, 244.87, 2470.58, 75.49, 90.00, 0.00, 180.00);
  133. CreateDynamicObject(19001, 95.01, 2552.84, 25.53, 0.00, 0.00, 90.00);
  134. CreateDynamicObject(19005, 190.96, 2476.25, 18.49, 0.00, 0.00, 90.00);
  135. CreateDynamicObject(19005, 190.96, 2501.25, 18.49, 0.00, 0.00, 90.00);
  136. CreateDynamicObject(19005, 190.96, 2526.25, 18.49, 0.00, 0.00, 90.00);
  137. CreateDynamicObject(19002, 130.55, 2526.25, 25.17, 0.00, 0.00, 90.00);
  138. CreateDynamicObject(19002, 130.55, 2501.25, 25.17, 0.00, 0.00, 90.00);
  139. CreateDynamicObject(19002, 130.55, 2476.25, 25.17, 0.00, 0.00, 90.00);
  140. CreateDynamicObject(13592, 283.36, 2467.01, 25.36, 0.00, 0.00, 0.00);
  141. CreateDynamicObject(13592, 363.93, 2542.02, 25.36, 0.00, 0.00, 0.00);
  142. CreateDynamicObject(18844, -55.50, 2422.47, 70.34, 0.00, 0.00, 0.00);
  143. CreateDynamicObject(19005, -58.65, 2423.04, 15.49, 0.00, 0.00, -90.00);
  144. CreateDynamicObject(18780, 29.06, 2476.86, 26.60, 0.00, 0.00, 180.00);
  145. CreateDynamicObject(18780, 29.06, 2496.86, 26.60, 0.00, 0.00, 180.00);
  146. CreateDynamicObject(18780, 29.06, 2516.86, 26.60, 0.00, 0.00, 180.00);
  147. CreateDynamicObject(18780, -11.56, 2516.75, 90.10, 0.00, -60.00, 180.00);
  148. CreateDynamicObject(18780, -11.56, 2476.75, 90.10, 0.00, -60.00, 180.00);
  149. CreateDynamicObject(18780, -11.56, 2496.72, 90.10, 0.00, -60.00, 180.00);
  150. CreateDynamicObject(18786, 349.88, 2518.48, 15.57, 0.00, 0.00, 0.00);
  151. CreateDynamicObject(18786, 316.40, 2518.48, 15.57, 0.00, 0.00, 180.00);
  152. CreateDynamicObject(18779, 192.16, 2544.58, 25.21, 0.00, 0.00, 0.00);
  153. CreateDynamicObject(18779, 175.74, 2544.56, 57.21, 0.00, 60.00, 0.00);
  154. CreateDynamicObject(12956, -68.33, 2505.46, 18.91, 0.00, 0.00, 0.00);
  155. CreateDynamicObject(18859, -77.41, 2561.10, 26.42, 0.00, 0.00, 0.00);
  156. CreateDynamicObject(18789, 437.11, 2498.42, 51.86, 0.00, -30.00, 0.00);
  157. CreateDynamicObject(18789, 507.08, 2498.42, 92.36, 0.00, -30.00, 0.00);
  158. CreateDynamicObject(8040, 611.66, 2496.19, 130.94, 0.00, 0.00, 180.00);
  159. CreateDynamicObject(18825, 27.96, 2542.24, 34.25, 0.00, 0.00, 0.00);
  160. CreateDynamicObject(18825, 46.96, 2542.24, 65.75, 0.00, 0.00, 180.00);
  161. CreateDynamicObject(18852, -13.33, 2542.21, 81.69, 0.00, 90.00, 0.00);
  162. CreateDynamicObject(18852, -112.52, 2542.04, 81.69, 0.00, 90.00, 0.00);
  163. CreateDynamicObject(18825, -172.71, 2542.14, 97.55, 0.00, 0.00, 0.00);
  164. CreateDynamicObject(18825, -152.71, 2542.14, 129.05, 0.00, 0.00, 180.00);
  165. CreateDynamicObject(18852, -213.33, 2542.19, 145.19, 0.00, 90.00, 0.00);
  166. CreateDynamicObject(18815, -268.67, 2546.22, 93.72, 0.00, 0.00, 0.00);
  167. CreateVehicle(562, -314.6121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  168. CreateVehicle(562, -317.6121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  169. CreateVehicle(562, -321.1121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  170. CreateVehicle(562, -324.1121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  171. CreateVehicle(562, -327.1121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  172. CreateVehicle(562, -330.1121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  173. CreateVehicle(560, -333.0926, 1514.7998, 75.0316, 0.0000, random(255), random(255), 100);
  174. CreateVehicle(560, -336.1121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  175. CreateVehicle(560, -339.6316, 1514.8086, 75.0316, 0.0000, random(255), random(255), 100);
  176. CreateVehicle(560, -342.6121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  177. CreateVehicle(560, -345.6121, 1514.8042, 75.0316, 0.0000, random(255), random(255), 100);
  178. CreateVehicle(541, -2351.8259, -1618.8267, 483.3235, -100.0000, random(255), random(255), 100);
  179. CreateVehicle(541, -2352.0720, -1621.9017, 483.3235, -100.0000, random(255), random(255), 100);
  180. CreateVehicle(541, -2352.5640, -1624.7307, 483.3235, -100.0000, random(255), random(255), 100);
  181. CreateVehicle(541, -2353.0559, -1627.5597, 483.3235, -100.0000, random(255), random(255), 100);
  182. SetTimer("Clock",1000,1);
  183. Database = db_open("db.db");
  184. db_query(Database,"CREATE TABLE IF NOT EXISTS `serveruserfiles` (`NAME`,`PASSWORD`,`IP`,`SCORE`,`MONEY`,`ADMIN`,`KILLS`,`DEATHS`,`MINUTES`,`HOURS`,`VIP`,`VIPTIME`)");
  185. SetGameModeText("Stunt/Freeroam/Minimode");
  186. for(new i=0; i<300; i++)
  187. {
  188.  
  189. AddPlayerClass(i, 1759.3490,-1895.4958,13.5610,268.6081, 0, 0, 0, 0, 0, 0);
  190. }
  191. return 1;
  192. }
  193.  
  194. public OnGameModeExit()
  195. {
  196. for(new i=0; i<MAX_PLAYERS; i++)
  197. {
  198. if(IsPlayerConnected(i))
  199. {
  200. if(Logged[i]) OnPlayerDisconnect(i,1);
  201. }
  202. }
  203.  
  204. db_close(Database);
  205. return 1;
  206. }
  207.  
  208. public OnPlayerRequestClass(playerid, classid)
  209. {
  210. SetPlayerInterior(playerid,14);
  211. SetPlayerFacingAngle(playerid, 270.0);
  212. SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  213. SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  214. SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  215. return 1;
  216. }
  217.  
  218. public OnPlayerConnect(playerid)
  219. {
  220. new string[128];
  221. format(string,sizeof(string),"> %s has joined the server",PlayerName(playerid));
  222. SendClientMessageToAll(COLOR_GREY,string);
  223. SetPlayerTime(playerid,12,0);
  224. SetPlayerWeather(playerid,0);
  225. if(SpawnedCar[playerid] != -1) DestroyVehicle(SpawnedCar[playerid]);
  226. new rand = random(9);
  227. switch(rand)
  228. {
  229. case 0: SetPlayerColor(playerid,COLOR_RED);
  230. case 1: SetPlayerColor(playerid,COLOR_BLUE);
  231. case 2: SetPlayerColor(playerid,COLOR_GREEN);
  232. case 3: SetPlayerColor(playerid,COLOR_YELLOW);
  233. case 4: SetPlayerColor(playerid,COLOR_PINK);
  234. case 5: SetPlayerColor(playerid,COLOR_WHITE);
  235. case 6: SetPlayerColor(playerid,COLOR_CYAN);
  236. case 7: SetPlayerColor(playerid,COLOR_ORANGE);
  237. case 8: SetPlayerColor(playerid,COLOR_LIGHTBLUE);
  238. }
  239. ClearAcc(playerid);
  240. Logged[playerid] = 0;
  241. format(Query,sizeof(Query),"SELECT `NAME` FROM `serveruserfiles` WHERE `NAME` = '%s'",DB_Escape(PlayerName(playerid)));
  242. Result = db_query(Database,Query);
  243. if(db_num_rows(Result))
  244. {
  245. ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","{00FFFF}Your account is registered, please enter the password for your account below","Login","Cancel");
  246. }
  247. else
  248. {
  249. ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","{00FFFF}Your account is not registered, please enter your desired password below.","Register","Cancel");
  250. }
  251. db_free_result(Result);
  252. format(Query,sizeof(Query),"");
  253. return 1;
  254. }
  255. public OnPlayerCommandReceived(playerid, cmdtext[])
  256. {
  257. if(DMZone[playerid])
  258. {
  259. if(strcmp(cmdtext,"/leavedm",true))
  260. {
  261. SendClientMessage(playerid,COLOR_GREY,"You are in a DM Area! (/leavedm)");
  262. return 0;
  263. }
  264. }
  265. return 1;
  266. }
  267. public OnPlayerDisconnect(playerid, reason)
  268. {
  269. if(SpawnedCar[playerid] != -1) DestroyVehicle(SpawnedCar[playerid]);
  270. if(Logged[playerid] != 0)
  271. {
  272. format(Query,sizeof(Query),"UPDATE `serveruserfiles` SET SCORE = '%d', MONEY = '%d', ADMIN = '%d', KILLS = '%d', DEATHS = '%d', MINUTES = '%d', HOURS = '%d', VIP = '%d', VIPTIME = '%d' WHERE `NAME` = '%s'",GetPlayerScore(playerid),GetPlayerMoney(playerid),PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pMinutes],PlayerInfo[playerid][pHours],PlayerInfo[playerid][pVIP],PlayerInfo[playerid][pVIPTime],DB_Escape(PlayerName(playerid)));
  273. db_query(Database,Query);
  274. }
  275. Logged[playerid] = 0;
  276. ClearAcc(playerid);
  277. format(Query,sizeof(Query),"");
  278. return 1;
  279. }
  280.  
  281. public OnPlayerSpawn(playerid)
  282. {
  283. if(DMZone[playerid] == 1)
  284. {
  285. new randex = random(sizeof(SMGDMSpawns));
  286. SetPlayerInterior(playerid,3);
  287. SetPlayerVirtualWorld(playerid,1);
  288. SetPlayerPos(playerid,SMGDMSpawns[randex][0],SMGDMSpawns[randex][1],SMGDMSpawns[randex][2]);
  289. GivePlayerWeapon(playerid,29,3500);
  290. return 1;
  291. }
  292. if(DMZone[playerid] == 2)
  293. {
  294. new randex = random(sizeof(DeagleDMSpawns));
  295. SetPlayerInterior(playerid,3);
  296. SetPlayerVirtualWorld(playerid,2);
  297. SetPlayerPos(playerid,DeagleDMSpawns[randex][0],DeagleDMSpawns[randex][1],DeagleDMSpawns[randex][2]);
  298. GivePlayerWeapon(playerid,24,3500);
  299. return 1;
  300. }
  301. if(DMZone[playerid] == 3)
  302. {
  303. new randex = random(sizeof(SniperDMSpawns));
  304. SetPlayerInterior(playerid,0);
  305. SetPlayerVirtualWorld(playerid,3);
  306. SetPlayerPos(playerid,SniperDMSpawns[randex][0],SniperDMSpawns[randex][1],SniperDMSpawns[randex][2]);
  307. GivePlayerWeapon(playerid,34,3500);
  308. return 1;
  309. }
  310. if(DMZone[playerid] == 4)
  311. {
  312. new randex = random(sizeof(RPGDMSpawns));
  313. SetPlayerInterior(playerid,0);
  314. SetPlayerVirtualWorld(playerid,4);
  315. SetPlayerPos(playerid,RPGDMSpawns[randex][0],RPGDMSpawns[randex][1],RPGDMSpawns[randex][2]);
  316. GivePlayerWeapon(playerid,35,3500);
  317. return 1;
  318. }
  319. new rand = random(9);
  320. switch(rand)
  321. {
  322. case 0: SetPlayerColor(playerid,COLOR_RED);
  323. case 1: SetPlayerColor(playerid,COLOR_BLUE);
  324. case 2: SetPlayerColor(playerid,COLOR_GREEN);
  325. case 3: SetPlayerColor(playerid,COLOR_YELLOW);
  326. case 4: SetPlayerColor(playerid,COLOR_PINK);
  327. case 5: SetPlayerColor(playerid,COLOR_WHITE);
  328. case 6: SetPlayerColor(playerid,COLOR_CYAN);
  329. case 7: SetPlayerColor(playerid,COLOR_ORANGE);
  330. case 8: SetPlayerColor(playerid,COLOR_LIGHTBLUE);
  331. }
  332. new randex = random(sizeof(randomspawns));
  333. SetPlayerPos(playerid,randomspawns[randex][0],randomspawns[randex][1],randomspawns[randex][2]);
  334. SetPlayerInterior(playerid,0);
  335. SetPlayerVirtualWorld(playerid,0);
  336. return 1;
  337. }
  338.  
  339. public OnPlayerDeath(playerid, killerid, reason)
  340. {
  341. if(killerid != INVALID_PLAYER_ID)
  342. {
  343. if(DMZone[killerid])
  344. {
  345. SetPlayerScore(killerid,GetPlayerScore(killerid) + 2);
  346. GivePlayerMoney(killerid,1000);
  347. GivePlayerMoney(playerid,-100);
  348. }
  349. SendDeathMessage(killerid, playerid, reason);
  350. PlayerInfo[killerid][pKills] ++;
  351. }
  352. else
  353. {
  354. SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
  355. }
  356. PlayerInfo[playerid][pDeaths] ++;
  357. return 1;
  358. }
  359.  
  360. public OnVehicleSpawn(vehicleid)
  361. {
  362. return 1;
  363. }
  364.  
  365. public OnVehicleDeath(vehicleid, killerid)
  366. {
  367. return 1;
  368. }
  369.  
  370. public OnPlayerText(playerid, text[])
  371. {
  372. return 1;
  373. }
  374.  
  375. // Commands
  376. CMD:night(playerid,params[])
  377. {
  378. SendClientMessage(playerid,COLOR_GREEN,"Time changed to night!");
  379. SetPlayerTime(playerid,0,0);
  380. return 1;
  381. }
  382. CMD:commands(playerid,params[])
  383. {
  384. return 1;
  385. }
  386. CMD:day(playerid,params[])
  387. {
  388. SendClientMessage(playerid,COLOR_GREEN,"Time changed to day!");
  389. SetPlayerTime(playerid,12,0);
  390. return 1;
  391. }
  392. CMD:color(playerid,params[])
  393. {
  394. ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"Name Colors","Red\nBlue\nGreen\nYellow\nPink\nWhite\nCyan\nOrange\nLight Blue","Choose","Cancel");
  395. return 1;
  396. }
  397. CMD:tptog(playerid,params[])
  398. {
  399. if(TPTog[playerid])
  400. {
  401. TPTog[playerid] = 0;
  402. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Teleports enabled.");
  403. }
  404. else
  405. {
  406. TPTog[playerid] = 1;
  407. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Teleports disabled.");
  408. }
  409. return 1;
  410. }
  411. CMD:carcolor(playerid,params[])
  412. {
  413. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"You are not in a vehicle!");
  414. new color1,color2;
  415. if(sscanf(params,"ii",color1,color2)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /carcolor [color 1] [color 2]");
  416. if(color1 < 0 || color1 > 255) return SendClientMessage(playerid,COLOR_GREY,"Invalid color 1 (0-255)");
  417. if(color2 < 0 || color2 > 255) return SendClientMessage(playerid,COLOR_GREY,"Invalid color 2 (0-255)");
  418. ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
  419. SendClientMessage(playerid,COLOR_GREEN,"Car color changed successfully!");
  420. return 1;
  421. }
  422. CMD:savepos(playerid,params[])
  423. {
  424. if(IsPlayerInAnyVehicle(playerid))
  425. {
  426. GetVehiclePos(GetPlayerVehicleID(playerid),SavedPos[playerid][0],SavedPos[playerid][1],SavedPos[playerid][2]);
  427. }
  428. else
  429. {
  430. GetPlayerPos(playerid,SavedPos[playerid][0],SavedPos[playerid][1],SavedPos[playerid][2]);
  431. }
  432. SendClientMessage(playerid,COLOR_WHITE,"Position saved, use /gotopos to teleport back to it");
  433. return 1;
  434. }
  435. CMD:makeadmin(playerid,params[])
  436. {
  437. new string[128],playerb,level;
  438. if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][pAdmin] < 6) return 0;
  439. if(sscanf(params,"ui",playerb,level)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /makeadmin [playerid] [level]");
  440. if(level < 1 || level > 6) return SendClientMessage(playerid,COLOR_GREY,"Levels are between 1 and 6");
  441. if(!Logged[playerb]) return SendClientMessage(playerid,COLOR_GREY,"Invalid player ID");
  442. if(level == PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid,COLOR_GREY,"Player already has this admin level");
  443. if(PlayerInfo[playerb][pAdmin] > level) format(string,sizeof(string),"> [ADMIN] %s has promoted %s to a level %d admin",PlayerName(playerid),PlayerName(playerb),level);
  444. else format(string,sizeof(string),"> [ADMIN] %s has demoted %s to a level %d admin",PlayerName(playerid),PlayerName(playerb),level);
  445. SendAdminMessage(COLOR_ORANGE,1,string);
  446. PlayerInfo[playerb][pAdmin] = level;
  447. return 1;
  448. }
  449.  
  450. CMD:gotopos(playerid,params[])
  451. {
  452. if(!SavedPos[playerid][0]) return SendClientMessage(playerid,COLOR_GREY,"You did not save a position (/savepos)");
  453. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  454. {
  455. SetVehiclePos(GetPlayerVehicleID(playerid), SavedPos[playerid][0], SavedPos[playerid][1], SavedPos[playerid][2]);
  456. }
  457. else
  458. {
  459. SetPlayerPos(playerid, SavedPos[playerid][0], SavedPos[playerid][1], SavedPos[playerid][2]);
  460. }
  461. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have teleported to your saved position");
  462. return 1;
  463. }
  464. CMD:flip(playerid,params[])
  465. {
  466. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"You are not in a vehicle!");
  467. new Float:angle;
  468. GetVehicleZAngle(GetPlayerVehicleID(playerid),angle);
  469. SetVehicleZAngle(GetPlayerVehicleID(playerid),angle);
  470. SendClientMessage(playerid,COLOR_YELLOW,"Car flipped!");
  471. return 1;
  472. }
  473. CMD:dance(playerid,params[])
  474. {
  475. new id;
  476. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You are in a vehicle");
  477. if(sscanf(params,"i",id)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /dance [1-4]");
  478. if(id < 1 || id > 4) return SendClientMessage(playerid,COLOR_GREY,"Dance IDs are between 1-4");
  479. switch(id)
  480. {
  481. case 1: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
  482. case 2: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
  483. case 3: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
  484. case 4: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
  485. }
  486. return 1;
  487. }
  488. CMD:skin(playerid,params[])
  489. {
  490. ShowModelSelectionMenuEx(playerid, skins, sizeof(skins), "Skins", 1234, 0.0,0.0,45.0);
  491. return 1;
  492. }
  493. CMD:smgdm(playerid,params[])
  494. {
  495. new string[128];
  496. new rand = random(sizeof(SMGDMSpawns));
  497. SetPlayerInterior(playerid,3);
  498. SetPlayerVirtualWorld(playerid,1);
  499. SetPlayerPos(playerid,SMGDMSpawns[rand][0],SMGDMSpawns[rand][1],SMGDMSpawns[rand][2]);
  500. format(string,sizeof(string),"%s has joined the SMG Deathmatch (/smgdm)",PlayerName(playerid));
  501. SendClientMessageToAll(COLOR_GREEN,string);
  502. GivePlayerWeapon(playerid,29,3500);
  503. DMZone[playerid] = 1;
  504. return 1;
  505. }
  506. CMD:sniperdm(playerid,params[])
  507. {
  508. new string[128];
  509. new rand = random(sizeof(SniperDMSpawns));
  510. SetPlayerInterior(playerid,0);
  511. SetPlayerVirtualWorld(playerid,3);
  512. SetPlayerPos(playerid,SniperDMSpawns[rand][0],SniperDMSpawns[rand][1],SniperDMSpawns[rand][2]);
  513. format(string,sizeof(string),"%s has joined the Sniper Deathmatch (/sniperdm)",PlayerName(playerid));
  514. SendClientMessageToAll(COLOR_CYAN,string);
  515. GivePlayerWeapon(playerid,34,3500);
  516. DMZone[playerid] = 3;
  517. return 1;
  518. }
  519. CMD:rpgdm(playerid,params[])
  520. {
  521. new string[128];
  522. new rand = random(sizeof(RPGDMSpawns));
  523. SetPlayerInterior(playerid,0);
  524. SetPlayerVirtualWorld(playerid,4);
  525. SetPlayerPos(playerid,RPGDMSpawns[rand][0],RPGDMSpawns[rand][1],RPGDMSpawns[rand][2]);
  526. format(string,sizeof(string),"%s has joined the RPG Deathmatch (/rpgdm)",PlayerName(playerid));
  527. SendClientMessageToAll(COLOR_PINK,string);
  528. GivePlayerWeapon(playerid,35,3500);
  529. DMZone[playerid] = 4;
  530. return 1;
  531. }
  532. CMD:deagledm(playerid,params[])
  533. {
  534. new string[128];
  535. new rand = random(sizeof(DeagleDMSpawns));
  536. SetPlayerInterior(playerid,3);
  537. SetPlayerVirtualWorld(playerid,2);
  538. SetPlayerPos(playerid,DeagleDMSpawns[rand][0],DeagleDMSpawns[rand][1],DeagleDMSpawns[rand][2]);
  539. format(string,sizeof(string),"%s has joined the Desert Eagle Deathmatch (/dealgedm)",PlayerName(playerid));
  540. SendClientMessageToAll(COLOR_GREEN,string);
  541. GivePlayerWeapon(playerid,24,1000);
  542. DMZone[playerid] = 2;
  543. return 1;
  544. }
  545. CMD:kill(playerid,params[])
  546. {
  547. SetPlayerHealth(playerid,0);
  548. return 1;
  549. }
  550. CMD:leavedm(playerid,params[])
  551. {
  552. if(!DMZone[playerid]) return SendClientMessage(playerid,COLOR_GREY,"You are in not in a DM Zone");
  553. new randex = random(sizeof(randomspawns));
  554. SetPlayerPos(playerid,randomspawns[randex][0],randomspawns[randex][1],randomspawns[randex][2]);
  555. SetPlayerInterior(playerid,0);
  556. SetPlayerVirtualWorld(playerid,0);
  557. SendClientMessage(playerid,COLOR_YELLOW,"You have left the DM Arena");
  558. ResetPlayerWeapons(playerid);
  559. DMZone[playerid] = 0;
  560. return 1;
  561. }
  562. CMD:para(playerid,params[])
  563. {
  564. GivePlayerWeapon(playerid,46,1);
  565. return 1;
  566. }
  567. CMD:goto(playerid,params[])
  568. {
  569. new Float:Pos[3],playerb,string[128];
  570. if(sscanf(params,"u",playerb)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /goto [playerid]");
  571. if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,COLOR_GREY,"Invalid player ID");
  572. if(playerid == playerb) return SendClientMessage(playerid,COLOR_GREY,"Invalid player ID");
  573. if(TPTog[playerb]) return SendClientMessage(playerid,COLOR_GREY,"This player has disabled their teleports.");
  574. GetPlayerPos(playerb,Pos[0],Pos[1],Pos[2]);
  575. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  576. {
  577. SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0]+2, Pos[1]+2, Pos[2]);
  578. }
  579. else
  580. {
  581. SetPlayerPos(playerid, Pos[0]+1, Pos[1], Pos[2]);
  582. }
  583. SetPlayerInterior(playerid, GetPlayerInterior(playerb));
  584. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerb));
  585. format(string,sizeof(string),"%s has teleported to your position",PlayerName(playerid));
  586. SendClientMessage(playerid,COLOR_WHITE,string);
  587. format(string,sizeof(string),"You have teleported to %s",PlayerName(playerb));
  588. SendClientMessage(playerid,COLOR_WHITE,string);
  589. return 1;
  590. }
  591. CMD:weather(playerid,params[])
  592. {
  593. new weather;
  594. if(sscanf(params,"i",weather)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /weather [1-60]");
  595. if(weather < 1 || weather > 60) return SendClientMessage(playerid,COLOR_GREY,"Invalid weather ID");
  596. SetPlayerWeather(playerid,weather);
  597. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Weather changed!");
  598. return 1;
  599. }
  600. CMD:lsa(playerid,params[])
  601. {
  602. return SendTele(playerid,"/lsa","Los Santos Airport",1441.6735,-2462.9543,13.5547,0,0,COLOR_PINK);
  603. }
  604. CMD:sfa(playerid,params[])
  605. {
  606. return SendTele(playerid,"/sfa","San Fierro Airport",-1519.8230,-201.0023,14.1484,0,0,COLOR_CYAN);
  607. }
  608. CMD:lva(playerid,params[])
  609. {
  610. return SendTele(playerid,"/lva","Las Venturas Airport",1325.4777,1286.1709,10.8203,0,0,COLOR_GREEN);
  611. }
  612. CMD:chiliad(playerid,params[])
  613. {
  614. return SendTele(playerid,"/chiliad","Mount Chiliad",-2346.8025,-1650.8058,483.7031,0,0,COLOR_YELLOW);
  615. }
  616. CMD:lspd(playerid,params[])
  617. {
  618. return SendTele(playerid,"/lspd","LSPD",1543.3571,-1675.9515,13.5563,0,0,COLOR_ORANGE);
  619. }
  620. CMD:startower(playerid,params[])
  621. {
  622. return SendTele(playerid,"/startower","Star Tower",1543.8573,-1353.3009,329.4743,0,0,COLOR_CYAN);
  623. }
  624. CMD:drift1(playerid,params[])
  625. {
  626. return SendTele(playerid,"/drift1","Drift 1",-309.8038,1536.9785,75.5625,0,0,COLOR_PINK);
  627. }
  628. CMD:aa(playerid,params[])
  629. {
  630. return SendTele(playerid,"/aa","Abandoned Airport",410.6870,2532.9146,19.1484,0,0,COLOR_PINK);
  631. }
  632. CMD:car(playerid,params[])
  633. {
  634. ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Vehicles.","Cars [A-F]\nCars [G-R]\nCars [S-Z]","Choose","Cancel");
  635. return 1;
  636. }
  637. // End
  638. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  639. {
  640. return 1;
  641. }
  642.  
  643. public OnPlayerExitVehicle(playerid, vehicleid)
  644. {
  645. return 1;
  646. }
  647.  
  648. public OnPlayerStateChange(playerid, newstate, oldstate)
  649. {
  650. return 1;
  651. }
  652.  
  653. public OnPlayerEnterCheckpoint(playerid)
  654. {
  655. return 1;
  656. }
  657.  
  658. public OnPlayerLeaveCheckpoint(playerid)
  659. {
  660. return 1;
  661. }
  662.  
  663. public OnPlayerEnterRaceCheckpoint(playerid)
  664. {
  665. return 1;
  666. }
  667.  
  668. public OnPlayerLeaveRaceCheckpoint(playerid)
  669. {
  670. return 1;
  671. }
  672.  
  673. public OnRconCommand(cmd[])
  674. {
  675. return 1;
  676. }
  677.  
  678. public OnPlayerRequestSpawn(playerid)
  679. {
  680. if(!Logged[playerid])
  681. {
  682. SendClientMessage(playerid,COLOR_GREY,"You must login first!");
  683. return 0;
  684. }
  685. SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), randomspawns[random(sizeof(randomspawns))][0],randomspawns[random(sizeof(randomspawns))][1],randomspawns[random(sizeof(randomspawns))][2],randomspawns[random(sizeof(randomspawns))][3],0,0,0,0,0,0);
  686. return 1;
  687. }
  688.  
  689. public OnObjectMoved(objectid)
  690. {
  691. return 1;
  692. }
  693.  
  694. public OnPlayerObjectMoved(playerid, objectid)
  695. {
  696. return 1;
  697. }
  698.  
  699. public OnPlayerPickUpPickup(playerid, pickupid)
  700. {
  701. return 1;
  702. }
  703. public OnVehicleDamageStatusUpdate(vehicleid,playerid)
  704. {
  705. RepairVehicle(vehicleid);
  706. return 1;
  707. }
  708.  
  709. public OnVehicleMod(playerid, vehicleid, componentid)
  710. {
  711. return 1;
  712. }
  713.  
  714. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  715. {
  716. return 1;
  717. }
  718.  
  719. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  720. {
  721. return 1;
  722. }
  723.  
  724. public OnPlayerSelectedMenuRow(playerid, row)
  725. {
  726. return 1;
  727. }
  728.  
  729. public OnPlayerExitedMenu(playerid)
  730. {
  731. return 1;
  732. }
  733.  
  734. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  735. {
  736. return 1;
  737. }
  738. public OnPlayerModelSelectionEx(playerid, response, extraid, modelid)
  739. {
  740. if(extraid == 1234)
  741. {
  742. if(response)
  743. {
  744. SendClientMessage(playerid,COLOR_YELLOW,"Skin changed!");
  745. SetPlayerSkin(playerid,modelid);
  746. }
  747. }
  748. return 1;
  749. }
  750. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  751. {
  752. if(newkeys & KEY_FIRE)
  753. {
  754. if(IsPlayerInAnyVehicle(playerid))
  755. {
  756. AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
  757. }
  758. }
  759. else
  760. {
  761. if(IsPlayerInAnyVehicle(playerid))
  762. {
  763. RemoveVehicleComponent(GetPlayerVehicleID(playerid),1010);
  764. }
  765. }
  766.  
  767. return 1;
  768. }
  769.  
  770. public OnRconLoginAttempt(ip[], password[], success)
  771. {
  772. return 1;
  773. }
  774.  
  775. public OnPlayerUpdate(playerid)
  776. {
  777. if(!DMZone[playerid])
  778. {
  779. if(GetPlayerWeapon(playerid) != 46)
  780. {
  781. if(GetPlayerWeapon(playerid) != 0) SetPlayerArmedWeapon(playerid,0);
  782. }
  783. }
  784. return 1;
  785. }
  786.  
  787. public OnPlayerStreamIn(playerid, forplayerid)
  788. {
  789. return 1;
  790. }
  791.  
  792. public OnPlayerStreamOut(playerid, forplayerid)
  793. {
  794. return 1;
  795. }
  796.  
  797. public OnVehicleStreamIn(vehicleid, forplayerid)
  798. {
  799. return 1;
  800. }
  801.  
  802. public OnVehicleStreamOut(vehicleid, forplayerid)
  803. {
  804. return 1;
  805. }
  806.  
  807. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  808. {
  809. new hash[129];
  810. switch(dialogid)
  811. {
  812. case 1:
  813. {
  814. if(!response) return Kick(playerid);
  815. if(strlen(inputtext) > 64 || strlen(inputtext) < 1)
  816. {
  817. ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Register","{00FFFF}Your account is not registered, please enter your desired password below.\n{FF0000}Your password must be between 1 and 64 characters!","Register","Cancel");
  818. return 1;
  819. }
  820. WP_Hash(hash,sizeof(hash),inputtext);
  821. format(Query,sizeof(Query),"INSERT INTO `serveruserfiles` (`NAME`,`PASSWORD`,`IP`,`SCORE`,`MONEY`,`ADMIN`,`KILLS`,`DEATHS`,`MINUTES`,`HOURS`,`VIP`,`VIPTIME`) VALUES('%s','%s','%s','0','0','0','0','0','0','0','0','0')",DB_Escape(PlayerName(playerid)),DB_Escape(hash),DB_Escape(PlayerIP(playerid)));
  822. db_query(Database,Query);
  823. ClearAcc(playerid);
  824. SendClientMessage(playerid,COLOR_GREEN,"You have successfully registered an account!");
  825. ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Rules","In order to play on our server, you must agree to the following rules:\n1. No deathmatch without being in the deathmatch areas\n2. No hacking\n3. No more than 1 account per person\n4. No insulting","Accept","Decline");
  826. format(Query,sizeof(Query),"");
  827. }
  828. case 2:
  829. {
  830. if(!response) return Kick(playerid);
  831.  
  832. WP_Hash(hash,sizeof(hash),inputtext);
  833. format(Query,sizeof(Query),"SELECT * FROM `serveruserfiles` WHERE `NAME` = '%s' AND `PASSWORD` = '%s'",DB_Escape(PlayerName(playerid)),DB_Escape(hash));
  834. Result = db_query(Database,Query);
  835. if(!db_num_rows(Result))
  836. {
  837. ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","{00FFFF}Your account is registered, please enter the password for your account below\n{FF0000}Invalid password!","Login","Cancel");
  838. }
  839. else
  840. {
  841. new field[20];
  842. db_get_field_assoc(Result,"SCORE",field,20);
  843. SetPlayerScore(playerid,strval(field));
  844. db_get_field_assoc(Result,"MONEY",field,20);
  845. GivePlayerMoney(playerid,strval(field));
  846. db_get_field_assoc(Result,"ADMIN",field,20);
  847. PlayerInfo[playerid][pAdmin] = strval(field);
  848. db_get_field_assoc(Result,"KILLS",field,20);
  849. PlayerInfo[playerid][pKills] = strval(field);
  850. db_get_field_assoc(Result,"DEATHS",field,20);
  851. PlayerInfo[playerid][pDeaths] = strval(field);
  852. db_get_field_assoc(Result,"MINUTES",field,20);
  853. PlayerInfo[playerid][pMinutes] = strval(field);
  854. db_get_field_assoc(Result,"HOURS",field,20);
  855. PlayerInfo[playerid][pHours] = strval(field);
  856. db_get_field_assoc(Result,"VIP",field,20);
  857. PlayerInfo[playerid][pVIP] = strval(field);
  858. db_get_field_assoc(Result,"VIPTIME",field,20);
  859. PlayerInfo[playerid][pVIPTime] = strval(field);
  860. Logged[playerid] = 1;
  861. SendClientMessage(playerid,COLOR_GREEN,"You have successfully logged in!");
  862.  
  863. }
  864. format(Query,sizeof(Query),"");
  865. db_free_result(Result);
  866. }
  867. case 3:
  868. {
  869. if(response)
  870. {
  871. switch(listitem)
  872. {
  873. case 0: SetPlayerColor(playerid,COLOR_RED);
  874. case 1: SetPlayerColor(playerid,COLOR_BLUE);
  875. case 2: SetPlayerColor(playerid,COLOR_GREEN);
  876. case 3: SetPlayerColor(playerid,COLOR_YELLOW);
  877. case 4: SetPlayerColor(playerid,COLOR_PINK);
  878. case 5: SetPlayerColor(playerid,COLOR_WHITE);
  879. case 6: SetPlayerColor(playerid,COLOR_CYAN);
  880. case 7: SetPlayerColor(playerid,COLOR_ORANGE);
  881. case 8: SetPlayerColor(playerid,COLOR_LIGHTBLUE);
  882. }
  883. }
  884. }
  885. case 4:
  886. {
  887. if(response)
  888. {
  889. switch(listitem)
  890. {
  891. case 0:
  892. {
  893. ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"Cars [A-F]",
  894. "Admiral\nAlpha\nAmbulance\nBaggage\nBandito\nBanshee\nBarracks\nBenson\nBF Injection\nBlade\nBlista Compact\nBloodring Banger\nBobcat\nBoxville\nBoxville (2)\nBravura\nBroadway\nBuccaneer\nBuffalo\nBullet\nBurrito\nBus\nCabbie\nCaddy\nCadrona\nCamper\nCement Truck\nCheetah\nClover\nClub\nCoash\nCombine Harvester\nComet\nDFT-30\nDozer\nDumper\nDune\nElegant\nElegy\nEmperor\nEnforcer\nEsperanto\nEuros\nFBI Rancher\nFBI Truck\nFeltzer\nFiretruck\nFiretruck LA\nFlash\nFlatbed\nForklift\nFortune",
  895. "Choose","Cancel");
  896. }
  897. case 1:
  898. {
  899. ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Cars [G-R]",
  900. "Glendale\nGlendale Shit\nGreenwood\nHermes\nHotdog Van\nHotknife\nHotring Racer\nHotring Racer 2\nHotring Racer 3\nHuntley\nHustler\nInfernus\nIntruder\nJester\nJourney\nKart\nLandstalker\nLinerunner\nLSPD Cruiser\nLVPD Cruiser\nMajestic\nManana\nMeric\nMesa\nMonster Truck\nMonster Truck A\nMonster Truck B\nMoonbeam\nMower\nMr Whoopee\nMule\nNebula\nNewsvan\nOceanic\nPacker\nPatriot\nPerenniel\nPony\nPermier\nPrevion\nPrimo\nQuad\nRancher\nRegina\nRemington\nRoadtrain\nRomero\nRumpo",
  901. "Choose","Cancel");
  902. }
  903. case 2:
  904. {
  905. ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Cars [S-Z]",
  906. "Sabre\nSadler\nSadler Shit\nSandking\nSavanna\nSecuricar\nSentinel\nSFPD Cruiser\nSlamvan\nSolair\nStafford\nStallion\nStratum\nStretch\nSunrise\nSuper GT\nSultan\nSweeper\nTahoma\nTampa\nTanker\nTaxi\nTopfun Van\nTornado\nTow Truck\nTractor\nTrashmaster\nTug\nTurismo\nUranus\nUtility Van\nVincent\nVirgo\nVoodoo\nVortex\nWalton\nWashington\nWillard\nWindsor\nYankee\nYosemite\nZR-350",
  907. "Choose","Cancel");
  908. }
  909. }
  910. }
  911. }
  912. case 5:
  913. {
  914. if(response)
  915. {
  916. new Array[52] =
  917. {445,602,416,485,568,429,433,499,424,536,496,504,422,498,609,401,575,518,402,541,482,431,438,457,526,483,524,415,542,589,437,532,480,578,486,406,573,507,562,585,427,419,587,490,528,533,407,544,565,455,530,526};
  918. if(SpawnedCar[playerid] != -1) DestroyVehicle(SpawnedCar[playerid]);
  919. new Float:Pos[4];
  920. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  921. GetPlayerFacingAngle(playerid,Pos[3]);
  922. SpawnedCar[playerid] = CreateVehicle(Array[listitem],Pos[0],Pos[1],Pos[2],Pos[3],random(255),random(255),25000);
  923. PutPlayerInVehicle(playerid,SpawnedCar[playerid],0);
  924. }
  925. }
  926. case 6:
  927. {
  928. if(response)
  929. {
  930. new Array[48] =
  931. {466,604,492,474,588,434,494,502,503,579,545,411,546,559,508,571,400,403,596,598,517,410,551,500,444,556,557,418,572,423,414,516,582,467,443,470,404,413,426,436,547,471,505,479,534,515,442,440};
  932. if(SpawnedCar[playerid] != -1) DestroyVehicle(SpawnedCar[playerid]);
  933. new Float:Pos[4];
  934. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  935. GetPlayerFacingAngle(playerid,Pos[3]);
  936. SpawnedCar[playerid] = CreateVehicle(Array[listitem],Pos[0],Pos[1],Pos[2],Pos[3],random(255),random(255),25000);
  937. PutPlayerInVehicle(playerid,SpawnedCar[playerid],0);
  938. }
  939. }
  940. case 7:
  941. {
  942. if(response)
  943. {
  944. new Array[42] =
  945. {475,543,605,495,567,428,405,597,535,458,580,439,561,409,550,506,560,574,566,549,514,420,459,576,525,531,408,583,451,558,552,540,491,412,539,478,421,529,555,456,554,477};
  946. if(SpawnedCar[playerid] != -1) DestroyVehicle(SpawnedCar[playerid]);
  947. new Float:Pos[4];
  948. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  949. GetPlayerFacingAngle(playerid,Pos[3]);
  950. SpawnedCar[playerid] = CreateVehicle(Array[listitem],Pos[0],Pos[1],Pos[2],Pos[3],random(255),random(255),25000);
  951. PutPlayerInVehicle(playerid,SpawnedCar[playerid],0);
  952. }
  953. }
  954. case 8:
  955. {
  956. if(!response)
  957. {
  958. ShowPlayerDialog(playerid,8,DIALOG_STYLE_MSGBOX,"Rules","In order to play on our server, you must agree to the following rules:\n1. No deathmatch without being in the deathmatch areas\n2. No hacking\n3. No more than 1 account per person\n4. No insulting","Accept","Decline");
  959. SendClientMessage(playerid,COLOR_RED,"You must agree to the rules if you want to play on this server!");
  960. return 1;
  961. }
  962. Logged[playerid] = 1;
  963. SendClientMessage(playerid,COLOR_YELLOW,"You have successfully agreed to our rules, and now you may play");
  964. }
  965.  
  966. }
  967. return 1;
  968. }
  969.  
  970. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  971. {
  972. return 1;
  973. }
  974. stock PlayerName(playerid)
  975. {
  976. new name[MAX_PLAYER_NAME];
  977. GetPlayerName(playerid,name,sizeof(name));
  978. return name;
  979. }
  980. stock PlayerIP(playerid)
  981. {
  982. new IP[16];
  983. GetPlayerIp(playerid,IP,sizeof(IP));
  984. return IP;
  985. }
  986. stock DB_Escape(text[])
  987. {
  988. new
  989. ret[80 * 2],
  990. ch,
  991. i,
  992. j;
  993. while ((ch = text[i++]) && j < sizeof (ret))
  994. {
  995. if (ch == '\'')
  996. {
  997. if (j < sizeof (ret) - 2)
  998. {
  999. ret[j++] = '\'';
  1000. ret[j++] = '\'';
  1001. }
  1002. }
  1003. else if (j < sizeof (ret))
  1004. {
  1005. ret[j++] = ch;
  1006. }
  1007. else
  1008. {
  1009. j++;
  1010. }
  1011. }
  1012. ret[sizeof (ret) - 1] = '\0';
  1013. return ret;
  1014. }
  1015. stock ClearAcc(playerid)
  1016. {
  1017. PlayerInfo[playerid][pAdmin] = 0;
  1018. PlayerInfo[playerid][pKills] = 0;
  1019. PlayerInfo[playerid][pDeaths] = 0;
  1020. PlayerInfo[playerid][pMinutes] = 0;
  1021. PlayerInfo[playerid][pVIP] = 0;
  1022. PlayerInfo[playerid][pVIPTime] = 0;
  1023. Seconds[playerid] = 0;
  1024. DMZone[playerid] = 0;
  1025. PlayerInfo[playerid][pHours] = 0;
  1026. SetPlayerScore(playerid,0);
  1027. TPTog[playerid] = 0;
  1028. ResetPlayerMoney(playerid);
  1029. SavedPos[playerid][0] = 0;
  1030. SavedPos[playerid][1] = 0;
  1031. SavedPos[playerid][2] = 0;
  1032. return 1;
  1033. }
  1034. stock SendTele(playerid,cmdname[],locname[],Float:X,Float:Y,Float:Z,int,vw,color)
  1035. {
  1036. new string[128];
  1037. format(string,sizeof(string),"%s has teleported to %s (%s)",PlayerName(playerid),locname,cmdname);
  1038. SendClientMessageToAll(color,string);
  1039. SetPlayerPos(playerid,X,Y,Z);
  1040. SetPlayerInterior(playerid,int);
  1041. SetPlayerVirtualWorld(playerid,vw);
  1042. return 1;
  1043. }
  1044. forward Clock();
  1045. public Clock()
  1046. {
  1047. for(new i=0; i<MAX_PLAYERS; i++)
  1048. {
  1049. if(IsPlayerConnected(i))
  1050. {
  1051. Seconds[i] ++;
  1052. if(Seconds[i] == 60)
  1053. {
  1054. PlayerInfo[i][pMinutes] ++;
  1055. Seconds[i] = 0;
  1056. if(PlayerInfo[i][pMinutes] == 60)
  1057. {
  1058. PlayerInfo[i][pHours] ++;
  1059. PlayerInfo[i][pMinutes] = 0;
  1060.  
  1061. }
  1062. }
  1063. }
  1064. }
  1065. return 1;
  1066. }
  1067.  
  1068. stock SetVehicleForwardVelocity(vehicleid, Float:Velocity, Float:Z) // I do not own this function.
  1069. {
  1070. new Float:Angle;
  1071. new Float:SpeedX, Float:SpeedY;
  1072. GetVehicleZAngle(vehicleid, Angle);
  1073. SpeedX = floatsin(-Angle, degrees);
  1074. SpeedY = floatcos(-Angle, degrees);
  1075. SetVehicleVelocity(vehicleid, floatmul(Velocity, SpeedX), floatmul(Velocity, SpeedY), Z);
  1076. return true;
  1077. }
  1078. stock SendAdminMessage(color, admlvl, string[])
  1079. {
  1080. for(new i=0; i<MAX_PLAYERS; i++)
  1081. {
  1082. if(IsPlayerConnected(i) )
  1083. {
  1084. if(PlayerInfo[i][pAdmin] >= admlvl)
  1085. {
  1086. SendClientMessage(i, color, string);
  1087. }
  1088. }
  1089. }
  1090. return 1;
  1091. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement