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

[CS:GO] How to make a dropped kit (item_defuser) glow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 08-23-2016 , 11:39   [CS:GO] How to make a dropped kit (item_defuser) glow
Reply With Quote #1

Hey, to help CT's from locating defuse kits I'm trying to make them glow, However none of the things I've tried seem to work

PHP Code:
public void OnEntityCreated(int entity, const char[] classname

    if (
StrEqual(classname"item_defuser")) 
    { 
        
SetEntProp(entityProp_Send"m_bShouldGlow"truetrue);
        
SetEntProp(entityProp_Send"m_nGlowStyle"0);
        
SetEntPropFloat(entityProp_Send"m_flGlowMaxDist",100.0);
    } 

Anyone an idea how to make this weapon glow ?

Thanks.

Cow.
__________________
ImACow is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 08-23-2016 , 13:25   Re: [CS:GO] How to make a dropped kit (item_defuser) glow
Reply With Quote #2

try this

PHP Code:
    int kitGlow CreateEntityByName("prop_dynamic_glow");
    
DispatchKeyValue(kitGlow"model""models/weapons/w_defuser.mdl");
    
DispatchKeyValue(kitGlow"disablereceiveshadows""1");
    
DispatchKeyValue(kitGlow"disableshadows""1");
    
DispatchKeyValue(kitGlow"solid""0");
    
DispatchKeyValue(kitGlow"spawnflags""256");
    
SetEntProp(kitGlowProp_Send"m_CollisionGroup"11);
    
DispatchSpawn(kitGlow);
    
TeleportEntity(kitGlowfPos/* POSITION !*/fAngleNULL_VECTOR);
    
SetEntProp(kitGlowProp_Send"m_bShouldGlow"truetrue);
    
SetEntPropFloat(kitGlowProp_Send"m_flGlowMaxDist"15000000.0);
    
colors[0] = 0;
    
colors[1] = 0;
    
colors[2] = 255;
    
colors[3] = 255;
    
SetVariantColor(colors);
    
AcceptEntityInput(kitGlow"SetGlowColor");
    
SetEntPropFloat(kitGlowProp_Send"m_flModelScale"1.0);
    
SetVariantString("!activator");
    
AcceptEntityInput(kitGlow"SetParent"entity /* YOUR DROPPED KIT */); 
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...

Last edited by Totenfluch; 08-23-2016 at 21:25.
Totenfluch is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 08-23-2016 , 16:08   Re: [CS:GO] How to make a dropped kit (item_defuser) glow
Reply With Quote #3

Nothing shows up, but an entity is spawned... hmm ?
__________________
ImACow is offline
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Old 08-23-2016 , 21:47   Re: [CS:GO] How to make a dropped kit (item_defuser) glow
Reply With Quote #4

My best try - the defuser model doesn't seem to be working :/
I used another one if you just want the visibility



PHP Code:
#pragma semicolon 1

#define PLUGIN_AUTHOR "Totenfluch"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo 
{
    
name "defuserGlow"
    
author PLUGIN_AUTHOR
    
description "make it glow"
    
version PLUGIN_VERSION
    
url "http://ggc-base.de"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_def"cmdDef);
}

public 
Action cmdDef(int clientint args) {
    
GivePlayerItem(client"item_defuser");
    return 
Plugin_Handled;
}

public 
void OnEntityCreated(int entity, const char[] classname)
{
    if (
StrEqual(classname"item_defuser")) {
        
CreateTimer(0.0makeGlowCbEntIndexToEntRef(entity));
    }
}

public 
Action makeGlowCb(Handle Timerint entityEx) {
    
int entity EntRefToEntIndex(entityEx);
    
float fPos[3];
    
GetEntPropVector(entityProp_Send"m_vecOrigin"fPos);
    
float fAngles[3];
    
GetEntPropVector(entityProp_Send"m_angRotation"fAngles);
    
int kitGlow CreateEntityByName("prop_dynamic_glow");
    
DispatchKeyValue(kitGlow"model""models/props_docks/cleat_small_01.mdl");
    
DispatchKeyValue(kitGlow"disablereceiveshadows""1");
    
DispatchKeyValue(kitGlow"disableshadows""1");
    
DispatchKeyValue(kitGlow"solid""0");
    
DispatchKeyValue(kitGlow"spawnflags""256");
    
SetEntProp(kitGlowProp_Send"m_CollisionGroup"11);
    
DispatchSpawn(kitGlow);
    
SetEntPropFloat(kitGlowProp_Send"m_flModelScale"2.0);
    
TeleportEntity(kitGlowfPosfAnglesNULL_VECTOR);
    
SetEntProp(kitGlowProp_Send"m_bShouldGlow"truetrue);
    
SetEntPropFloat(kitGlowProp_Send"m_flGlowMaxDist"15000000.0);
    
SetGlowColor(kitGlow"0 255 0");
    
AcceptEntityInput(kitGlow"SetGlowColor");
    
SetEntPropFloat(kitGlowProp_Send"m_flModelScale"1.0);
    
SetVariantString("!activator");
    
AcceptEntityInput(kitGlow"SetParent"entity);


stock void SetGlowColor(int entity, const char[] color)
{
    
char colorbuffers[3][4];
    
ExplodeString(color" "colorbufferssizeof(colorbuffers), sizeof(colorbuffers[]));
    
int colors[4];
    for (
int i 03i++)
    
colors[i] = StringToInt(colorbuffers[i]);
    
colors[3] = 255;
    
SetVariantColor(colors);
    
AcceptEntityInput(entity"SetGlowColor");

Base code
__________________
Notable Projects:
Event Item Spawner | Scissors, Rock, Paper for ZephStore
tVip | Smart Link Remover
PLG & GGC - CS:GO Roleplay

and countless more...

I can make a helicopter shoot missles if you want me to...

Last edited by Totenfluch; 08-23-2016 at 21:58.
Totenfluch 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:56.


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