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

Solved [CS:GO] Grenade Trail


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FuZ!on
Senior Member
Join Date: Aug 2007
Old 10-11-2019 , 22:10   [CS:GO] Grenade Trail
Reply With Quote #1

Hi,

Trying to add grenade trails. I've taken some of this code from other grenade trail plugins however I can't seem to get it to work within my own code.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

new g_iBeamSprite;

new 
GrenadeTrailColor[] = {012800};

public 
OnMapStart()
{
    
g_iBeamSprite PrecacheModel("materials/sprites/laserbeam.vmt");
}

public 
void OnEntityCreated(int entity, const char[] classname)
{
    
PrintToChatAll("DEBUG: entity created");
    
    if(
StrContains(classname"hegrenade") != -&& IsValidEntity(entity))
    {
        
PrintToChatAll("DEBUG: hegrenade identified");
        
TE_SetupBeamFollow(entityg_iBeamSprite020.010.010.02GrenadeTrailColor);
        
TE_SendToAll();
    }

I've put two PrintToChatAll() messages in there to make sure that the OnEntityCreated is firing when a grenade is thrown and making sure it's a hegrenade.

Last edited by FuZ!on; 10-12-2019 at 11:57.
FuZ!on is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 10-12-2019 , 00:21   Re: [CS:GO] Grenade Trail
Reply With Quote #2

Does the debug message get printed?
__________________
8guawong is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 10-12-2019 , 03:37   Re: [CS:GO] Grenade Trail
Reply With Quote #3

Trail color alpha is 0
Indarello is offline
FuZ!on
Senior Member
Join Date: Aug 2007
Old 10-12-2019 , 11:56   Re: [CS:GO] Grenade Trail
Reply With Quote #4

Quote:
Originally Posted by Indarello View Post
Trail color alpha is 0
This is it. A simple mistake for not realizing that the alpha number stood for transparency.
FuZ!on is offline
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 19:29.


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