Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.40 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <colorchat>
  3. #include <cstrike>
  4. #include <csx>
  5. #include <engine>
  6. #include <fakemeta>
  7. #include <fakemeta_util>
  8. #include <fun>
  9. #include <hamsandwich>
  10.  
  11. #define DMG_HE (1<<24)
  12. #define FL_ONGROUND (1<<9)
  13. #define FL_WATERJUMP (1<<11)
  14. #define IsPlayer(%1) (1<=%1<=maxPlayers)
  15. #define g_Buffer 1536
  16. #define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)
  17.  
  18. forward amxbans_admin_connect(id);
  19.  
  20. new Array:g_Array, CsArmorType:armortype, bool:g_FreezeTime, bool:g_Vip[33], bool:hs[33][33],
  21. gRound=0, g_Hudmsg, ioid, m_DeathMsg, m_ScoreAttrib,
  22. m_ScoreInfo, m_ScreenFade, maxPlayers, skoki[33], sprSkull,
  23. weapon_id;
  24.  
  25. new const clips[]={0, 13, -0, 10, 1, 7, 0, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, 0, 50};
  26. new const g_Langcmd[][]={"say /vips","say_team /vips","say /vipy","say_team /vipy"};
  27. new const g_Prefix[] = "Vip Chat";
  28. new const spawnEntString[2][]={
  29. "info_player_start",
  30. "info_player_deathmatch"
  31. };
  32.  
  33. public plugin_init(){
  34. register_plugin("VIP Ultimate", "12.3.0.2", "Kosta");
  35. RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
  36. RegisterHam(get_player_resetmaxspeed_func(), "player", "fw_Player_ResetMaxSpeed", 1);
  37. register_logevent("logevent_round_start", 2, "1=Round_Start");
  38. register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
  39. register_forward(FM_CmdStart, "CmdStartPre");
  40. register_logevent("GameCommencing", 2, "1=Game_Commencing");
  41. RegisterHam(Ham_TakeDamage, "player", "takeDamage", 0);
  42. register_event("DeathMsg", "DeathMsg", "a");
  43. register_message(get_user_msgid("ScoreAttrib"), "VipStatus");
  44. g_Array=ArrayCreate(64,32);
  45. for(new i;i<sizeof g_Langcmd;i++){
  46. register_clcmd(g_Langcmd[i], "ShowVips");
  47. }
  48. g_Hudmsg=CreateHudSyncObj();
  49. register_event("Damage", "damage", "b", "2!0", "3=0", "4!0");
  50. register_clcmd("say_team", "VipChat");
  51. register_message(get_user_msgid("SayText"),"handleSayText");
  52. register_logevent("RoundEnd", 2, "1=Round_End");
  53. register_event("Damage", "Damage_Wyrzucenie", "b", "2!=0");
  54. RegisterHam(Ham_Killed, "player", "killedPre", 0);
  55. RegisterHam(Ham_TraceAttack, "player", "traceAttack", 1);
  56. }
  57. public client_authorized(id){
  58. if(get_user_flags(id) & 524288 == 524288){
  59. client_authorized_vip(id);
  60. }
  61. }
  62. public client_authorized_vip(id){
  63. g_Vip[id]=true;
  64. new g_Name[64];
  65. get_user_name(id,g_Name,charsmax(g_Name));
  66.  
  67. new g_Size = ArraySize(g_Array);
  68. new szName[64];
  69.  
  70. for(new i = 0; i < g_Size; i++){
  71. ArrayGetString(g_Array, i, szName, charsmax(szName));
  72.  
  73. if(equal(g_Name, szName)){
  74. return 0;
  75. }
  76. }
  77. ArrayPushString(g_Array,g_Name);
  78. set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
  79. ShowSyncHudMsg(0, g_Hudmsg, "Vip %s Je dosao na Server !",g_Name);
  80.  
  81. return PLUGIN_CONTINUE;
  82. }
  83. public client_disconnect(id){
  84. if(g_Vip[id]){
  85. client_disconnect_vip(id);
  86. }
  87. }
  88. public client_disconnect_vip(id){
  89. g_Vip[id]=false;
  90. new Name[64];
  91. get_user_name(id,Name,charsmax(Name));
  92.  
  93. new g_Size = ArraySize(g_Array);
  94. new g_Name[64];
  95.  
  96. for(new i = 0; i < g_Size; i++){
  97. ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
  98.  
  99. if(equal(g_Name,Name)){
  100. ArrayDeleteItem(g_Array,i);
  101. break;
  102. }
  103. }
  104. }
  105. public SpawnedEventPre(id){
  106. if(g_Vip[id]){
  107. if(is_user_alive(id)){
  108. SpawnedEventPreVip(id);
  109. }
  110. }
  111. }
  112. public SpawnedEventPreVip(id){
  113. set_user_gravity(id, 700.0/800.0);
  114. set_user_footsteps(id,1);
  115. skoki[id]=2;
  116. set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 25);
  117. set_user_health(id, get_user_health(id)+30);
  118. cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+100, 100), armortype);
  119. new henum=(user_has_weapon(id,CSW_HEGRENADE)?cs_get_user_bpammo(id,CSW_HEGRENADE):0);
  120. give_item(id, "weapon_hegrenade");
  121. ++henum;
  122. new fbnum=(user_has_weapon(id,CSW_FLASHBANG)?cs_get_user_bpammo(id,CSW_FLASHBANG):0);
  123. give_item(id, "weapon_flashbang");
  124. ++fbnum;
  125. cs_set_user_bpammo(id, CSW_FLASHBANG, 2);
  126. new sgnum=(user_has_weapon(id,CSW_SMOKEGRENADE)?cs_get_user_bpammo(id,CSW_SMOKEGRENADE):0);
  127. give_item(id, "weapon_smokegrenade");
  128. ++sgnum;
  129. recharge(id);
  130. if(gRound>=2){
  131. cs_set_user_money(id, min(cs_get_user_money(id)+1200, 16000), 1);
  132. }
  133. if(get_pdata_cbase(id, 369)==-1){
  134. give_item(id, "weapon_deagle");
  135. give_item(id, "ammo_50ae");
  136. weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
  137. if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
  138. cs_set_user_bpammo(id, CSW_DEAGLE, 35);
  139. }
  140. if(get_pdata_cbase(id, 368)==-1){
  141. if(gRound<=3){
  142. if(get_user_team(id)==1){
  143. give_item(id, "weapon_ak47");
  144. give_item(id, "ammo_762nato");
  145. weapon_id=find_ent_by_owner(-1, "weapon_ak47", id);
  146. if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
  147. cs_set_user_bpammo(id, CSW_AK47, 90);
  148. }
  149. if(get_user_team(id)==2){
  150. give_item(id, "weapon_m4a1");
  151. give_item(id, "ammo_556nato");
  152. weapon_id=find_ent_by_owner(-1, "weapon_m4a1", id);
  153. if(weapon_id)cs_set_weapon_ammo(weapon_id, 30);
  154. cs_set_user_bpammo(id, CSW_M4A1, 90);
  155. }
  156. }
  157. }
  158. if(get_user_team(id)==2){
  159. give_item(id, "item_thighpack");
  160. }
  161. }
  162. Ham:get_player_resetmaxspeed_func(){
  163. #if defined Ham_CS_Player_ResetMaxSpeed
  164. return IsHamValid(Ham_CS_Player_ResetMaxSpeed)?Ham_CS_Player_ResetMaxSpeed:Ham_Item_PreFrame;
  165. #else
  166. return Ham_Item_PreFrame;
  167. #endif
  168. }
  169. public fw_Player_ResetMaxSpeed(id){
  170. if(g_Vip[id]){
  171. if(is_user_alive(id)){
  172. fw_Player_ResetMaxSpeedVip(id);
  173. }
  174. }
  175. }
  176. public logevent_round_start(){
  177. g_FreezeTime=false;
  178. }
  179. public event_new_round(){
  180. g_FreezeTime=true;
  181. ++gRound;
  182. }
  183. public fw_Player_ResetMaxSpeedVip(id){
  184. if(!g_FreezeTime){
  185. set_user_maxspeed(id,get_user_maxspeed(id) + 20);
  186. }
  187. }
  188. public CmdStartPre(id, uc_handle){
  189. if(g_Vip[id]){
  190. if(is_user_alive(id)){
  191. CmdStartPreVip(id, uc_handle);
  192. }
  193. }
  194. }
  195. public CmdStartPreVip(id, uc_handle){
  196. new flags = pev(id, pev_flags);
  197. if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id]>0){
  198. --skoki[id];
  199. new Float:velocity[3];
  200. pev(id, pev_velocity,velocity);
  201. velocity[2] = random_float(265.0,285.0);
  202. set_pev(id,pev_velocity,velocity);
  203. } else if(flags & FL_ONGROUND && skoki[id]!=-1){
  204. skoki[id] = 2;
  205. }
  206. }
  207. public GameCommencing(){
  208. gRound=0;
  209. }
  210. public recharge(id){
  211. new wid=get_user_weapon(id);
  212. if(wid){
  213. new weaponname[32], weid;
  214. get_weaponname(wid, weaponname, 31);
  215. weid=find_ent_by_owner(-1, weaponname, id);
  216. if(weid){
  217. cs_set_weapon_ammo(weid, clips[wid]);
  218. }
  219. }
  220. }
  221. public plugin_cfg(){
  222. maxPlayers=get_maxplayers();
  223. m_ScreenFade=get_user_msgid("ScreenFade");
  224. m_DeathMsg=get_user_msgid("DeathMsg");
  225. m_ScoreAttrib=get_user_msgid("ScoreAttrib");
  226. m_ScoreInfo=get_user_msgid("ScoreInfo");
  227. }
  228. public takeDamage(this, idinflictor, idattacker, Float:damage, damagebits){
  229. if(((IsPlayer(idattacker) && is_user_connected(idattacker) && g_Vip[idattacker] && (ioid=idattacker)) ||
  230. (ioid=pev(idinflictor, pev_owner) && IsPlayer(ioid) && is_user_connected(ioid) && g_Vip[ioid]))){
  231. damage*=(100+50)/100;
  232. if(damagebits & DMG_HE){
  233. damage*=(100+10)/100;
  234. }
  235. if(damagebits & DMG_BULLET){
  236. if(get_user_weapon(ioid)==CSW_DEAGLE){
  237. damage*=(100+50)/100;
  238. }
  239. if(get_user_weapon(ioid)==CSW_AK47){
  240. if(gRound<=3){
  241. if(get_user_team(ioid)==1){
  242. damage*=(100+10)/100;
  243. }
  244. }
  245. }
  246. if(get_user_weapon(ioid)==CSW_M4A1){
  247. if(gRound<=3){
  248. if(get_user_team(ioid)==2){
  249. damage*=(100+10)/100;
  250. }
  251. }
  252. }
  253. }
  254. }
  255.  
  256. SetHamParamFloat(4, damage);
  257. return HAM_HANDLED;
  258. }
  259. public DeathMsg(){
  260. new killer=read_data(1);
  261. new victim=read_data(2);
  262.  
  263. if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){
  264. DeathMsgVip(killer,victim,read_data(3));
  265. }
  266. }
  267. public DeathMsgVip(kid,vid,hs){
  268. set_user_health(kid, min(get_user_health(kid)+(hs?15:10),130));
  269. cs_set_user_money(kid, cs_get_user_money(kid)+(hs?1000:700));
  270. recharge(kid);
  271. }
  272. public VipStatus(){
  273. new id=get_msg_arg_int(1);
  274. if(is_user_alive(id) && g_Vip[id]){
  275. set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int(2)|4);
  276. }
  277. }
  278. public ShowVips(id){
  279. new g_Name[64],g_Message[192];
  280.  
  281. new g_Size=ArraySize(g_Array);
  282.  
  283. for(new i = 0; i < g_Size; i++){
  284. ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
  285.  
  286. add(g_Message, charsmax(g_Message), g_Name);
  287.  
  288. if(i == g_Size - 1){
  289. add(g_Message, charsmax(g_Message), ".");
  290. }
  291. else{
  292. add(g_Message, charsmax(g_Message), ", ");
  293. }
  294. }
  295. ColorChat(id,GREEN,"^x03Vipy ^x04na ^x03serwerze: ^x04%s", g_Message);
  296. ShowVipsMotd(id);
  297. return PLUGIN_CONTINUE;
  298. }
  299. public ShowVipsMotd(id){
  300. new Data[g_Buffer],Len,g_Name[64];
  301.  
  302. Len = formatex(Data[Len], g_Buffer - Len, "<html><body bgcolor=Black><br>");
  303. Len += formatex(Data[Len], g_Buffer - Len, "<center><table frame=^"border^" width=^"600^" cellspacing=^"0^" bordercolor=#4A4344 style=^"color:#56A5EC;text-align:center;^">");
  304. Len += formatex(Data[Len], g_Buffer- Len, "<tr><td><b>#</b></td><td><b>Nick</b></td></td></tr>");
  305.  
  306. new g_Size=ArraySize(g_Array);
  307.  
  308. for(new i = 0; i < g_Size; i++){
  309. ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
  310.  
  311. Len += formatex(Data[Len], g_Buffer - Len, "<tr>");
  312. Len += formatex(Data[Len], g_Buffer - Len, "<td><font color=Red>%d</font></td>", i + 1);
  313. Len += formatex(Data[Len], g_Buffer - Len, "<td>%s</td>", g_Name);
  314. Len += formatex(Data[Len], g_Buffer - Len, "</tr>");
  315. }
  316. Len += formatex(Data[Len],g_Buffer - Len,"</center></body></html>");
  317.  
  318. show_motd(id, Data, "Vipy Online");
  319. }
  320. public client_infochanged(id){
  321. if(g_Vip[id]){
  322. new szName[64];
  323. get_user_info(id,"name",szName,charsmax(szName));
  324.  
  325. new Name[64];
  326. get_user_name(id,Name,charsmax(Name));
  327.  
  328. if(!equal(szName,Name)){
  329. ArrayPushString(g_Array,szName);
  330.  
  331. new g_Size=ArraySize(g_Array);
  332. new g_Name[64];
  333. for(new i = 0; i < g_Size; i++){
  334. ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
  335.  
  336. if(equal(g_Name,Name)){
  337. ArrayDeleteItem(g_Array,i);
  338. break;
  339. }
  340. }
  341. }
  342. }
  343. }
  344. public plugin_end(){
  345. ArrayDestroy(g_Array);
  346. }
  347. public damage(id){
  348. new attacker=get_user_attacker(id);
  349. new damage=read_data(2);
  350.  
  351. if(g_Vip[id]){
  352. set_hudmessage(255, 0, 0, 0.45, 0.50, 2, 0.1, 4.0, 0.1, 0.1, -1);
  353. ShowSyncHudMsg(id, g_Hudmsg, "%i^n", damage);
  354. }
  355. if(is_user_connected(attacker) && g_Vip[attacker]){
  356. set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1);
  357. ShowSyncHudMsg(attacker, g_Hudmsg, "%i^n", damage);
  358. }
  359. }
  360. public VipChat(id){
  361. if(g_Vip[id]){
  362. new g_Msg[256],
  363. g_Text[256];
  364.  
  365. read_args(g_Msg,charsmax(g_Msg));
  366. remove_quotes(g_Msg);
  367.  
  368. if(g_Msg[0] == '*' && g_Msg[1]){
  369. new g_Name[64];
  370. get_user_name(id,g_Name,charsmax(g_Name));
  371.  
  372. formatex(g_Text,charsmax(g_Text),"^x01(%s) ^x03%s : ^x04%s",g_Prefix, g_Name, g_Msg[1]);
  373.  
  374. for(new i=1;i<33;i++){
  375. if(is_user_connected(i) && g_Vip[i])
  376. ColorChat(i, GREEN, "%s", g_Text);
  377. }
  378. return PLUGIN_HANDLED_MAIN;
  379. }
  380. }
  381. return PLUGIN_CONTINUE;
  382. }
  383. public handleSayText(msgId,msgDest,msgEnt){
  384. new id = get_msg_arg_int(1);
  385.  
  386. if(is_user_connected(id) && g_Vip[id]){
  387. new szTmp[256],szTmp2[256];
  388. get_msg_arg_string(2,szTmp, charsmax(szTmp))
  389.  
  390. new szPrefix[64] = "^x04[VIP]";
  391.  
  392. if(!equal(szTmp,"#Cstrike_Chat_All")){
  393. add(szTmp2,charsmax(szTmp2),szPrefix);
  394. add(szTmp2,charsmax(szTmp2)," ");
  395. add(szTmp2,charsmax(szTmp2),szTmp);
  396. }
  397. else{
  398. add(szTmp2,charsmax(szTmp2),szPrefix);
  399. add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
  400. }
  401. set_msg_arg_string(2,szTmp2);
  402. }
  403. return PLUGIN_CONTINUE;
  404. }
  405. public bomb_planted(id){
  406. if(is_user_alive(id) && g_Vip[id]){
  407. cs_set_user_money(id,cs_get_user_money(id) + 900);
  408. }
  409. }
  410. public bomb_defused(id){
  411. if(is_user_alive(id) && g_Vip[id]){
  412. cs_set_user_money(id,cs_get_user_money(id) + 900);
  413. }
  414. }
  415. public RoundEnd(){
  416. for(new i = 1; i <= maxPlayers; i++){
  417. if(is_user_alive(i) && g_Vip[i]){
  418. cs_set_user_money(i,cs_get_user_money(i) + 900);
  419. }
  420. }
  421. }
  422. public client_PreThink(id){
  423. if(g_Vip[id] && is_user_alive(id)){
  424. client_PreThinkVip(id);
  425. }
  426. }
  427. public client_PreThinkVip(id){
  428. entity_set_float(id, EV_FL_fuser2, 0.0);
  429.  
  430. if(entity_get_int(id, EV_INT_button) & 2){
  431. new flags = entity_get_int(id, EV_INT_flags);
  432.  
  433. if(flags & FL_WATERJUMP || entity_get_int(id, EV_INT_waterlevel) >= 2 || !(flags & FL_ONGROUND)){
  434. return PLUGIN_CONTINUE;
  435. }
  436. new Float:velocity[3];
  437. entity_get_vector(id, EV_VEC_velocity, velocity);
  438.  
  439. velocity[2] += 250.0;
  440. entity_set_vector(id, EV_VEC_velocity, velocity);
  441.  
  442. entity_set_int(id, EV_INT_gaitsequence, 6);
  443. }
  444. return PLUGIN_CONTINUE;
  445. }
  446. public Damage_Wyrzucenie(vid){
  447. new aid=get_user_attacker(vid);
  448. if(is_user_connected(aid) && is_user_alive(vid) && g_Vip[aid] && get_user_team(aid)!=get_user_team(vid) && random(100)<5){
  449. Damage_Wyrzucenie_Vip(aid, vid);
  450. }
  451. }
  452. public Damage_Wyrzucenie_Vip(aid, vid){
  453. if(gRound<=1){
  454. client_cmd(vid, "drop");
  455. }
  456. }
  457. public traceAttack(vid, aid, Float:dmg, Float:dir[3], ptr, dmgbits){
  458. if(IsPlayer(aid)){
  459. hs[aid][vid]=bool:(get_tr2(ptr, TR_iHitgroup)==1);
  460. }
  461. }
  462. public plugin_precache(){
  463. sprSkull=precache_model("sprites/skull.spr");
  464. }
  465. public screen_flash(id, red, green, blue, alpha){
  466. message_begin(MSG_ONE_UNRELIABLE, m_ScreenFade, _, id);
  467. write_short(1<<12);
  468. write_short(1<<12);
  469. write_short(1<<12);
  470. write_byte(red);
  471. write_byte(green);
  472. write_byte(blue);
  473. write_byte(alpha);
  474. message_end();
  475. }
  476. public find_free_spawn(iTeamNumber, Float:spawnOrigin[3], Float:spawnAngle[3]){
  477. new iSpawn;
  478. if(iTeamNumber==2)
  479. iSpawn=0;
  480. else
  481. iSpawn=1;
  482.  
  483. const maxSpawns=128;
  484. new spawnPoints[maxSpawns], bool:spawnChecked[maxSpawns], spawnpoint, spawnnum;
  485. new ent=-1, spawnsFound=0;
  486.  
  487. while((ent=fm_find_ent_by_class(ent,spawnEntString[iSpawn])) && spawnsFound<maxSpawns)
  488. spawnPoints[spawnsFound++]=ent;
  489.  
  490. new Float:vicinity = 100.0; //(32x32x96)
  491. new i, entList[1];
  492.  
  493. for(i=0; i<maxSpawns; i++)
  494. spawnChecked[i]=false;
  495.  
  496. // Loop through all the spawn points
  497. i=0;
  498. while(i++<spawnsFound*10){
  499. spawnnum=random(spawnsFound);
  500. spawnpoint=spawnPoints[spawnnum];
  501.  
  502. if(spawnpoint && !spawnChecked[spawnnum]){
  503. //don't check this spawn point again
  504. spawnChecked[spawnnum]=true;
  505.  
  506. // Get the origin of the spawn point
  507. pev(spawnpoint, pev_origin, spawnOrigin);
  508.  
  509. // Determine if something is in this near the spawn point
  510. if(!fm_find_sphere_class(0, "player", vicinity, entList, 1, spawnOrigin)){
  511. // If there is nothing, return the angles and spawnpoint
  512. pev(spawnpoint, pev_angles, spawnAngle);
  513. return spawnpoint;
  514. }
  515. }
  516. }
  517.  
  518. return 0;
  519. }
  520. stock fm_find_sphere_class(ent, const _classname[], Float:radius, entlist[], maxents, Float:origin[3]={0.0,0.0,0.0}){
  521. if( pev_valid(ent) )
  522. pev( ent, pev_origin, origin );
  523. new tempent, tempclass[32], entsfound;
  524. while( (tempent = fm_find_ent_in_sphere(tempent, origin, radius) ) && entsfound < maxents ){
  525. if( pev_valid(tempent) ){
  526. pev(tempent, pev_classname, tempclass, 31);
  527. if( equal( _classname, tempclass ) )
  528. entlist[entsfound++] = tempent;
  529. }
  530. }
  531. return entsfound;
  532. }
  533. public teleport_to_own_spawn(data[]){
  534. new id=data[0];
  535. new origin[3], Float:fl_origin[3];
  536. new Float:angle[3], Float:fOrigin[3];
  537.  
  538. pev(id, pev_origin, fOrigin);
  539. fOrigin[2]+=35.0;
  540. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  541. write_byte(TE_SPRITE);
  542. write_coord_f(fOrigin[0]);
  543. write_coord_f(fOrigin[1]);
  544. write_coord_f(fOrigin[2]);
  545. write_short(sprSkull);
  546. write_byte(20);
  547. write_byte(255);
  548. message_end();
  549.  
  550. find_free_spawn(get_user_team(id), fl_origin, angle);
  551. FVecIVec(fl_origin, origin);
  552.  
  553. set_user_origin(id, origin);
  554. set_pev(id, pev_angles, angle);
  555. }
  556. public remove_godmode(data[]){
  557. set_user_godmode(data[0]);
  558. }
  559. public recharge0(data[]){
  560. recharge(data[0]);
  561. }
  562. public do_deathmsg(iKiller, iVictim, iHS, const szWeapon[]){
  563. message_begin(MSG_BROADCAST, m_DeathMsg);
  564. write_byte(iKiller);
  565. write_byte(iVictim);
  566. write_byte(iHS);
  567. write_string(szWeapon);
  568. message_end();
  569. }
  570. public killedPre(id, kid){
  571. if(g_Vip[id] && random(100)<5){
  572. if(gRound<=1){
  573. ExecuteHam(Ham_AddPoints, kid, 1, true);
  574. screen_flash(id, 255, 0, 0, 100);
  575. set_user_health(id, 100);
  576. set_user_godmode(id, 1);
  577.  
  578. new data[1];
  579. data[0]=id;
  580.  
  581. set_task(0.1, "teleport_to_own_spawn", _, data, 1);
  582. set_task(0.55, "recharge0", _, data, 1);
  583. set_task(1.0, "remove_godmode", _, data, 1);
  584.  
  585. new bool:suicide;
  586.  
  587. if(IsPlayer(kid)){
  588. if(id==kid){
  589. suicide=true;
  590. do_deathmsg(id, id, 0, "suicide");
  591. } else {
  592. if(get_user_team(kid)!=get_user_team(id)){
  593. ExecuteHam(Ham_AddPoints, kid, 1, true);
  594. }
  595. new szWeapon[24];
  596. get_weaponname(get_user_weapon(kid), szWeapon, 23);
  597. replace(szWeapon, 23, "weapon_", "");
  598. do_deathmsg(kid, id, hs[kid][id], szWeapon);
  599. }
  600. } else {
  601. suicide=true;
  602. do_deathmsg(id, id, 0, "suicide");
  603. }
  604.  
  605. message_begin(MSG_BROADCAST, m_ScoreAttrib, {0,0,0}, 0);
  606. write_byte(id);
  607. write_byte((user_has_weapon(id, CSW_C4)?2:0)|cs_get_user_vip(id));
  608. message_end();
  609.  
  610. message_begin(MSG_BROADCAST, m_ScoreInfo);
  611. write_byte(id);
  612. write_short(get_user_frags(id)-_:suicide);
  613. write_short(cs_get_user_deaths(id)+1);
  614. write_short(0);
  615. write_short(get_user_team(id));
  616. message_end();
  617.  
  618. set_pdata_int(id, 362, 0);
  619.  
  620. return HAM_SUPERCEDE;
  621. }
  622. }
  623. return HAM_IGNORED;
  624. }
  625. public amxbans_admin_connect(id){
  626. client_authorized(id);
  627. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement