Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -------------------------------------------------------------------
- Shocker Mod (For JB) V 1.0
- Copyright (C) 2012 Hyuna aka NorToN
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- -------------------------------------------------------------------
- I'm not allowing to Yosi/Stav/Noam use/take/change anything on this plugin!
- I'm not allowing to change credits!
- Thankyou,
- Hyuna - Plugin creator.
- */
- #include <amxmodx>
- #include <hamsandwich>
- #include <fakemeta>
- enum _:Teams{
- FM_TEAM_UNASSIGNED,
- FM_TEAM_T,
- FM_TEAM_CT,
- FM_TEAM_SPECTATOR
- };
- new const V_SHOCKER [] = "models/jailbreak/v_shocker.mdl";
- public plugin_init(){
- register_plugin("Shocker Mod","1.0","Hyuna");
- register_event("CurWeapon","Event_CurWeapon","be","1=1");
- RegisterHam(Ham_TakeDamage,"player","fw_HamPlayerTakeDamage",0);
- }
- public plugin_precache(){
- precache_model(V_SHOCKER);
- }
- public Event_CurWeapon(client){
- if (!is_user_alive(client))
- return;
- new weapon = get_user_weapon(client);
- if (weapon == CSW_KNIFE && fm_get_user_team(client) == FM_TEAM_CT)
- set_pev(client,pev_viewmodel2,V_SHOCKER);
- }
- public fw_HamPlayerTakeDamage(victim,inflictor,attacker,Float:damage,DamageBits){
- if (fm_get_user_team(victim) == FM_TEAM_T && fm_get_user_team(attacker) == FM_TEAM_CT && is_user_connected(victim))
- {
- // Shake Victim's Screen
- create_EarthQuake(victim);
- // Blind Victim Screen
- blind_player(victim);
- }
- }
- stock create_EarthQuake(index){
- message_begin(MSG_ONE,get_user_msgid("ScreenShake"),{0,0,0},index);
- write_short(255<<14); //ammount
- write_short(10<<14); //lasts this long
- write_short(255<<14); //frequency
- message_end();
- }
- stock blind_player(index){
- message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},index);
- write_short(1<<15);
- write_short(1<<10);
- write_short(1<<12);
- write_byte(255); // Red
- write_byte(255); // Green
- write_byte(255); // Blue
- write_byte(255); // Alpha
- message_end();
- }
- stock fm_get_user_team(index)
- return get_pdata_int(index,114);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement