Raised This Month: $ Target: $400
 0% 

[REQ] Detect no kill and punish ( Players which is not killing the enemies)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-24-2018 , 03:59   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #1

PHP Code:
bool:IsInLineOfSightent1 ent2 

    new 
iTrace Float:fFractionFloat:fOrigin1[3], Float:fOrigin2[3], Float:fViewOfs[3]; 
    
pev(ent1pev_v_ofsfViewOfs);
    
pev(ent1pev_originfOrigin1)
    
fOrigin1 += fViewOfs;
    
pev(ent2pev_v_ofsfViewOfs);
    
pev(ent2pev_originfOrigin2)
    
fOrigin2 += fViewOfs;
    
engfuncEngFunc_TraceLine fOrigin1 fOrigin2 IGNORE_MONSTERS iTrace ); 
    
get_tr2iTrace TR_flFraction fFraction ); 
     
    return 
bool:( fFraction == 1.0 ); 


Now its more accurate.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-24-2018 at 04:04.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-29-2018 , 10:51   Re: [REQ] Detect no kill and punish ( Players which is not killing the enemies)
Reply With Quote #2

Quote:
Originally Posted by Natsheh View Post
PHP Code:
bool:IsInLineOfSightent1 ent2 

    new 
iTrace Float:fFractionFloat:fOrigin1[3], Float:fOrigin2[3], Float:fViewOfs[3]; 
    
pev(ent1pev_v_ofsfViewOfs);
    
pev(ent1pev_originfOrigin1)
    
fOrigin1 += fViewOfs;
    
pev(ent2pev_v_ofsfViewOfs);
    
pev(ent2pev_originfOrigin2)
    
fOrigin2 += fViewOfs;
    
engfuncEngFunc_TraceLine fOrigin1 fOrigin2 IGNORE_MONSTERS iTrace ); 
    
get_tr2iTrace TR_flFraction fFraction ); 
     
    return 
bool:( fFraction == 1.0 ); 

Now its more accurate.
Can you please explain what exactly this does in comparison to the function I created? I am seeing no difference while in game.

Also, it's not compiling.
Code:
//pev_v_ofs undefined, should this be pev_view_ofs? pev( ent1 , pev_v_ofs , fViewOfs ); pev( ent1 , pev_origin , fOrigin1 ) //You cannot do this with arrays. fOrigin1 += fViewOfs; //Should each index of the array be incremented? fOrigin1[ 0 ] += fViewOfs[ 0 ]; fOrigin1[ 1 ] += fViewOfs[ 1 ]; fOrigin1[ 2 ] += fViewOfs[ 2 ];
__________________

Last edited by Bugsy; 04-29-2018 at 10:58.
Bugsy 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 09:16.


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