Advertisement
Guest User

PaintBall VIP by Yakavetta

a guest
Oct 10th, 2015
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.42 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <hamsandwich>
  5. #include <cstrike>
  6. #include <engine>
  7. #include <fakemeta>
  8. #include <colorchat>
  9.  
  10. #define PLUGIN "PaintBall_VIP"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Yakavetta"
  13.  
  14. #define Tag "[Bonus]"
  15.  
  16. #define VIP_CHECK ADMIN_LEVEL_H
  17. #define ADMIN_VIP ADMIN_LEVEL_H
  18.  
  19. #define OFFSET_CLIPAMMO 51
  20. #define OFFSET_LINUX_WEAPONS 4
  21. #define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
  22.  
  23. // players offsets
  24. #define m_pActiveItem 373
  25.  
  26. const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
  27.  
  28. new const g_MaxClipAmmo[] =
  29. {
  30. 0,
  31. 13, //CSW_P228
  32. 0,
  33. 10, //CSW_SCOUT
  34. 0, //CSW_HEGRENADE
  35. 7, //CSW_XM1014
  36. 0, //CSW_C4
  37. 30,//CSW_MAC10
  38. 30, //CSW_AUG
  39. 0, //CSW_SMOKEGRENADE
  40. 15,//CSW_ELITE
  41. 20,//CSW_FIVESEVEN
  42. 25,//CSW_UMP45
  43. 30, //CSW_SG550
  44. 35, //CSW_GALIL
  45. 25, //CSW_FAMAS
  46. 12,//CSW_USP
  47. 20,//CSW_GLOCK18
  48. 10, //CSW_AWP
  49. 30,//CSW_MP5NAVY
  50. 100,//CSW_M249
  51. 8, //CSW_M3
  52. 30, //CSW_M4A1
  53. 30,//CSW_TMP
  54. 20, //CSW_G3SG1
  55. 0, //CSW_FLASHBANG
  56. 7, //CSW_DEAGLE
  57. 30, //CSW_SG552
  58. 30, //CSW_AK47
  59. 0, //CSW_KNIFE
  60. 50//CSW_P90
  61. }
  62.  
  63. static const COLOR[] = "^x04" //green
  64. static const CONTACT[] = ""
  65.  
  66. enum {
  67. SCOREATTRIB_ARG_PLAYERID = 1,
  68. SCOREATTRIB_ARG_FLAGS
  69. };
  70.  
  71. enum ( <<= 1 ) {
  72. SCOREATTRIB_FLAG_NONE = 0,
  73. SCOREATTRIB_FLAG_DEAD = 1,
  74. SCOREATTRIB_FLAG_BOMB,
  75. SCOREATTRIB_FLAG_VIP
  76. };
  77.  
  78. new pCvar_AdminVIP;
  79. new maxplayers
  80. new gmsgSayText
  81. new vip_bombe
  82. new vip_hp
  83. new vip_dosao
  84. new vip_boja_huda
  85. new vip_gravitacija
  86. new vip_brzina
  87. new vip_skin
  88.  
  89. new cStatus, cMaxHealth;
  90. new cKill, cHeadshot;
  91.  
  92. public plugin_init() {
  93. register_plugin(PLUGIN, VERSION, AUTHOR)
  94.  
  95. RegisterHam(Ham_Spawn, "player", "Spawn", 1)
  96.  
  97. vip_bombe = register_cvar("vip_bombe","1")
  98. vip_hp = register_cvar("vip_hp","50")
  99. vip_dosao = register_cvar("vip_dosao","1")
  100. vip_boja_huda = register_cvar("vip_boja_huda","1")
  101. pCvar_AdminVIP = register_cvar( "amx_adminvip", "1" );
  102. vip_gravitacija = register_cvar("vip_gravitacija","0.2")
  103. vip_brzina = register_cvar("vip_brzina","50.0")
  104. vip_skin = register_cvar("vip_skin","1")
  105. cStatus = register_cvar("bonus_status", "1");
  106. cMaxHealth = register_cvar("bonus_maxhealth", "300");
  107. cKill = register_cvar("bonus_kill", "40");
  108. cHeadshot = register_cvar("bonus_headshot", "50");
  109.  
  110. /* Player Killed */
  111. register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
  112.  
  113.  
  114. register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
  115. register_clcmd("say", "handle_say")
  116.  
  117. maxplayers = get_maxplayers()
  118. register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
  119. gmsgSayText = get_user_msgid("SayText")
  120.  
  121. register_event("ResetHUD", "resetModel", "b")
  122. register_event("CurWeapon", "eCurWeapon", "be", "1=1");
  123.  
  124. register_plugin( PLUGIN , VERSION , AUTHOR );
  125. register_event("CurWeapon" , "Event_CurWeapon" , "be" , "1=1" );
  126.  
  127. register_clcmd("say", "sayee")
  128.  
  129. maxplayers = get_maxplayers()
  130. }
  131.  
  132. public plugin_precache() {
  133. precache_model("models/player/vipt/vipt.mdl")
  134. precache_model("models/player/vipct/vipct.mdl")
  135. }
  136.  
  137. public resetModel(id)
  138. {
  139. if(get_pcvar_num(vip_skin) == 1)
  140. return PLUGIN_CONTINUE;
  141.  
  142. if(is_user_connected(id) && is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
  143. {
  144. switch(cs_get_user_team(id))
  145. {
  146. case CS_TEAM_T:
  147. cs_set_user_model(id, "vipt");
  148. case CS_TEAM_CT:
  149. cs_set_user_model(id, "vipct");
  150. }
  151. }
  152. return PLUGIN_CONTINUE;
  153. }
  154.  
  155. public Spawn(id)
  156. {
  157. if(is_user_connected(id) && is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
  158. {
  159. switch(get_pcvar_num(vip_bombe))
  160. {
  161. case 1:
  162. {
  163. give_item(id,"weapon_hegrenade")
  164. }
  165. case 0:
  166. return PLUGIN_CONTINUE;
  167. }
  168.  
  169. set_user_health(id,get_user_health(id) + get_pcvar_num(vip_hp))
  170. set_user_maxspeed(id, get_user_maxspeed(id) + get_pcvar_float(vip_brzina))
  171. set_user_gravity(id, get_user_gravity(id) - get_pcvar_float(vip_gravitacija))
  172. }
  173. return PLUGIN_HANDLED;
  174. }
  175.  
  176. public eCurWeapon(id)
  177. {
  178. CheckSpeed(id);
  179. return PLUGIN_CONTINUE;
  180. }
  181.  
  182. public CheckSpeed(id)
  183. set_user_maxspeed(id, get_user_maxspeed(id) + get_pcvar_num(vip_brzina));
  184.  
  185. public client_putinserver(id)
  186. {
  187. set_task(3.0,"vip_doso",id)
  188. }
  189.  
  190. public vip_doso(id)
  191. {
  192. if(is_user_connected(id))
  193. {
  194. if(get_user_flags(id) & ADMIN_LEVEL_H)
  195. {
  196. if(is_user_connected(id))
  197. if(get_pcvar_num(vip_dosao) == 0)
  198. return PLUGIN_HANDLED
  199. new name[32]
  200. get_user_name(id, name, 31)
  201. if(get_pcvar_num(vip_boja_huda) == 1)
  202. {
  203. set_hudmessage(255, 0, 0, 0.06, 0.73, 0, 6.0, 12.0) //crvema
  204. show_hudmessage(0, "VIP %s je dosao na server",name)
  205. }
  206. if(get_pcvar_num(vip_boja_huda) == 2)
  207. {
  208. set_hudmessage(0, 255, 0, 0.06, 0.73, 0, 6.0, 12.0) //zelena
  209. show_hudmessage(0, "VIP %s je dosao na server",name)
  210. }
  211. if(get_pcvar_num(vip_boja_huda) == 3)
  212. {
  213. set_hudmessage(0, 255, 255, 0.06, 0.73, 0, 6.0, 12.0) //plava
  214. show_hudmessage(0, "VIP %s je dosao na server",name)
  215. }
  216. return PLUGIN_HANDLED
  217. }
  218. return PLUGIN_HANDLED
  219. }
  220. return PLUGIN_HANDLED
  221. }
  222.  
  223. public handle_say(id) {
  224. new said[192]
  225. read_args(said,192)
  226. if( ( containi(said, "who") != -1 && containi(said, "vip") != -1 ) || contain(said, "/vips") != -1 )
  227. set_task(0.1,"print_adminlist",id)
  228. return PLUGIN_CONTINUE
  229. }
  230.  
  231. public print_adminlist(user)
  232. {
  233. new adminnames[33][32]
  234. new message[256]
  235. new contactinfo[256], contact[112]
  236. new id, count, x, len
  237.  
  238. for(id = 1 ; id <= maxplayers ; id++)
  239. if(is_user_connected(id))
  240. if(get_user_flags(id) & VIP_CHECK)
  241. get_user_name(id, adminnames[count++], 31)
  242.  
  243. len = format(message, 255, "%s ONLINE VIP-ovi su: ",COLOR)
  244. if(count > 0) {
  245. for(x = 0 ; x < count ; x++) {
  246. len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  247. if(len > 96 ) {
  248. print_message(user, message)
  249. len = format(message, 255, "%s ",COLOR)
  250. }
  251. }
  252. print_message(user, message)
  253. }
  254. else {
  255. len += format(message[len], 255-len, "Nema online VIP-ova")
  256. print_message(user, message)
  257. }
  258.  
  259. get_cvar_string("amx_contactinfo", contact, 63)
  260. if(contact[0]) {
  261. format(contactinfo, 111, "%s Contact Server Vip -- %s", COLOR, contact)
  262. print_message(user, contactinfo)
  263. }
  264. }
  265.  
  266. print_message(id, msg[]) {
  267. message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
  268. write_byte(id)
  269. write_string(msg)
  270. message_end()
  271. }
  272.  
  273. public MessageScoreAttrib( iMsgId, iDest, iReceiver ) {
  274. if( get_pcvar_num( pCvar_AdminVIP ) ) {
  275. new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );
  276.  
  277. if( access( iPlayer, ADMIN_VIP ) ) {
  278. set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
  279. }
  280. }
  281. }
  282.  
  283. public Event_CurWeapon( id )
  284. {
  285. if(is_user_connected(id))
  286. {
  287. if(get_user_flags(id) & ADMIN_LEVEL_H)
  288. {
  289. new iWeapon = read_data(2)
  290. if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) )
  291. {
  292. fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] )
  293. }
  294. }
  295. return PLUGIN_HANDLED
  296. }
  297. return PLUGIN_HANDLED
  298. }
  299.  
  300. public sayee(id){
  301. if(get_user_flags(id) & ADMIN_LEVEL_H)
  302. {
  303. new said[192], name[30]
  304. get_user_name(id,name,29)
  305. read_args(said,191)
  306. remove_quotes(said)
  307. ColorChat(0, GREEN,"[V.I.P] ^3%s ^1: %s",name,said)
  308. }
  309. return PLUGIN_HANDLED
  310. }
  311. GiveHealth(id, count)
  312. set_user_health(id, min( (get_user_health(id) + count), get_pcvar_num(cMaxHealth) ))
  313.  
  314. public EventDeathMsg( id ) {
  315. if(get_user_flags(id) & ADMIN_LEVEL_H)
  316. {
  317. new killer = read_data(1);
  318. new victim = read_data(2);
  319. new headshot = read_data(3);
  320. new weapon = get_user_weapon(killer);
  321. new num;
  322.  
  323. if(killer == victim || !get_pcvar_num(cStatus) || !is_user_connected(victim) || !is_user_alive(killer))
  324. return PLUGIN_HANDLED;
  325.  
  326. if(headshot) {
  327. num = get_pcvar_num(cHeadshot)
  328. GiveHealth(killer, num)
  329. HudMessage(killer, "Healed +%ihp", num)
  330. } else {
  331. num = get_pcvar_num(cKill)
  332. GiveHealth(killer, num)
  333. HudMessage(killer, "Healed +%ihp", num)
  334. }
  335. }
  336. return PLUGIN_CONTINUE;
  337. }
  338.  
  339.  
  340.  
  341. stock HudMessage(const id, const input[], any:...) {
  342. static msg[191];
  343. vformat(msg, 190, input, 3);
  344.  
  345. set_hudmessage(127, 170, 255, 0.27, 0.14, 0, 5.0, 5.0, 0.0, 0.0, -1);
  346. show_hudmessage(id, "%s^n%s", Tag, msg)
  347. }
  348. /*
  349. CREDITS:
  350. Yakavetta PB VIP
  351. Defuser Knife Vip
  352. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement