Advertisement
Guest User

Untitled

a guest
May 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.75 KB | None | 0 0
  1. new g_iXP[33] // player's xp
  2. new g_iKit[33] // weapon kit for hunters
  3. new g_iDesiredKit[33] // weapon kit that the hunter has picked for the next round
  4. new g_iAlienLevel[33] // current level of the alien
  5.  
  6. enum _:EVENTS
  7. {
  8. EVENT_KILL_ALIEN,
  9. EVENT_ASSIST_ALIEN,
  10. EVENT_HS_ALIEN,
  11. EVENT_WIN_HUNTER,
  12.  
  13. EVENT_KILL_HUNTER,
  14. EVENT_ASSIST_HUNTER,
  15. EVENT_HS_HUNTER,
  16. EVENT_WIN_ALIEN,
  17.  
  18. EVENT_KILL_EGG,
  19. EVENT_ASSIST_EGG,
  20.  
  21. EVENT_SUICIDE,
  22.  
  23. EVENT_LATE_5,
  24. EVENT_LATE_10,
  25. EVENT_LATE_15
  26. }
  27.  
  28. new const XP[EVENTS] =
  29. {
  30. 5, // xp received for killing an alien
  31. 2, // xp received for assisting in the killing of an alien
  32. 10, // xp received for killing an alien by headshot
  33. 5, // xp received when hunters win the round
  34.  
  35. 5, // xp received for killing an hunter
  36. 2, // xp received for assisting in the killing of an hunter
  37. 10, // xp received for killing an hunter by headshot
  38. 5, // xp received when aliens win the round
  39.  
  40. 10, // xp received for destroying an egg
  41. 5, // xp received for assisting in the destruction of an egg
  42.  
  43. -25, // xp received for suiciding
  44.  
  45. 10, // xp for arriving late by 5 mins
  46. 20, // xp for arriving late by 5 mins
  47. 30 // xp for arriving late by 5 mins
  48. }
  49.  
  50. new const g_szXPMessage[EVENTS][] =
  51. {
  52. "+%i XP for killing an alien",
  53. "+%i XP for hurting an alien",
  54. "+%i XP for killing an alien by headshot",
  55. "+%i XP for winning the round",
  56.  
  57. "+%i XP for klling an hunter",
  58. "+%i XP for hurting an hunter",
  59. "+%i XP for killing an hunter by headshot",
  60. "+%i XP for winning the round",
  61.  
  62. "+%i XP for destroying an egg",
  63. "+%i XP for hurting an egg",
  64.  
  65. "%i XP for suicide",
  66.  
  67. "+%i XP for arriving 5 minutes late",
  68. "+%i XP for arriving 10 minutes late",
  69. "+%i XP for arriving 15 minutes late"
  70. }
  71.  
  72. /*
  73.  
  74. Hunter XP stuff
  75.  
  76. */
  77.  
  78. enum _:KITS
  79. {
  80. KIT_ASSAULT,
  81. KIT_SCOUT,
  82. KIT_MEDIC,
  83. KIT_ELITE,
  84. KIT_HEAVY,
  85. KIT_HUNTER,
  86. KIT_PREDATOR
  87. }
  88.  
  89. new const g_HunterAllowedWeapons[KITS] =
  90. {
  91. (1<<CSW_AUG)|(1<<CSW_M4A1)|(1<<CSW_XM1014)|(1<<CSW_G3SG1)|(1<<CSW_SG550)|(1<<CSW_USP)|(1<<CSW_DEAGLE)|(1<<CSW_ELITE)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE), // flares
  92. (1<<CSW_AUG)|(1<<CSW_XM1014)|(1<<CSW_G3SG1)|(1<<CSW_SG550)|(1<<CSW_USP)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE), // flares
  93. (1<<CSW_AUG)|(1<<CSW_AK47)|(1<<CSW_G3SG1)|(1<<CSW_XM1014)|(1<<CSW_SG550)|(1<<CSW_USP)|(1<<CSW_ELITE)|(1<<CSW_USP)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE), // medkits
  94. (1<<CSW_AUG)|(1<<CSW_XM1014)|(1<<CSW_G3SG1)|(1<<CSW_SG550)|(1<<CSW_USP)|(1<<CSW_P90)|(1<<CSW_ELITE)|(1<<CSW_MP5NAVY)|(1<<CSW_UMP45)|(1<<CSW_DEAGLE)|(1<<CSW_XM1014)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE), // grenade launchers
  95. (1<<CSW_AUG)|(1<<CSW_M249)|(1<<CSW_XM1014)|(1<<CSW_G3SG1)|(1<<CSW_SG550)|(1<<CSW_USP)|(1<<CSW_ELITE)|(1<<CSW_AK47)|(1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE), // proximity mines
  96. (1<<CSW_AUG)|(1<<CSW_G3SG1)|(1<<CSW_XM1014)|(1<<CSW_USP)|(1<<CSW_AWP)|(1<<CSW_SG550)|(1<<CSW_ELITE)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE) // shock grenades
  97. (1<<CSW_XM1014)|(1<<CSW_KNIFE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_HEGRENADE)|(1<<CSW_DEAGLE)|(1<<CSW_ELITE)|(1<<CSW_USP)
  98. }
  99.  
  100. new const g_iHunterXPRequired[KITS] =
  101. {
  102. 0,
  103. 25,
  104. 50,
  105. 75,
  106. 100,
  107. 200,
  108. 350
  109. }
  110.  
  111. new const g_iHunterHealth[KITS] =
  112. {
  113. 200,
  114. 250,
  115. 275,
  116. 285,
  117. 300,
  118. 350,
  119. 500
  120. }
  121.  
  122. new const g_iHunterArmor[KITS] =
  123. {
  124. 50,
  125. 50,
  126. 50,
  127. 50,
  128. 50,
  129. 50,
  130. 100,
  131. }
  132.  
  133. new const g_szKitNames[KITS][] =
  134. {
  135. "Rookie Hunter",
  136. "Medium Hunter",
  137. "Advanced Hunter",
  138. "Expert Hunter",
  139. "Insane Hunter",
  140. "Nightmare Hunter",
  141. "The Berseker Predator"
  142. }
  143.  
  144. new const g_szAbilityNames[KITS][] =
  145. {
  146. "Flares",
  147. "Flares",
  148. "MedKits",
  149. "Grenade Launcher",
  150. "Proximity Mines",
  151. "Shock Grenades",
  152. "Shock Grenades"
  153. }
  154.  
  155. new const g_szEnabledKitMenuOptions[KITS][] =
  156. {
  157. "M4A1, DEAGLE, All Pistols \y2 \wFlares",
  158. "AUG, DEAGLE, All Pistols \y3 \wFlares",
  159. "Ak47 All Pistols \y3 \wMedkits",
  160. "P90, UMP45, MP5, All Pistols \y2 Rocket Launcher",
  161. "M249, AK47, M4A1 , All Pistols \y2 Proximity Mine",
  162. "SG550, All Pistols \y3 \wShock Grenades",
  163. "XM1014, All Pistols \y3 \wShock Grenades",
  164. }
  165.  
  166. new const g_szDisabledKitMenuOptions[KITS][] =
  167. {
  168. "M4A1, Deagle, 2 HE, 2 Flares",
  169. "AUG, Deagle, 2 HE, 3 Flares",
  170. "AK47, Deagle, 2 HE, 3 Medkits",
  171. "3 Guns Kit, Deagle, 2 HE, 2 Rockets",
  172. "3 Guns Kit, Deagle, 2 Mines",
  173. "SG550, Deagle, 3 Shock Grenades",
  174. "XM1014, All Pistols , 3 Shock Grenades"
  175. }
  176.  
  177. /*
  178.  
  179. Alien XP stuff
  180.  
  181. */
  182.  
  183. new const g_AlienAllowedWeapons = (1<<CSW_KNIFE) // alien only allowed to use knife
  184.  
  185. enum _:ALEVELS
  186. {
  187. ALEVEL_1,
  188. ALEVEL_2,
  189. ALEVEL_3,
  190. ALEVEL_4
  191. }
  192.  
  193. new const g_iAlienXPRequired[ALEVELS] =
  194. {
  195. 0,
  196. 50,
  197. 100,
  198. 200
  199. }
  200.  
  201. new const g_szAlienLevelNames[ALEVELS][] =
  202. {
  203. "Rookie Alien",
  204. "Medium Alien",
  205. "Advanced Alien",
  206. "Nightmare Alien"
  207. }
  208.  
  209. new const g_iAlienHealth[ALEVELS] =
  210. {
  211. 500,
  212. 650,
  213. 800,
  214. 900
  215. }
  216.  
  217. new const g_iAlienArmor[ALEVELS] =
  218. {
  219. 100,
  220. 100,
  221. 100,
  222. 200
  223. }
  224.  
  225. new const g_iAlienSpeed[ALEVELS] =
  226. {
  227. 400,
  228. 420,
  229. 450,
  230. 470
  231. }
  232.  
  233. new const g_szAlienLevelMessage[ALEVELS][] =
  234. {
  235. "^3* ^1Level ^3%i ^1Unlocked Ability: ^3High Jump^1, hold duck and press jump!",
  236. "^3* ^1Level ^3%i ^1Unlocked Ability: ^3Long Jump^1, use the lastinv key! (default Q)",
  237. "^3* ^1Level ^3%i ^1Unlocked Ability: ^3Regeneration^1, you regenerate health when not under attack!",
  238. "^3* ^1Level ^3%i ^1Unlocked Ability: ^3Acid Spit^1, use the drop key! (default G)"
  239. }
  240.  
  241. public GiveXP( id, iEvent )
  242. {
  243. if( 1 <= id <= g_iMaxPlayers )
  244. {
  245. g_iXP[id] += XP[iEvent]
  246.  
  247. // let's see if the alien gained a level
  248. new iNewLevel
  249. // loop through level xp requirements
  250. for( new iLevel = 0; iLevel < ALEVELS; iLevel++ )
  251. {
  252. // the alien has at least enough xp for this level
  253. if( g_iXP[id] >= g_iAlienXPRequired[iLevel] )
  254. {
  255. iNewLevel = iLevel
  256. }
  257. // the alien does not have enough xp for this level, so stop the loop
  258. else
  259. {
  260. break
  261. }
  262. }
  263.  
  264. // he gained a level
  265. if( iNewLevel > g_iAlienLevel[id] )
  266. {
  267. g_iAlienLevel[id] = iNewLevel
  268.  
  269. // show colored skill unlocked message
  270. if( g_iTeam[id] == TEAM_T )
  271. UTIL_SayText( id, id, MSG_ONE_UNRELIABLE, g_szAlienLevelMessage[iNewLevel], iNewLevel )
  272. }
  273.  
  274. static szMessage[64]
  275. formatex( szMessage, charsmax( szMessage ), g_szXPMessage[iEvent], XP[iEvent] )
  276.  
  277. if( XP[iEvent] > 0 )
  278. set_hudmessage( 0, 200, 70, HUD_XP_X, HUD_XP_Y, 1, 0.1, DELAY_XPDISPLAY, 0.2, 0.2, -1 )
  279. else
  280. set_hudmessage( 200, 0, 70, HUD_XP_X, HUD_XP_Y, 1, 0.1, DELAY_XPDISPLAY, 0.2, 0.2, -1 )
  281.  
  282. ShowSyncHudMsg( id, hud_XP, szMessage )
  283. }
  284. }
  285.  
  286. public GiveKit( id )
  287. {
  288. strip_user_weapons( id )
  289.  
  290. give_item( id, "weapon_deagle" )
  291. give_item( id, "weapon_elite" )
  292. give_item( id, "weapon_usp" )
  293. //give_item( id, "weapon_smokegrenade" )
  294. //give_item( id, "weapon_hegrenade" )
  295. give_item( id, "weapon_knife" )
  296. give_item( id, "item_suit" )
  297.  
  298. cs_set_user_bpammo( id, CSW_USP, 96 )
  299. cs_set_user_bpammo( id, CSW_ELITE, 90 )
  300. cs_set_user_bpammo( id, CSW_DEAGLE, 49 )
  301. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  302. //cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 2 )
  303.  
  304. if( g_iKit[id] != g_iDesiredKit[id] )
  305. {
  306. if( g_iXP[id] >= g_iHunterXPRequired[g_iDesiredKit[id]] )
  307. {
  308. g_iKit[id] = g_iDesiredKit[id]
  309. }
  310. else
  311. {
  312. return
  313. }
  314. }
  315.  
  316. new iHealth = 0
  317. new iArmor = 0
  318.  
  319. g_iAbilitiesRemaining[id] = 0
  320.  
  321. switch( g_iKit[id] )
  322. {
  323. case KIT_ASSAULT:
  324. {
  325. iHealth = 200
  326. iArmor = 50
  327.  
  328. give_item( id, "weapon_m4a1" )
  329. //give_item( id, "weapon_hegrenade" )
  330. give_item( id, "weapon_knife" )
  331. //give_item( id, "weapon_shield" )
  332.  
  333. cs_set_user_bpammo( id, CSW_M4A1, 200 )
  334. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  335.  
  336.  
  337. g_iAbilitiesRemaining[id] = 2
  338. }
  339. case KIT_SCOUT:
  340. {
  341. iHealth = 250
  342. iArmor = 50
  343.  
  344. give_item( id, "weapon_aug" )
  345. //give_item( id, "weapon_hegrenade" )
  346. give_item( id, "weapon_knife" )
  347.  
  348. cs_set_user_bpammo( id, CSW_AUG, 200 )
  349. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  350.  
  351. g_iAbilitiesRemaining[id] = 3
  352.  
  353.  
  354. }
  355. case KIT_MEDIC:
  356. {
  357. iHealth = 275
  358. iArmor = 50
  359.  
  360. give_item( id, "weapon_ak47" )
  361. give_item( id, "weapon_knife" )
  362. //give_item( id, "weapon_hegrenade" )
  363.  
  364. cs_set_user_bpammo( id, CSW_AK47, 200 )
  365. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  366.  
  367. // 3 medkits
  368. g_iAbilitiesRemaining[id] = 3
  369. }
  370. case KIT_ELITE:
  371. {
  372. iHealth = 285
  373. iArmor = 50
  374.  
  375. give_item( id, "weapon_xm1014" )
  376. give_item( id, "weapon_p90" )
  377. give_item( id, "weapon_mp5navy" )
  378. give_item( id, "weapon_ump45" )
  379. give_item( id, "weapon_knife" )
  380. //give_item( id, "weapon_hegrenade" )
  381.  
  382. cs_set_user_bpammo( id, CSW_XM1014, 200 )
  383. cs_set_user_bpammo( id, CSW_P90, 200 )
  384. cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
  385. cs_set_user_bpammo( id, CSW_UMP45, 200 )
  386. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  387.  
  388. // 2 grenade launchers
  389. g_iAbilitiesRemaining[id] = 2
  390.  
  391.  
  392. }
  393. case KIT_HEAVY:
  394. {
  395. iHealth = 300
  396. iArmor = 50
  397.  
  398. give_item( id, "weapon_m249" )
  399. give_item( id, "weapon_ak47" )
  400. give_item( id, "weapon_m4a1" )
  401. give_item( id, "weapon_knife" )
  402. //give_item( id, "weapon_hegrenade" )
  403.  
  404. cs_set_user_bpammo( id, CSW_M249, 200 )
  405. cs_set_user_bpammo( id, CSW_AK47, 200 )
  406. cs_set_user_bpammo( id, CSW_M4A1, 200 )
  407. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  408.  
  409.  
  410. // 1 proximity mine
  411. g_iAbilitiesRemaining[id] = 2
  412.  
  413.  
  414. }
  415. case KIT_HUNTER:
  416. {
  417. iHealth = 350
  418. iArmor = 50
  419.  
  420. // should be "LaserAWP"
  421. give_item( id, "weapon_sg550" )
  422. give_item( id, "weapon_awp" )
  423. give_item( id, "weapon_g3sg1" )
  424. give_item( id, "weapon_deagle" )
  425. give_item( id, "weapon_knife" )
  426. //give_item( id, "weapon_hegrenade" )
  427.  
  428.  
  429. cs_set_user_bpammo( id, CSW_SG550, 200 )
  430. cs_set_user_bpammo( id, CSW_AWP, 200 )
  431. cs_set_user_bpammo( id, CSW_G3SG1, 200 )
  432. cs_set_user_bpammo( id, CSW_DEAGLE, 200 )
  433. //cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  434.  
  435. // 3 shock grenades
  436. g_iAbilitiesRemaining[id] = 3
  437.  
  438.  
  439. }
  440. case KIT_PREDATOR:
  441. {
  442. iHealth = 500
  443. iArmor = 100
  444.  
  445. give_item( id, "weapon_xm1014" )
  446. give_item( id, "weapon_smokegrenade" )
  447. give_item( id, "weapon_hegrenade" )
  448.  
  449. cs_set_user_bpammo( id, CSW_XM1014, 200 )
  450. cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 2 )
  451. cs_set_user_bpammo( id, CSW_HEGRENADE, 2 )
  452. }
  453. }
  454.  
  455. // set up hp and armor
  456. set_user_health( id, iHealth )
  457. set_user_armor( id, iArmor )
  458.  
  459. //give_item( id, "weapon_hegrenade" )
  460. //cs_set_user_bpammo( id, CSW_HEGRENADE, 200 )
  461. //g_iAbilitiesRemaining[id] = 500
  462. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement