Raised This Month: $ Target: $400
 0% 

Solved Trail Grenades For VIPs Only


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 08-18-2023 , 21:46   Re: Trail Grenades For VIPs Only
Reply With Quote #4

C and H tested.

PHP Code:
/*
    Grenade Trail 1.1
    Author: Jim

    Cvars:
    grenade_tr: default 2
    0 - None
    1 - Random Colors
    2 - Nade Specific
    3 - Team Specific

    grenade_he "255000000" set the trail color of Hegrenade
    grenade_fb "000000255" set the trail color of Flashbang
    grenade_sg "000255000" set the trail color of Smokegrenade
*/

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

#define PLUGIN "Grenade Trail"
#define VERSION "1.1"
#define AUTHOR "Jim"

#define TRAIL_LEVEL1 ADMIN_LEVEL_C
#define TRAIL_LEVEL2 ADMIN_LEVEL_H
#define MAX_PLAYERS 32

new bool:bIsAdminMAX_PLAYERS 1]
new 
g_cvar_tr
new g_cvar_he
new g_cvar_fb
new g_cvar_sg
new g_trail

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_cvar_tr register_cvar("grenade_tr""2")
    
g_cvar_he register_cvar("grenade_he""255000000")
    
g_cvar_fb register_cvar("grenade_fb""000000255")
    
g_cvar_sg register_cvar("grenade_sg""000255000")
    if(!
cstrike_running())
    {
        
pause("c")
        
log_amx"Incompatible mod."
    
}
}

public 
client_infochanged(id)
{
    if(
is_user_connected(id))
    {
        
bIsAdmin[id] = get_user_flags(id) & TRAIL_LEVEL1 TRAIL_LEVEL2 true false
    
}
}

public 
plugin_precache()
{
    
g_trail precache_model("sprites/smoke.spr")
}

stock iRainbow()return random(256)

public 
grenade_throw(idgidwid)
{
    static 
gtmgtm get_pcvar_num(g_cvar_tr)
    if(!
gtm) return

    if(
is_user_connected(id) && bIsAdmin[id])
    {
        static 
rgb
        
switch(gtm)
        {
            case 
1:
            {
                
iRainbow()
                
iRainbow()
                
iRainbow()
            }
            case 
2:
            {
                static 
nadecolor[10]
                switch(
wid)
                {    
                    case 
CSW_HEGRENADE:    nade g_cvar_he
                    
case CSW_FLASHBANG:    nade g_cvar_fb
                    
case CSW_SMOKEGRENADE:    nade g_cvar_sg
                
}
                
get_pcvar_string(nadecolor9)
                static 
cstr_to_num(color)
                
1000000
                c 
%= 1000000 
                g 
1000
                b 
1000
            
}
            case 
3:
            {
                static 
iTeam;iTeam get_user_team(id)
                switch(
iTeam)
                {
                    case 
1255
                    
case 2255
                
}
            }
        }
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW)
        
write_short(gid)
        
write_short(g_trail)
        
write_byte(10)
        
write_byte(5)
        
write_byte(r)
        
write_byte(g)
        
write_byte(b)
        
write_byte(192)
        
message_end()
    }

DJEarthQuake 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 07:44.


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