Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Entity disappearing?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-18-2018 , 20:52   [ H3LP ] Entity disappearing?
Reply With Quote #1

Hello, I did a "laser spot" like of RPG of Half-Life 1. I'm not sure why, but the entity disappear depending of the location that I walk around in the map. In some maps the laser nor appear. The laser is being updated in weapon idle.

Code:
CLaserSpot_Create() {     new pevLaserSpot = rg_create_entity("env_sprite");     set_entvar(pevLaserSpot, var_movetype, MOVETYPE_NONE);     set_entvar(pevLaserSpot, var_solid, SOLID_NOT);     set_entvar(pevLaserSpot, var_rendermode, kRenderGlow);     set_entvar(pevLaserSpot, var_renderfx, kRenderFxNoDissipation);     set_entvar(pevLaserSpot, var_renderamt, 255.0);     entity_set_model(pevLaserSpot, g_szLaserDotModel);     entity_set_size(pevLaserSpot, Float:{ 0.0, 0.0, 0.0 }, Float:{ 0.0, 0.0, 0.0 });     set_entvar(pevLaserSpot, var_classname, g_pszNameLaserSpot);     //set_entvar(pevLaserSpot, var_owner, this);     return pevLaserSpot; }

Code:
CRpg_UpdateSpot(this) {     if (is_nullent(g_pevLaserSpot[this]))         return;     static Float:vecSrc[3], Float:vecVelocity[3], Float:vecAiming[3], Float:vecEndPos[3];         ExecuteHamB(Ham_Player_GetGunPosition, this, vecSrc);     velocity_by_aim(this, 8192, vecVelocity);     xs_vec_add(vecSrc, vecVelocity, vecAiming);     engfunc(EngFunc_TraceLine, vecSrc, vecAiming, DONT_IGNORE_MONSTERS, this, 0);     get_tr2(0, TR_vecEndPos, vecEndPos);     //client_print(0, print_chat, "TR_pHit(%d)", get_tr2(0, TR_pHit))     //get_pmtrace(tr, pmt_endpos, vecEndPos);     /*message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, .player = this)     {         write_byte(TE_BEAMPOINTS);         write_coord_f(vecSrc[0]);         write_coord_f(vecSrc[1]);         write_coord_f(vecSrc[2]);         write_coord_f(vecEndPos[0]);         write_coord_f(vecEndPos[1]);         write_coord_f(vecEndPos[2]);         write_short(g_sModelIndexSmokeTrail)         write_byte(0)         write_byte(0)         write_byte(1)         write_byte(15)         write_byte(0)         write_byte(0)         write_byte(0)         write_byte(255)         write_byte(255)         write_byte(0)     }     message_end();*/     set_entvar(g_pevLaserSpot[this], var_origin, vecEndPos); }
__________________









Last edited by CrazY.; 07-19-2018 at 09:58.
CrazY. 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 12:22.


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