Guest User

helpme

a guest
Feb 16th, 2011
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.58 KB | None | 0 0
  1. //|~~~~~~~~|==========================================|~~~~~~~~|
  2. //|~~~~~~~~| |By [HiC]Thekiller & ~CueBall~| |~~~~~~~~|
  3. //|~~~~~~~~|==========================================|~~~~~~~~|
  4. //------ includes
  5.  
  6. #include <a_samp>
  7. #include <dutils>
  8. #include <DINI>
  9. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1//-------level!
  10. new LVL[MAX_PLAYERS];
  11. new Kills[MAX_PLAYERS];
  12. #define LVL_SAVE//If you want the players level to save when they disconnect! If not comment it!
  13. #define LVL_WEPONS //Comment if you do not want any of the weapon/armor/health things on spawn ("//")!
  14. #define LVL_MESSAGE_COLOR 0x00B8FF
  15. //-------Level defines!
  16. #define LVL_1 0 //The Ammount of kills which at a player levels!
  17. #define LVL_2 25 //The Ammount of kills which at a player levels!
  18. #define LVL_3 1200 //The Ammount of kills which at a player levels!
  19. #define LVL_4 20000 //The Ammount of kills which at a player levels!
  20. #define LVL_5 250000 //The Ammount of kills which at a player levels!
  21. #define LVL_6 1000000 //The Ammount of kills which at a player levels!
  22. #define LVL_7 10000000//The Ammount of kills which at a player levels!
  23. #define LVL_8 500000000 //The Ammount of kills which at a player levels!
  24. #define LVL_9 1000000000//The Ammount of kills which at a player levels!
  25. #define LVL_10 100000000000 //The Ammount of kills which at a player levels!
  26. //=====================================
  27. //Leave bellow the same if you don't want to use or change if you do :P ;)
  28. #define LVL_1_WEAPON1 23 // Weapon 1 weapon ID!
  29. #define LVL_1_WEAPON1_AMMO 500 //Weapon1 ammo!
  30. #define LVL_1_WEAPON2 17 //Weapon2 weapon ID!
  31. #define LVL_1_WEAPON2_AMMO 5 //Weapon2 ammo!
  32. #define LVL_1_WEAPON3 7 //Weapon3 weapon ID!
  33. #define LVL_1_WEAPON3_AMMO 1 //Weapon 3 ammo
  34. #define LVL_1_HEALTH 50 // Health of that level!
  35. #define LVL_1_ARMOR 0 // Armor for that level!
  36. //-
  37. #define LVL_2_WEAPON1 22
  38. #define LVL_2_WEAPON1_AMMO 900
  39. #define LVL_2_WEAPON2 4
  40. #define LVL_2_WEAPON2_AMMO 1
  41. #define LVL_2_WEAPON3 8
  42. #define LVL_2_WEAPON3_AMMO 1
  43. #define LVL_2_HEALTH 60
  44. #define LVL_2_ARMOR 0
  45. //-
  46. #define LVL_3_WEAPON1 25
  47. #define LVL_3_WEAPON1_AMMO 450
  48. #define LVL_3_WEAPON2 5
  49. #define LVL_3_WEAPON2_AMMO 1
  50. #define LVL_3_WEAPON3 0
  51. #define LVL_3_WEAPON3_AMMO 0
  52. #define LVL_3_HEALTH 75
  53. #define LVL_3_ARMOR 0
  54. //-
  55. #define LVL_4_WEAPON1 24
  56. #define LVL_4_WEAPON1_AMMO 500
  57. #define LVL_4_WEAPON2 8
  58. #define LVL_4_WEAPON2_AMMO 1
  59. #define LVL_4_WEAPON3 0
  60. #define LVL_4_WEAPON3_AMMO 1
  61. #define LVL_4_HEALTH 85
  62. #define LVL_4_ARMOR 0
  63. //-
  64. #define LVL_5_WEAPON1 26
  65. #define LVL_5_WEAPON1_AMMO 400
  66. #define LVL_5_WEAPON2 15
  67. #define LVL_5_WEAPON2_AMMO 1
  68. #define LVL_5_WEAPON3 0
  69. #define LVL_5_WEAPON3_AMMO 0
  70. #define LVL_5_HEALTH 100
  71. #define LVL_5_ARMOR 100
  72. //-
  73. #define LVL_6_WEAPON1 29
  74. #define LVL_6_WEAPON1_AMMO 1000
  75. #define LVL_6_WEAPON2 5
  76. #define LVL_6_WEAPON2_AMMO 1
  77. #define LVL_6_WEAPON3 0
  78. #define LVL_6_WEAPON3_AMMO 0
  79. #define LVL_6_HEALTH 100
  80. #define LVL_6_ARMOR 100
  81. //-
  82. #define LVL_7_WEAPON1 27
  83. #define LVL_7_WEAPON1_AMMO 1000
  84. #define LVL_7_WEAPON2 0
  85. #define LVL_7_WEAPON2_AMMO 1000
  86. #define LVL_7_WEAPON3 33
  87. #define LVL_7_WEAPON3_AMMO 100
  88. #define LVL_7_HEALTH 100
  89. #define LVL_7_ARMOR 100
  90. //-
  91. #define LVL_8_WEAPON1 0
  92. #define LVL_8_WEAPON1_AMMO 500
  93. #define LVL_8_WEAPON2 34
  94. #define LVL_8_WEAPON2_AMMO 500
  95. #define LVL_8_WEAPON3 0
  96. #define LVL_8_WEAPON3_AMMO 34
  97. #define LVL_8_HEALTH 100
  98. #define LVL_8_ARMOR 100
  99. //-
  100. #define LVL_9_WEAPON1 30
  101. #define LVL_9_WEAPON1_AMMO 1000
  102. #define LVL_9_WEAPON2 0
  103. #define LVL_9_WEAPON2_AMMO 500
  104. #define LVL_9_WEAPON3 16
  105. #define LVL_9_WEAPON3_AMMO 100
  106. #define LVL_9_HEALTH 100
  107. #define LVL_9_ARMOR 100
  108. //-
  109. #define LVL_10_WEAPON1 16
  110. #define LVL_10_WEAPON1_AMMO 10
  111. #define LVL_10_WEAPON2 9
  112. #define LVL_10_WEAPON2_AMMO 50
  113. #define LVL_10_WEAPON3 31
  114. #define LVL_10_WEAPON3_AMMO 50000
  115. #define LVL_10_HEALTH 100
  116. #define LVL_10_ARMOR 100
  117. new Text:Textdraw[MAX_PLAYERS];
  118. new Text:Textdraw2[MAX_PLAYERS];
  119. new Text3D:label[MAX_PLAYERS];
  120. new Text3D:label2[MAX_PLAYERS];
  121. new Text3D:label3[MAX_PLAYERS];
  122. new Text3D:label4[MAX_PLAYERS];
  123. new Text3D:label5[MAX_PLAYERS];
  124. new Text3D:label6[MAX_PLAYERS];
  125. new Text3D:label7[MAX_PLAYERS];
  126. new Text3D:label8[MAX_PLAYERS];
  127. new Text3D:label9[MAX_PLAYERS];
  128. new Text3D:label10[MAX_PLAYERS];
  129. //===============================================================================================
  130. public OnFilterScriptInit()
  131. {
  132. print("\n----------------------------------");
  133. print(" Bboy's Level script ");
  134. print("----------------------------------\n");
  135. SetTimer("level",500,true);//Change this if you want the level check to be longer or shorter!
  136. if(!dini_Exists("Levels.cfg"))
  137. {
  138. dini_Create("Levels.cfg");
  139. }
  140.  
  141. if(!dini_Exists("Kills.cfg"))
  142. {
  143. dini_Create("Kills.cfg");
  144. }
  145. return 1;
  146. }
  147.  
  148. public OnPlayerConnect(playerid)
  149. {
  150. #if defined LVL_SAVE
  151. new Pname[MAX_PLAYER_NAME];
  152. GetPlayerName(playerid, Pname, sizeof(Pname));
  153. LVL[playerid] = dini_Int("Levels.cfg", Pname);
  154. Kills[playerid] = dini_Int("Kills.cfg", Pname);
  155. #endif
  156. return 1;
  157. }
  158.  
  159.  
  160. public OnPlayerDisconnect(playerid)
  161. {
  162. #if defined LVL_SAVE
  163. new Pname[MAX_PLAYER_NAME];
  164. GetPlayerName(playerid, Pname, sizeof(Pname));
  165. dini_IntSet("Levels.cfg", Pname, LVL[playerid]);
  166. dini_IntSet("Kills.cfg", Pname, Kills[playerid]);
  167. #endif
  168. return 1;
  169. }
  170.  
  171. #if defined LVL_WEPONS
  172. public OnPlayerSpawn(playerid)
  173. {
  174. //-------Weapons, health and armour
  175. if (LVL[playerid]==1)
  176. {
  177. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  178. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  179. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  180. SetPlayerHealth(playerid,LVL_1_HEALTH);
  181. SetPlayerArmour(playerid,LVL_1_ARMOR);
  182. GivePlayerMoney(playerid,4);
  183. SetPlayerScore(playerid,1);
  184. TextDrawShowForPlayer(playerid, Textdraw[playerid]);
  185. }
  186. if (LVL[playerid]==2)
  187. {
  188. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  189. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  190. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  191. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  192. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  193. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  194. SetPlayerHealth(playerid,LVL_2_HEALTH);
  195. SetPlayerArmour(playerid,LVL_2_ARMOR);
  196. SetPlayerMoney(playerid,4);
  197. SetPlayerScore(playerid,2);
  198. TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
  199. }
  200. if (LVL[playerid]==3)
  201. {
  202. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  203. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  204. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  205. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  206. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  207. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  208. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  209. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  210. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  211. SetPlayerHealth(playerid,LVL_3_HEALTH);
  212. SetPlayerArmour(playerid,LVL_3_ARMOR);
  213. SetPlayerMoney(playerid,4);
  214. SetPlayerScore(playerid,3);
  215. }
  216.  
  217. if (LVL[playerid]==4)
  218. {
  219. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  220. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  221. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  222. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  223. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  224. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  225. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  226. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  227. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  228. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  229. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  230. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  231. SetPlayerHealth(playerid,LVL_4_HEALTH);
  232. SetPlayerArmour(playerid,LVL_4_ARMOR);
  233. SetPlayerMoney(playerid,4);
  234. SetPlayerScore(playerid,4);
  235. }
  236.  
  237. if (LVL[playerid]==5)
  238. {
  239. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  240. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  241. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  242. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  243. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  244. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  245. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  246. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  247. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  248. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  249. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  250. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  251. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  252. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  253. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  254. SetPlayerHealth(playerid,LVL_5_HEALTH);
  255. SetPlayerArmour(playerid,LVL_5_ARMOR);
  256. SetPlayerMoney(playerid,4);
  257. SetPlayerScore(playerid,5);
  258. }
  259.  
  260. if (LVL[playerid]==6)
  261. {
  262. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  263. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  264. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  265. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  266. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  267. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  268. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  269. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  270. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  271. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  272. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  273. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  274. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  275. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  276. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  277. GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
  278. GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
  279. GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
  280. SetPlayerHealth(playerid,LVL_6_HEALTH);
  281. SetPlayerArmour(playerid,LVL_6_ARMOR);
  282. SetPlayerMoney(playerid,4);
  283. SetPlayerScore(playerid,6);
  284. }
  285.  
  286. if (LVL[playerid]==7)
  287. {
  288. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  289. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  290. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  291. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  292. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  293. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  294. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  295. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  296. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  297. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  298. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  299. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  300. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  301. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  302. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  303. GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
  304. GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
  305. GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
  306. GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
  307. GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
  308. GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
  309. SetPlayerHealth(playerid,LVL_7_HEALTH);
  310. SetPlayerArmour(playerid,LVL_7_ARMOR);
  311. SetPlayerMoney(playerid,4);
  312. SetPlayerScore(playerid,7);
  313. }
  314.  
  315. if (LVL[playerid]==8)
  316. {
  317. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  318. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  319. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  320. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  321. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  322. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  323. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  324. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  325. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  326. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  327. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  328. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  329. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  330. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  331. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  332. GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
  333. GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
  334. GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
  335. GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
  336. GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
  337. GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
  338. GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
  339. GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
  340. GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
  341. SetPlayerHealth(playerid,LVL_8_HEALTH);
  342. SetPlayerArmour(playerid,LVL_8_ARMOR);
  343. GivePlayerMoney(playerid,4);
  344. SetPlayerScore(playerid,8);
  345. }
  346.  
  347. if (LVL[playerid]==9)
  348. {
  349. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  350. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  351. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  352. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  353. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  354. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  355. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  356. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  357. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  358. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  359. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  360. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  361. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  362. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  363. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  364. GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
  365. GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
  366. GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
  367. GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
  368. GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
  369. GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
  370. GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
  371. GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
  372. GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
  373. GivePlayerWeapon(playerid,LVL_9_WEAPON1,LVL_9_WEAPON1_AMMO);
  374. GivePlayerWeapon(playerid,LVL_9_WEAPON2,LVL_9_WEAPON2_AMMO);
  375. GivePlayerWeapon(playerid,LVL_9_WEAPON3,LVL_9_WEAPON3_AMMO);
  376. SetPlayerHealth(playerid,LVL_9_HEALTH);
  377. SetPlayerArmour(playerid,LVL_9_ARMOR);
  378. SetPlayerMoney(playerid,4);
  379. SetPlayerScore(playerid,9);
  380. }
  381.  
  382. if (LVL[playerid]==10)
  383. {
  384. GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
  385. GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
  386. GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
  387. GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
  388. GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
  389. GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
  390. GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
  391. GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
  392. GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
  393. GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
  394. GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
  395. GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
  396. GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
  397. GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
  398. GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
  399. GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
  400. GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
  401. GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
  402. GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
  403. GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
  404. GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
  405. GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
  406. GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
  407. GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
  408. GivePlayerWeapon(playerid,LVL_9_WEAPON1,LVL_9_WEAPON1_AMMO);
  409. GivePlayerWeapon(playerid,LVL_9_WEAPON2,LVL_9_WEAPON2_AMMO);
  410. GivePlayerWeapon(playerid,LVL_9_WEAPON3,LVL_9_WEAPON3_AMMO);
  411. GivePlayerWeapon(playerid,LVL_10_WEAPON1,LVL_10_WEAPON1_AMMO);
  412. GivePlayerWeapon(playerid,LVL_10_WEAPON2,LVL_10_WEAPON2_AMMO);
  413. GivePlayerWeapon(playerid,LVL_10_WEAPON3,LVL_10_WEAPON3_AMMO);
  414. SetPlayerHealth(playerid,LVL_10_HEALTH);
  415. SetPlayerArmour(playerid,LVL_10_ARMOR);
  416. SetPlayerMoney(playerid,2);
  417. SetPlayerScore(playerid,10);
  418. }
  419. return 1;
  420. }
  421. #endif
  422.  
  423.  
  424. forward level();
  425. public level()
  426. {
  427. for(new i=0; i < MAX_PLAYERS; i++)
  428. {
  429. if(GetPlayerKills(i) >= LVL_1 && LVL[i] == 0)
  430. {
  431. SendClientMessage(i,LVL_MESSAGE_COLOR,"type /level=see youre level type /levels for see the levels score");
  432. LVL[i] = 1;
  433. }
  434.  
  435. if(GetPlayerKills(i) >= LVL_2 && LVL[i] == 1)
  436. {
  437. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 2!");
  438. LVL[i] = 2;
  439. GameTextForPlayer(i,"~w~Level Up",5000,3);
  440. DeletePlayer3DTextLabel(i, label[i]);
  441. label2[i] = Create3DTextLabel("Level:2",0x38FF06FF,30.0,40.0,50.0,40.0,0);
  442. Attach3DTextLabelToPlayer(label2[i], i, 0.0, 0.0, 0.7);
  443. }
  444.  
  445. if(GetPlayerKills(i) >= LVL_3 && LVL[i] == 2)
  446. {
  447. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 3!");
  448. LVL[i] = 3;
  449. GameTextForPlayer(i,"~w~Level Up",5000,3);
  450. }
  451.  
  452. if(GetPlayerKills(i) >= LVL_4 && LVL[i] == 3)
  453. {
  454. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 4!");
  455. LVL[i] = 4;
  456. GameTextForPlayer(i,"~w~Level Up",5000,3);
  457. }
  458.  
  459. if(GetPlayerKills(i) >= LVL_5 && LVL[i] == 4)
  460. {
  461. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 5!");
  462. LVL[i] = 5;
  463. GameTextForPlayer(i,"~w~Level Up",5000,3);
  464. }
  465.  
  466. if(GetPlayerKills(i) >= LVL_6 && LVL[i] == 5)
  467. {
  468. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 6!");
  469. LVL[i] = 6;
  470. GameTextForPlayer(i,"~w~Level Up",5000,3);
  471. }
  472.  
  473. if(GetPlayerKills(i) >= LVL_7 && LVL[i] == 6)
  474. {
  475. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 7!");
  476. LVL[i] = 7;
  477. GameTextForPlayer(i,"~w~Level Up",5000,3);
  478. }
  479.  
  480. if(GetPlayerKills(i) >= LVL_8 && LVL[i] == 7)
  481. {
  482. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 8!");
  483. LVL[i] = 8;
  484. GameTextForPlayer(i,"~w~Level Up",5000,3);
  485. }
  486.  
  487. if(GetPlayerKills(i) >= LVL_9&& LVL[i] == 8)
  488. {
  489. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 9!");
  490. LVL[i] = 9;
  491. GameTextForPlayer(i,"~w~Level Up",5000,3);
  492. }
  493.  
  494. if(GetPlayerKills(i) >= LVL_10 && LVL[i] == 9)
  495. {
  496. SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 10!");
  497. LVL[i] = 10;
  498. GameTextForPlayer(i,"~w~Level Up",5000,3);
  499. }
  500. }
  501. return 1;
  502. }
  503.  
  504. public OnPlayerDeath(playerid,killerid,reason)
  505. {
  506. if(killerid != INVALID_PLAYER_ID)
  507. {
  508. Kills[killerid]++;
  509. Kills[killerid]++;
  510. }
  511. return 1;
  512. }
  513.  
  514.  
  515. public OnPlayerCommandText(playerid, cmdtext[])
  516. {
  517. if (strcmp("/Levels", cmdtext, true, 10) == 0)
  518. {
  519. new string1[512],string2[512];
  520. format(string1, sizeof (string1), "Level 2: %d \r\n Level 3: %d \r\n Level 4: %d \r\n Level 5: %d \r\n ",LVL_2,LVL_3,LVL_4,LVL_5);
  521. format(string2, sizeof (string2), "Level 6: %d \r\n Level 7: %d \r\n Level 8: %d \r\n Level 9: %d \r\n Level 10: %d \r\n",LVL_6,LVL_7,LVL_8,LVL_9,LVL_10);
  522. SendClientMessage(playerid,0xFF0000AA,"Levels:");
  523. SendClientMessage(playerid,0xF4FFFFFF,string1);
  524. SendClientMessage(playerid,0xF4FFFFFF,string2);
  525. SendClientMessage(playerid,0xF414FFFF,"Your level will be saved when you leave!");
  526. return 1;
  527. }
  528. //------DCMD Commands
  529. dcmd(level, 5, cmdtext);
  530. dcmd(Kills, 5, cmdtext);
  531. dcmd(LevelSet, 8, cmdtext);
  532. return 0;
  533. }
  534.  
  535. dcmd_level(playerid, params[])
  536. {
  537. new id, pname[24] ,string[256];
  538. if (sscanf(params, "d", id))
  539. return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Level <playerid>\"");
  540. else if (!IsPlayerConnected(id))
  541. return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
  542. else
  543. {
  544. GetPlayerName(id,pname,24);
  545. format(string, sizeof (string), "%s is level %d",pname,LVL[id]);
  546. SendClientMessage(playerid,0x0660FF,string);
  547. }
  548.  
  549. return 1;
  550. }
  551.  
  552. dcmd_Kills(playerid, params[])
  553. {
  554. new id, pname[24] ,string[256];
  555. if (sscanf(params, "d", id))
  556. return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Kills <playerid>\"");
  557. else if (!IsPlayerConnected(id))
  558. return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
  559. else
  560. {
  561. GetPlayerName(id,pname,MAX_PLAYER_NAME);
  562. format(string,sizeof(string),"%s has %d kills",pname,Kills[id]);
  563. SendClientMessage(playerid,0x0660FF,string);
  564. }
  565. return 1;
  566. }
  567.  
  568.  
  569. dcmd_LevelSet(playerid, params[])
  570. {
  571.  
  572. new id,LVL2 ,string[256],name[24];
  573. GetPlayerName(playerid,name,24);
  574. if (sscanf(params, "d,i", id,LVL2))
  575. return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/LevelSet <playerid> <level>\"");
  576. else if (!IsPlayerConnected(id))
  577. return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
  578. else if (!IsPlayerAdmin(playerid))
  579. return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
  580. else if (LVL2>10&&LVL2<0)
  581. return SendClientMessage(playerid, 0xFF0000AA, "Levels are between 0-10!");
  582. else if (LVL2==0)
  583. {
  584. LVL[id] =0;
  585. format(string, sizeof (string), "%s has set you to level 0",name);
  586. SetPlayerScore(id,0);
  587. SendClientMessage(id,0x0660FF,string);
  588. Kills[id]=0;
  589. }
  590. else if (LVL2==1)
  591. {
  592. LVL[id] =1;
  593. format(string, sizeof (string), "%s has set you to level 1",name);
  594. SendClientMessage(id,0x0660FF,string);
  595. Kills[id]=LVL_1;
  596. }
  597. else if (LVL2==2)
  598. {
  599. LVL[id] =2;
  600. format(string, sizeof (string), "%s has set you to level 2",name);
  601. SendClientMessage(id,0x0660FF,string);
  602. Kills[id]=LVL_2;
  603. TextDrawDestroy(Textdraw[playerid]);
  604. }
  605. else if (LVL2==3){
  606. LVL[id] =3;
  607. format(string, sizeof (string), "%s has set you to level 3",name);
  608. SendClientMessage(id,0x0660FF,string);
  609. Kills[id]=LVL_3;
  610. }
  611. else if (LVL2==4)
  612. {
  613. LVL[id] =4;
  614. format(string, sizeof (string), "%s has set you to level 4",name);
  615. SendClientMessage(id,0x0660FF,string);
  616. Kills[id]=LVL_4;
  617.  
  618. }
  619. else if (LVL2==5)
  620. {
  621. LVL[id] =5;
  622. format(string, sizeof (string), "%s has set you to level 5",name);
  623. SendClientMessage(id,0x0660FF,string);
  624. Kills[id]=LVL_5;
  625. }
  626. else if (LVL2==6)
  627. {
  628. LVL[id] =6;
  629. format(string, sizeof (string), "%s has set you to level 6",name);
  630. SendClientMessage(id,0x0660FF,string);
  631. Kills[id]=LVL_6;
  632. }
  633. else if (LVL2==7)
  634. {
  635. LVL[id] =7;
  636. format(string, sizeof (string), "%s has set you to level 7",name);
  637. SendClientMessage(id,0x0660FF,string);
  638. Kills[id]=LVL_7;
  639. }
  640. else if (LVL2==8)
  641. {
  642. LVL[id] =8;
  643. format(string, sizeof (string), "%s has set you to level 8",name);
  644. SendClientMessage(id,0x0660FF,string);
  645. Kills[id]=LVL_8;
  646. }
  647. else if (LVL2==9)
  648. {
  649. LVL[id] =9;
  650. format(string, sizeof (string), "%s has set you to level 9",name);
  651. SendClientMessage(id,0x0660FF,string);
  652. Kills[id]=LVL_9;
  653. }
  654. else if (LVL2==10){
  655. LVL[id] =10;
  656. format(string, sizeof (string), "%s has set you to level 10",name);
  657. SendClientMessage(id,0x0660FF,string);
  658. Kills[id]=LVL_10;
  659. }
  660.  
  661. return 1;
  662. }
  663.  
  664.  
  665. stock GetPlayerKills(playerid)
  666. {
  667. return Kills[playerid];
  668. }
  669. //----------------------------------------------Sccanaf---------------------------------------------------
  670. stock sscanf(string[], format[], {Float,_}:...)
  671. {
  672. new
  673. formatPos = 0,
  674. stringPos = 0,
  675. paramPos = 2,
  676. paramCount = numargs();
  677. while (paramPos < paramCount && string[stringPos])
  678. {
  679. switch (format[formatPos++])
  680. {
  681. case '\0':
  682. {
  683. return 0;
  684. }
  685. case 'i', 'd':
  686. {
  687. new
  688. neg = 1,
  689. num = 0,
  690. ch = string[stringPos];
  691. if (ch == '-')
  692. {
  693. neg = -1;
  694. ch = string[++stringPos];
  695. }
  696. do
  697. {
  698. stringPos++;
  699. if (ch >= '0' && ch <= '9')
  700. {
  701. num = (num * 10) + (ch - '0');
  702. }
  703. else
  704. {
  705. return 1;
  706. }
  707. }
  708. while ((ch = string[stringPos]) && ch != ' ');
  709. setarg(paramPos, 0, num * neg);
  710. }
  711. case 'h', 'x':
  712. {
  713. new
  714. ch,
  715. num = 0;
  716. while ((ch = string[stringPos++]))
  717. {
  718. switch (ch)
  719. {
  720. case 'x', 'X':
  721. {
  722. num = 0;
  723. continue;
  724. }
  725. case '0' .. '9':
  726. {
  727. num = (num << 4) | (ch - '0');
  728. }
  729. case 'a' .. 'f':
  730. {
  731. num = (num << 4) | (ch - ('a' - 10));
  732. }
  733. case 'A' .. 'F':
  734. {
  735. num = (num << 4) | (ch - ('A' - 10));
  736. }
  737. case ' ':
  738. {
  739. break;
  740. }
  741. default:
  742. {
  743. return 1;
  744. }
  745. }
  746. }
  747. setarg(paramPos, 0, num);
  748. }
  749. case 'c':
  750. {
  751. setarg(paramPos, 0, string[stringPos++]);
  752. }
  753. case 'f':
  754. {
  755. new tmp[25];
  756. strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
  757. setarg(paramPos, 0, _:floatstr(tmp));
  758. }
  759. case 's', 'z':
  760. {
  761. new
  762. i = 0,
  763. ch;
  764. if (format[formatPos])
  765. {
  766. while ((ch = string[stringPos++]) && ch != ' ')
  767. {
  768. setarg(paramPos, i++, ch);
  769. }
  770. if (!i) return 1;
  771. }
  772. else
  773. {
  774. while ((ch = string[stringPos++]))
  775. {
  776. setarg(paramPos, i++, ch);
  777. }
  778. }
  779. stringPos--;
  780. setarg(paramPos, i, '\0');
  781. }
  782. default:
  783. {
  784. continue;
  785. }
  786. }
  787. while (string[stringPos] && string[stringPos] != ' ')
  788. {
  789. stringPos++;
  790. }
  791. while (string[stringPos] == ' ')
  792. {
  793. stringPos++;
  794. }
  795. paramPos++;
  796. }
  797. while (format[formatPos] == 'z') formatPos++;
  798. return format[formatPos];
  799. }
  800. //-----------------------------END-------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment