This site is a testing version, but all data is shared with the live forum.


Raised This Month: $12 Target: $400
 3% 

Knife hit knockback


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-27-2024 , 05:34   Re: Knife hit knockback
Reply With Quote #1

If you want an implementation within the plugin post in the plugin thread
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-01-2024 , 09:26   Re: Knife hit knockback
Reply With Quote #2

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



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 12:40.


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