Raised This Month: $ Target: $400
 0% 

[CS:GO] TE_SetupGlowSprite attach to player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-03-2012 , 15:06   [CS:GO] TE_SetupGlowSprite attach to player
Reply With Quote #1

I try to make TE_SetupGlowSprite work on csgo, but with no lock.

Code:
SetPlayerWinnerEffectWinner(client) {
    // shine    
    // TODO: maybe repeate each 0.1 seconds or attach effect to player
    new Float:vec[3];
    GetClientAbsOrigin(client, vec);
    vec[2] += 10;

    //TE_SetupGlowSprite(vec, g_GlowSprite, 0.95, 1.5, 50);
    TE_SetupGlowSprite(vec, g_GlowSprite, 10.0, 1.5, 50);
    TE_SendToAll();
}

OnMapStartEffects() {
    g_GlowSprite = PrecacheModel("materials/sprites/blueflare1.vmt");
}
No errors, glow does not appeares. Please help.
__________________

Last edited by altex; 10-05-2012 at 03:16.
altex is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-03-2012 , 15:16   Re: [CS:GO] TE_SetupGlowSprite
Reply With Quote #2

oops
it works
__________________

Last edited by altex; 10-03-2012 at 15:17.
altex is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-03-2012 , 15:18   Re: [RESOLVED] [CS:GO] TE_SetupGlowSprite
Reply With Quote #3

anybody knows how to attach such a glow to client entity?
__________________

Last edited by altex; 10-05-2012 at 03:15.
altex is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-05-2012 , 03:11   Re: [RESOLVED] [CS:GO] TE_SetupGlowSprite
Reply With Quote #4

Quote:
Originally Posted by altex View Post
anybody knows how to attack such a glow to client entify?
you mean you want to make " Attack " by Glow?

It is possible but can't attack by Glow that made by TE_SetupGlowSprite()

if you want, you should make glow effects by "env_glow" and attaches it on small, invisible entity.

and you can throw the entity if you want. and you can check if that entity was blocked by someone.

then, you can damage him.
__________________
Starbish is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-05-2012 , 03:14   Re: [RESOLVED] [CS:GO] TE_SetupGlowSprite
Reply With Quote #5

Quote:
Originally Posted by Starbish View Post
you mean you want to make " Attack " by Glow?

It is possible but can't attack by Glow that made by TE_SetupGlowSprite()

if you want, you should make glow effects by "env_glow" and attaches it on small, invisible entity.

and you can throw the entity if you want. and you can check if that entity was blocked by someone.

then, you can damage him.
i'm sorry for misspelling - i mean "attach" not "attack"
I want make player shine with a glow light entity and make it moving along with player
TE_SetupGlowSprite is not following a player, it just stay in one point of the map
__________________
altex is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-05-2012 , 04:17   Re: [RESOLVED] [CS:GO] TE_SetupGlowSprite
Reply With Quote #6

Quote:
Originally Posted by altex View Post
i'm sorry for misspelling - i mean "attach" not "attack"
I want make player shine with a glow light entity and make it moving along with player
TE_SetupGlowSprite is not following a player, it just stay in one point of the map
Yeah, so you can make " env_glow " and attach to someone.

its example is very common.

here is the example.

SE_CreateLight(client)
{
if(g_bEffectItemSettings[client][DB_ISPECIES_LIGHT])
{
new Float:clientposition[3];
GetClientAbsOrigin(client, clientposition);
clientposition[2] += 30.0;

g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT] = CreateEntityByName("env_glow");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "model", Item_Code[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]]);
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "rendermode", "3");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "renderfx", "14");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "scale", "1.0");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "renderamt", "255");
Format(g_sFormatting, sizeof(g_sFormatting), "%d %d %d %d", Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][0], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][1], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][2], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][3]);
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "rendercolor", g_sFormatting);
DispatchSpawn(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT]);
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "ShowSprite");
TeleportEntity(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], clientposition, NULL_VECTOR, NULL_VECTOR);


new String:steamid[21];
GetClientAuthString(client, steamid, 21);
DispatchKeyValue(client, "targetname", steamid);
SetVariantString(steamid);
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "SetParent");
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "TurnOn");
}
}

It creates the light on client's body.

you can apply to something fit on you.
__________________
Starbish is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-05-2012 , 05:09   Re: [RESOLVED] [CS:GO] TE_SetupGlowSprite
Reply With Quote #7

Quote:
Originally Posted by Starbish View Post
Yeah, so you can make " env_glow " and attach to someone.

its example is very common.

here is the example.

SE_CreateLight(client)
{
if(g_bEffectItemSettings[client][DB_ISPECIES_LIGHT])
{
new Float:clientposition[3];
GetClientAbsOrigin(client, clientposition);
clientposition[2] += 30.0;

g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT] = CreateEntityByName("env_glow");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "model", Item_Code[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]]);
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "rendermode", "3");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "renderfx", "14");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "scale", "1.0");
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "renderamt", "255");
Format(g_sFormatting, sizeof(g_sFormatting), "%d %d %d %d", Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][0], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][1], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][2], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][3]);
DispatchKeyValue(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "rendercolor", g_sFormatting);
DispatchSpawn(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT]);
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "ShowSprite");
TeleportEntity(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], clientposition, NULL_VECTOR, NULL_VECTOR);


