Raised This Month: $ Target: $400
 0% 

Traceline


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-12-2005 , 18:09   Traceline
Reply With Quote #1

Ok, I'm trying to use this method instead of using set_user_hitzones because it's supposedly buggy. The problem is whenever I look at someone or whatever, the debug messages and sounds come up and I'm not even firing.
Code:
// My defines #define ARMOR_OFFSET    112     // Armortype offset #define ARMOR_DEFAULT   100.0       // Default amount of armor #define ARMOR_NONE  0 #define ARMOR_NOHELM    1 #define ARMOR_HELM  2 #define HITS_HELM   3 #define HITS_NOHELM 5 // plugin_init register_forward(FM_TraceLine, "forward_traceline", 1); public forward_traceline( Float:v1[3], Float:v2[3], noMonsters, id ) {     if( !is_user_connected(id) || !is_user_alive(id) )         return FMRES_IGNORED;     new iVictim = get_tr(TR_pHit);     if( !is_user_connected(iVictim) || !is_user_alive(iVictim) || is_user_bot(iVictim) )         return FMRES_IGNORED;     new iHitPlace = get_tr(TR_iHitgroup);     new iArmor = get_pdata_int(iVictim, ARMOR_OFFSET);     new szUserName[33];     get_user_name(iVictim, szUserName, 32);     switch( iArmor )     {         case ARMOR_NOHELM:         {             if( g_iHits[iVictim] <= HITS_NOHELM )             {                 emit_sound(iVictim, CHAN_VOICE, "player/bhit_kevlar-1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);                 set_tr(TR_iHitgroup, HIT_GENERIC);                 client_print(iVictim, 4, "[DEBUG] Your kevlar just took a shot, %s", szUserName);             }         }         case ARMOR_HELM:         {             if( g_iHits[iVictim] <= HITS_HELM )             {                 if( iHitPlace == HIT_HEAD )                     emit_sound(iVictim, CHAN_VOICE, "player/bhit_helmet-1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);                 set_tr(TR_iHitgroup, HIT_GENERIC);                 client_print(iVictim, 4, "[DEBUG] Your kevlar/helmet just took a shot, %s", szUserName);             }         }     }     return FMRES_IGNORED; }
Could I do something like this to prevent it?
Code:
if( (get_user_button(id)&IN_ATTACK) && g_iHits[iVictim] <= HITS_NOHELM )
Thanks
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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:42.


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