Advertisement
Hyuna

Shocker Mod V 1.0 By Hyuna

Dec 27th, 2012
714
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.61 KB | None | 0 0
  1. /*
  2.     -------------------------------------------------------------------
  3.     Shocker Mod (For JB) V 1.0
  4.     Copyright (C) 2012 Hyuna aka NorToN
  5.  
  6.     This program is free software: you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation, either version 3 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.    
  19.     -------------------------------------------------------------------
  20.    
  21.     I'm not allowing to Yosi/Stav/Noam use/take/change anything on this plugin!
  22.     I'm not allowing to change credits!
  23.    
  24.     Thankyou,
  25.     Hyuna - Plugin creator.
  26. */
  27.  
  28. #include <amxmodx>
  29. #include <hamsandwich>
  30. #include <fakemeta>
  31.  
  32. enum _:Teams{
  33.     FM_TEAM_UNASSIGNED,
  34.     FM_TEAM_T,
  35.     FM_TEAM_CT,
  36.     FM_TEAM_SPECTATOR
  37. };
  38.  
  39. new const V_SHOCKER [] = "models/jailbreak/v_shocker.mdl";
  40.  
  41. public plugin_init(){
  42.     register_plugin("Shocker Mod","1.0","Hyuna");
  43.     register_event("CurWeapon","Event_CurWeapon","be","1=1");
  44.     RegisterHam(Ham_TakeDamage,"player","fw_HamPlayerTakeDamage",0);
  45. }
  46.  
  47. public plugin_precache(){
  48.     precache_model(V_SHOCKER);
  49. }
  50.  
  51. public Event_CurWeapon(client){
  52.     if (!is_user_alive(client))
  53.         return;
  54.        
  55.     new weapon = get_user_weapon(client);
  56.    
  57.     if (weapon == CSW_KNIFE && fm_get_user_team(client) == FM_TEAM_CT)
  58.         set_pev(client,pev_viewmodel2,V_SHOCKER);
  59. }
  60.  
  61. public fw_HamPlayerTakeDamage(victim,inflictor,attacker,Float:damage,DamageBits){
  62.     if (fm_get_user_team(victim) == FM_TEAM_T && fm_get_user_team(attacker) == FM_TEAM_CT && is_user_connected(victim))
  63.     {
  64.         // Shake Victim's Screen
  65.         create_EarthQuake(victim);
  66.        
  67.         // Blind Victim Screen
  68.         blind_player(victim);
  69.     }
  70.        
  71. }
  72.  
  73. stock create_EarthQuake(index){
  74.     message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},index);
  75.     write_short(255<<14); //ammount
  76.     write_short(10<<14); //lasts this long
  77.     write_short(255<<14); //frequency
  78.     message_end();
  79. }
  80.  
  81. stock blind_player(index){
  82.     message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},index);
  83.     write_short(1<<15);
  84.     write_short(1<<10);
  85.     write_short(1<<12);
  86.     write_byte(255); // Red
  87.     write_byte(255); // Green
  88.     write_byte(255); // Blue
  89.     write_byte(255); // Alpha
  90.     message_end();
  91. }
  92.  
  93. stock fm_get_user_team(index)
  94.     return get_pdata_int(index,114);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement