Raised This Month: $ Target: $400
 0% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 13:14.


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