Raised This Month: $51 Target: $400
 12% 

Plugin grenade trail! Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 04-03-2017 , 11:23   Plugin grenade trail! Help
Reply With Quote #1

Hello, I would like to know if this plugin or something that has the same effect exists! That is to say, I am talking about the grenade trail, but what I would like to know would be, so that when you throw the grenade, flash, or smoke, only the player who sent the grenade would see the trail, so as not to create great confusion when Send the grenades
FreezerPT is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 04-05-2017 , 04:50   Plugin grenade trail! Help
Reply With Quote #2

Hello, I would like to know if this plugin or something that has the same effect exists! That is to say, I am talking about the grenade trail, but what I would like to know would be, so that when you throw the grenade, flash, or smoke, only the player who sent the grenade would see the trail, so as not to create great confusion when Send the grenades
FreezerPT is offline
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 04-05-2017 , 23:22   Re: Plugin grenade trail! Help
Reply With Quote #3

PHP Code:
/*
    Grenade Trail 1.0
    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 <csx>

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

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")
}

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

public 
grenade_throw(id)
{
    new 
gtm get_pcvar_num(g_cvar_tr)
    if(!
gtm) return
    new 
rgb
    
switch(gtm)
    {
        case 
1:
        {
            
random(256)
            
random(256)
            
random(256)
        }
        case 
2:
        {
            new 
nadecolor[10]
            switch(
id)
            {
                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)
            new 
str_to_num(color)
            
1000000
            c 
%= 1000000 
            g 
1000
            b 
1000
        
}
        case 
3:
        {
            switch(
get_user_team(id))
            {
                case 
1255
                
case 2255
            
}
        }
    }
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW)
    
write_short(id)
    
write_short(g_trail)
    
write_byte(10)
    
write_byte(5)
    
write_byte(r)
    
write_byte(g)
    
write_byte(b)
    
write_byte(192)
    
message_end()

try this X)) idk if its will work
__________________
Invisible System | 100%
ـــــــــــــــــــــــــــــ
Anti setinfo check | Ez Plugin and lite
ـــــــــــــــــــــــــــــ
[ZP] Free VIP Menu | Free VIP menu | ZP-Mod |
Dr Zayd is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-06-2017 , 05:39   Re: Plugin grenade trail! Help
Reply With Quote #4

Quote:
Originally Posted by Dr Zayd View Post
PHP Code:
/*
    Grenade Trail 1.0
    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 <csx>

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

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")
}

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

public 
grenade_throw(id)
{
    new 
gtm get_pcvar_num(g_cvar_tr)
    if(!
gtm) return
    new 
rgb
    
switch(gtm)
    {
        case 
1:
        {
            
random(256)
            
random(256)
            
random(256)
        }
        case 
2:
        {
            new 
nadecolor[10]
            switch(
id)
            {
                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)
            new 
str_to_num(color)
            
1000000
            c 
%= 1000000 
            g 
1000
            b 
1000
        
}
        case 
3:
        {
            switch(
get_user_team(id))
            {
                case 
1255
                
case 2255
            
}
        }
    }
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW)
    
write_short(id)
    
write_short(g_trail)
    
write_byte(10)
    
write_byte(5)
    
write_byte(r)
    
write_byte(g)
    
write_byte(b)
    
write_byte(192)
    
message_end()

try this X)) idk if its will work
MSG_BROADCAST will send it to everyone.
__________________
edon1337 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-06-2017 , 06:20   Re: Plugin grenade trail! Help
Reply With Quote #5

Use MSG_ONE_UNRELIABLE with the index of the grenade's owner
__________________
Depresie is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-06-2017 , 06:50   Re: Plugin grenade trail! Help
Reply With Quote #6

The code above will add a trail to the player, not the grenade + won't work due to using switch(id).

PHP Code:
/*
    Grenade Trail 1.0
    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 <csx>

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

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")
}

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

public 
grenade_throw(idiGrenadeiWeapon)
{
    new 
gtm get_pcvar_num(g_cvar_tr)
    if(!
gtm) return
    new 
rgb
    
switch(gtm)
    {
        case 
1:
        {
            
random(256)
            
random(256)
            
random(256)
        }
        case 
2:
        {
            new 
nadecolor[10]
            switch(
iWeapon)
            {
                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)
            new 
str_to_num(color)
            
1000000
            c 
%= 1000000 
            g 
1000
            b 
1000
        
}
        case 
3:
        {
            switch(
get_user_team(id))
            {
                case 
1255
                
case 2255
            
}
        }
    }
    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_id)
    
write_byte(TE_BEAMFOLLOW)
    
write_short(iGrenade)
    
write_short(g_trail)
    
write_byte(10)
    
write_byte(5)
    
write_byte(r)
    
write_byte(g)
    
write_byte(b)
    
write_byte(192)
    
message_end()

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



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 20:56.


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