Raised This Month: $ Target: $400
 0% 

Help with my Anti Team Flash Script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 08-31-2008 , 21:52   Help with my Anti Team Flash Script
Reply With Quote #1

I was wondering if someone could help me out with this script, all it does it remove the ability to team flash admins in the server.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>


#define PLUGIN "No Admin Flash"
#define VERSION "1.0"
#define AUTHOR "Grim" /* credit to KRoT@L */

#define GOT_ACCES ADMIN_LEVEL_B

new g_msgScreenFadegrenade[32], last;
new 
Float:g_gametimeg_owner;
new 
g_sync_check_data 0;
new 
Float:g_gametime2;
new 
bool:g_track[33] = false;
new 
bool:g_track_enemy false;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("ScreenFade""eventFlash""be""4=255""5=255""6=255""7>199")
    
register_event("TextMsg""fire_in_the_hole""b""2&#Game_radio""4&#Fire_in_the_hole")
    
register_event("TextMsg""fire_in_the_hole2""b""3&#Game_radio""5&#Fire_in_the_hole")
    
register_event("99""grenade_throw""b")
}

/// NoFlash Blinding - Start
public bad_fix2()
{
    new 
Float:gametime get_gametime()
    if(
gametime g_gametime2 2.5)
    {
        for(new 
032i++)
        {
            
grenade[i] = 
        
}
    }
}

public 
eventFlash(id)  
{
  new 
Float:gametime get_gametime()
  if(
gametime != g_gametime)
  { 
    
g_owner get_grenade_owner()
    
g_gametime gametime  
    
for(new 033i++) 
    {
        
g_track[i] = false
    
}
    
g_track_enemy false
  
}    
  if(
is_user_connected(g_owner) && get_user_flags(id) & GOT_ACCES)
  {
          
g_track_enemy true

          message_begin
(MSG_ONEg_msgScreenFade, {0,0,0}, id)
          
write_short(1)
          
write_short(1)
          
write_short(1)
          
write_byte(0)
          
write_byte(0)
          
write_byte(0)
          
write_byte(255)
          
message_end()
  }
}

public 
flash_delay()
{
if(
g_track_enemy == false
    for(new 
033i++) 
        if(
g_track[i] == true && is_user_connected(i))
        {
          
message_begin(MSG_ONEg_msgScreenFade, {0,0,0}, i
          
write_short(1)
          
write_short(1)
          
write_short(1)
          
write_byte(0)
          
write_byte(0)
          
write_byte(0)
          
write_byte(255
          
message_end()
        }
}

public 
grenade_throw() 
{
    if(
g_sync_check_data == 0)
        return 
PLUGIN_CONTINUE
    g_sync_check_data
--;
    if(
read_datanum() < 2)
    return 
PLUGIN_HANDLED_MAIN

    
if(read_data(1) == 11 && (read_data(2) == || read_data(2) == 1))
    { 
        
add_grenade_owner(last)
    }

    return 
PLUGIN_CONTINUE 
}

public 
fire_in_the_hole()
{
    new 
name[32]
    
read_data(3name31
    new 
temp_last get_user_index(name
    new 
junk
    
if((temp_last == 0) || (!is_user_connected(temp_last)))
        return 
PLUGIN_CONTINUE;
    if(
get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG
    {
        
last temp_last
        g_sync_check_data 
2
    }
    return 
PLUGIN_CONTINUE  
}

public 
fire_in_the_hole2() 
{
    new 
name[32]
    
read_data(4name31)
    new 
temp_last get_user_index(name)   
    new 
junk
    
if((temp_last == 0) || (!is_user_connected(temp_last)))
        return 
PLUGIN_CONTINUE
    if(
get_user_weapon(temp_last,junk,junk) == CSW_FLASHBANG
    {    
        
last temp_last
        g_sync_check_data 
2;
    }
    return 
PLUGIN_CONTINUE
}

add_grenade_owner(owner)
{
    new 
Float:gametime get_gametime()
    
g_gametime2 gametime
    
for(new 032i++)
    {
        if(
grenade[i] == 0)
    {
            
grenade[i] = owner
            
return
        }
    }
}

get_grenade_owner()
{
    new 
which grenade[0]
    for(new 
132i++)  
    {
        
grenade[i-1] = grenade[i
    }
    
grenade[31] = 0
    
return which
}

//from XxAvalanchexX "Flashbang Dynamic Light"
public fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)  
{
    
// not a flashbang exploding
    
if(!equali(sample,"weapons/flashbang-1.wav") && !equali(sample,"weapons/flashbang-2.wav"))
        return 
FMRES_IGNORED;

    new 
Float:gametime get_gametime()

    
//in case no one got flashed, the sound happens after all the flashes, same game time
    
if(gametime != g_gametime)
    {
        
g_owner get_grenade_owner()
        return 
FMRES_IGNORED;
    }

    return 
FMRES_IGNORED;

__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.

Last edited by Kitami; 08-31-2008 at 21:58.
Kitami is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode