Raised This Month: $535 Target: $400
 133% 

Change this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pe4enko
New Member
Join Date: Nov 2020
Old 03-08-2021 , 13:37   Change this plugin
Reply With Quote #1

please somebody remake this plugin for flashbang grenade.

PHP Code:
/* 
   Lighting Smoke Nades    
 Version : 0.1
 Author : SAMURAI

 
    * Plugin Details:
 On smoke grenade impact, nades are lighting with some colors.
 
    * Cvars:
- lighting_skn - Enable/Disable plugin (default 1)
0 = Disabled
1 = Enabled with random colors    
2 = Enabled with RGB format colors

- lighting_skn_r : Red (default 255)
- lighting_skn_g : Green (default 0)
- lighting_skn_b : Blue (default 0)

- lighting_skn_trails Enable/Disable Smoke Grenade Trails
0 = Disabled
1 = Enable
  Trail color are "Green"
  
   * Required Modules
- Fakemeta
- Csx


   * Credits:
 - NastyZK for ideia
 
 
Have a nice day now
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <csx>

#define PLUGIN "Lighting Smoke Nades"
#define VERSION "0.1"
#define AUTHOR "SAMURAI"

new pnumCvar;
new 
pnumColorRpnumColorGpnumColorB;
new 
pnumTrail;

new 
trail;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_EmitSound,"sound_emit");
    
pnumCvar register_cvar("lighting_skn","1");
    
pnumColorR register_cvar("lighting_skn_r","62");
    
pnumColorG register_cvar("lighting_skn_g","0");
    
pnumColorB register_cvar("lighting_skn_b","148");
    
pnumTrail register_cvar("lighting_skn_trails","1");
}

public 
sound_emit(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)
{
    if(
get_pcvar_num(pnumCvar) == 0)
    return 
FMRES_IGNORED;
    
        
    if( ! 
equali(sample,"weapons/sg_explode.wav") )
        return 
FMRES_IGNORED;

    
smoke_effects(entity)

    return 
FMRES_IGNORED;
}

public 
smoke_effects(index)
{
    if( ! 
pev_validindex)) 
    return 
PLUGIN_CONTINUE;
    
    new 
pcvar get_pcvar_num(pnumCvar)
    
    if(!
pcvar)
    return 
PLUGIN_HANDLED;
    
    new 
iR,iGiB
    
    
switch(pcvar)
    {
        case 
1:
        {
            
            
iR random(256)
            
iG random(256)
            
iB random(256)
        }
        
        case 
2:
        {
            
iR get_pcvar_num(pnumColorR)
            
iG get_pcvar_num(pnumColorG)
            
iB get_pcvar_num(pnumColorB)
                        
        }
    }
            
    
    new 
Float:origin[3];
    
pev(index,pev_origin,origin);
        
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
    
write_byte(TE_DLIGHT);
    
    
write_coord(floatround(origin[0])); 
    
write_coord(floatround(origin[1])); 
    
write_coord(floatround(origin[2])); 
    
    
write_byte(60); //rad 
    
    
write_byte(iR);
    
write_byte(iG);
    
write_byte(iB);
    
    
write_byte(8);
    
write_byte(60);
    
message_end();
    
    return 
PLUGIN_HANDLED;
}
    
public 
grenade_throw(id,gid,wid)
{
    if(
get_pcvar_num(pnumCvar) == 0)
    return 
PLUGIN_CONTINUE;
    
    if(!
get_pcvar_num(pnumTrail))
    return 
PLUGIN_CONTINUE;
    
    if(!
is_user_connected(id))
    return 
PLUGIN_CONTINUE;
    
        
    if(
wid == CSW_SMOKEGRENADE)
    {
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
write_byte(TE_BEAMFOLLOW)
            
write_short(gid)
            
write_short(trail)
            
write_byte(10)
            
write_byte(5)
            
write_byte(0)
            
write_byte(255)
            
write_byte(0)
            
write_byte(192)
            
message_end()
    }
    
    return 
PLUGIN_CONTINUE;
}
            
public 
plugin_precache()
{
    
trail precache_model("sprites/smoke.spr")

pe4enko is offline
Reply


Thread Tools
Display Modes

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 06:46.


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