Raised This Month: $ Target: $400
 0% 

Knife hit knockback


Post New Thread Reply   
 
Thread Tools Display Modes
Tote
Senior Member
Join Date: Jul 2023
Old 04-27-2024 , 08:55   Re: Knife hit knockback
Reply With Quote #21

Quote:
Originally Posted by SaraAki View Post
Tote,now work only when attack enemy players,but also only when i kill player,killed player get knockbacked.Maybe problem is in velocity stock?
Ofcourse it's going to happen, thats what ur plugin function does. It's not even considered a "problem".
Tote is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-01-2024 , 09:26   Re: Knife hit knockback
Reply With Quote #22

PHP Code:
stock create_velocity_vector(victimattackerFloat:velocity[3])
{
    if(!
is_user_alive(victim) || !is_user_alive(attacker))
        return 
0;

    new 
Float:vicorigin[3], Float:attorigin[3];
    
entity_get_vector(victimEV_VEC_originvicorigin);
    
entity_get_vector(attackerEV_VEC_originattorigin);

    new 
Float:origin_diff[3];
    for(new 
03i++)
        
origin_diff[i] = vicorigin[i] - attorigin[i];

    new 
Float:fLen get_distance_f(vicoriginattorigin);

    if(
fLen <= 0.0) return 0;

    for(new 
03i++)
    {
        
origin_diff[i] /= fLen;
    }

    new 
Float:knock_force get_pcvar_float(cvar_knock_force);
    
velocity[0] = (origin_diff[0] * knock_force );
    
velocity[1] = (origin_diff[1] * knock_force );
    
velocity[2] = (origin_diff[2] * knock_force) + random_float(200.0275.0);

    return 
1;

Here you go this function should make more sense now, make sure to post in the proper section..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-01-2024 at 09:27.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 14:43.


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