new String:steamid[21];
GetClientAuthString(client, steamid, 21);
DispatchKeyValue(client, "targetname", steamid);
SetVariantString(steamid);
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "SetParent");
AcceptEntityInput(g_iEffectItemEntityIndex[client][DB_ISPECIES_LIGHT], "TurnOn");
}
}

It creates the light on client's body.

you can apply to something fit on you.
Thank you!
__________________
altex is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-05-2012 , 16:19   Re: [CS:GO] TE_SetupGlowSprite attach to player
Reply With Quote #8

i use this code
Code:
public OnMapStart() {
    g_GlowSprite = PrecacheModel("sprites/ledglow.vmt");
}

SetPlayerWinnerEffectWinnerRepeate(client) {
    CreateTimer(0.1, Timer_SetPlayerWinnerEffectWinner, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}

public Action:Timer_SetPlayerWinnerEffectWinner(Handle:timer, any:data) {
    if (!IsClientInGame(data)||!IsPlayerAlive(data)) {
        return Plugin_Stop;
    }
    SetPlayerWinnerEffectWinnerReal(data);
    return Plugin_Continue;
}

SetPlayerWinnerEffectWinnerReal(client) {
    // shine    
    new Float:vec[3];
    GetClientAbsOrigin(client, vec);
    vec[2] += 40;

    TE_SetupGlowSprite(vec, g_GlowSprite, 0.5, 4.0, 70);
    TE_SendToAll();
}
it works fine, but i do not like timer in this case

i was trying to do like the following
Code:
stock CreateLight(client) {
    new Float:clientposition[3];
    GetClientAbsOrigin(client, clientposition);
    clientposition[2] += 40.0;

    new GLOW_ENTITY = CreateEntityByName("env_glow");

    SetEntProp(GLOW_ENTITY, Prop_Data, "m_nBrightness", 70, 4);

    DispatchKeyValue(GLOW_ENTITY, "model", "sprites/ledglow.vmt");

    DispatchKeyValue(GLOW_ENTITY, "rendermode", "3");
    DispatchKeyValue(GLOW_ENTITY, "renderfx", "14");
    DispatchKeyValue(GLOW_ENTITY, "scale", "4.0");
    DispatchKeyValue(GLOW_ENTITY, "renderamt", "255");
    DispatchKeyValue(GLOW_ENTITY, "rendercolor", "255 255 255 255");
    DispatchSpawn(GLOW_ENTITY);
    AcceptEntityInput(GLOW_ENTITY, "ShowSprite");
    TeleportEntity(GLOW_ENTITY, clientposition, NULL_VECTOR, NULL_VECTOR);

    new String:target[20];
    FormatEx(target, sizeof(target), "glowclient_%d", client);
    DispatchKeyValue(client, "targetname", target);
    SetVariantString(target);
    AcceptEntityInput(GLOW_ENTITY, "SetParent");
    AcceptEntityInput(GLOW_ENTITY, "TurnOn");
}
but the glowing is disapearing too fast, it changes brightness too quickly - in 5 seconds it just disapearing
__________________

Last edited by altex; 10-05-2012 at 16:21.
altex is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-06-2012 , 08:11   Re: [CS:GO] TE_SetupGlowSprite attach to player
Reply With Quote #9

I think there's no problem in your codes except some guessing..

Think what is different with my codes,

but i couldn't find any changing except "m_nBrightness" and some NOT RELATED names.

I think the disappearing causes m_nBrightness... i cant think the other reasons when i see your codes...

Disable and test your codes again.

I think that's the problem.

(and thank you for making a paintball plugins. it was applied to many korean servers)
__________________

Last edited by Starbish; 10-06-2012 at 08:12.
Starbish is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 10-06-2012 , 08:42   Re: [CS:GO] TE_SetupGlowSprite attach to player
Reply With Quote #10

Quote:
Originally Posted by Starbish View Post
I think there's no problem in your codes except some guessing..
Think what is different with my codes,

but i couldn't find any changing except "m_nBrightness" and some NOT RELATED names.

I think the disappearing causes m_nBrightness... i cant think the other reasons when i see your codes...

Disable and test your codes again.

I think that's the problem.
That code with m_nBrightness i was added after i noticed glow disapearing, actualy that was the first attempt to fix the issue but with no luck. So removing my code and leaving just your original code does not help

Maybe the issue is in concrete models/sprites? What exactly options do you use in your plugin
for

Format(g_sFormatting, sizeof(g_sFormatting), "%d %d %d %d", Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][0], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][1], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][2], Item_Colors[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]][3]);

and

Item_Code[g_iEffectItemIndex[client][DB_ISPECIES_LIGHT]]

?

Quote:
Originally Posted by Starbish View Post

(and thank you for making a paintball plugins. it was applied to many korean servers)
Thank you very much. I like this plugin very much too Share your textures/decals if you have your own, i can add it to color pack
__________________
altex 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 17:05.


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