Raised This Month: $ Target: $400
 0% 

[ H3LP ] Laser sight mistake?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-30-2017 , 16:19   [ H3LP ] Laser sight mistake?
Reply With Quote #1

Hello, I've done a laser sight, it's working but with some problems. As the item_PostFrame is called many times per second, they are appearing 4 lasers instead of just one. Any suggestions?

Code:
public fw_Item_PostFrame(entity) {     if (!is_valid_ent(entity))         return HAM_IGNORED;     static id     id = get_pdata_cbase(entity, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS)     if (!is_user_alive(id))         return HAM_IGNORED;     if (!GetPlayerBit(g_has_plasma_caster, id))         return HAM_IGNORED;     static Float:victim_origin[3], victim     victim = get_aim_ent(id, victim_origin)     static Float:origin[3]     GetGunPosition(id, 3.0, -9.0, 0.0, origin)     static end[3]     if (victim)         FVecIVec(victim_origin, end)     else         get_user_origin(id, end, 3)     message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)     write_byte(TE_BEAMPOINTS)     write_coord(floatround(origin[0]))     write_coord(floatround(origin[1]))     write_coord(floatround(origin[2]))     write_coord(end[0])     write_coord(end[1])     write_coord(end[2])     write_short(sprite_laser)     write_byte(0)     write_byte(10)     write_byte(1)     write_byte(5)     write_byte(0)     write_byte(200)     write_byte(0)     write_byte(0)     write_byte(200)     write_byte(10)     message_end()     return HAM_IGNORED; }
__________________









Last edited by CrazY.; 07-30-2017 at 16:48.
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 23:09.


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