Thread: [Solved] Bug with hegrenade exploding
View Single Post
Author Message
farawayf
Senior Member
Join Date: Jan 2019
Old 03-22-2019 , 16:12   Bug with hegrenade exploding
Reply With Quote #1

Hello.
That plugin sets targets punch angle and ignites him if attacker uses knife. But have bug: when someone throwing a grenade and changing to a knife, the plugin works like player attacks with knife.
How to solve this bug ?
PHP Code:
if(StrEqual(weapon"weapon_knife"))
{
     new 
buttons GetClientButtons(attacker);
     if (!(
buttons IN_ATTACK2))
     {
          new 
Float:punch[3];
    
          
punch[0] = GetRandomFloat(1.015.0); 
          
punch[1] = GetRandomFloat(1.015.0); 
          
punch[2] = GetRandomFloat(1.015.0); 
          
IgniteEntity(victimkfire_time);
          
SetEntPropVector(victimProp_Send"m_vecPunchAngle"punch); 
     }    
     else if (!(
buttons IN_ATTACK))
     {
         new 
Float:punch2[3];             
    
         
punch2[0] = GetRandomFloat(1.0100.0); 
         
punch2[1] = GetRandomFloat(1.0100.0); 
         
punch2[2] = GetRandomFloat(1.0100.0); 
         
SetEntPropVector(victimProp_Send"m_vecPunchAngle"punch2); 
     }


Last edited by farawayf; 03-23-2019 at 15:44.
farawayf is offline