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

[REQ] PushPower (Examples)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 12-29-2016 , 23:27   [REQ] PushPower (Examples)
Reply With Quote #1

Looking for a plugin with pushpower (idk how to call it)
Should be done with knife. There're some examples

https://www.youtube.com/watch?v=U1qEb5dMaNA
https://www.youtube.com/watch?v=OpO44C8pgP0

Thanks
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 12-30-2016 , 11:13   Re: [REQ] PushPower (Examples)
Reply With Quote #2

it called "Knockback"
PHP Code:
stock hook_ent2(entFloat:VicOrigin[3], Float:speedtype)
{
    static 
Float:fl_Velocity[3]
    static 
Float:EntOrigin[3]
    
    
pev(entpev_originEntOrigin)
    static 
Float:distance_f
    distance_f 
get_distance_f(EntOriginVicOrigin)
    
    new 
Float:fl_Time distance_f speed
    
    VicOrigin
[2] -= 36.0
    
    
if(type == 1)
    {
        
fl_Velocity[0] = ((VicOrigin[0] - EntOrigin[0]) / fl_Time) * 1.5
        fl_Velocity
[1] = ((VicOrigin[1] - EntOrigin[1]) / fl_Time) * 1.5
        fl_Velocity
[2] = ((VicOrigin[2] - EntOrigin[2]) / fl_Time) * 1.5
    
} else if(type == 2) {
        
fl_Velocity[0] = ((EntOrigin[0] - VicOrigin[0]) / fl_Time)
        
fl_Velocity[1] = ((EntOrigin[1] - VicOrigin[1]) / fl_Time)
        
fl_Velocity[2] = ((EntOrigin[2] - VicOrigin[2]) / fl_Time)
    }
    
entity_set_vector(entEV_VEC_velocityfl_Velocity)

__________________
My plugin:

Last edited by Celena Luna; 12-30-2016 at 11:14.
Celena Luna is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 12-30-2016 , 11:51   Re: [REQ] PushPower (Examples)
Reply With Quote #3

Well I found some zombie plague versions, and this one

PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN    "Pump Knockback (when shot by one)"
#define VERSION    "1.0"
#define AUTHOR    "v3x & Chronic"

new cvar_pump_active cvar_pump_force;

public 
plugin_init()
{
    
register_plugin(PLUGIN VERSION AUTHOR);

    
register_event("Damage" "event_Damage" "b" "2>0");

    
cvar_pump_active   register_cvar("pump_knockback" "1");
    
cvar_pump_force       register_cvar("pump_force"     "10");
}

public 
event_Damage(id)
{
    if(!
get_pcvar_num(cvar_pump_active))
        return 
PLUGIN_CONTINUE;

    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE;

    new 
weapon attacker get_user_attacker(id weapon);

    if(!
is_user_alive(attacker))
        return 
PLUGIN_CONTINUE;

    if(
weapon == CSW_M3)
    {
        new 
Float:vec[3];
        new 
Float:oldvelo[3];
        
get_user_velocity(idoldvelo);
        
create_velocity_vector(id attacker vec);
        
vec[0] += oldvelo[0];
        
vec[1] += oldvelo[1];
        
set_user_velocity(id vec);
    }

    return 
PLUGIN_CONTINUE;
}

// Stock by the one and only, Chronic :P
stock create_velocity_vector(victim,attacker,Float:velocity[3])
{
    if(!
is_user_alive(victim) || !is_user_alive(attacker))
        return 
0;

    new 
Float:vicorigin[3];
    new 
Float:attorigin[3];
    
entity_get_vector(victim   EV_VEC_origin vicorigin);
    
entity_get_vector(attacker EV_VEC_origin attorigin);

    new 
Float:origin2[3]
    
origin2[0] = vicorigin[0] - attorigin[0];
    
origin2[1] = vicorigin[1] - attorigin[1];

    new 
Float:largestnum 0.0;

    if(
floatabs(origin2[0])>largestnumlargestnum floatabs(origin2[0]);
    if(
floatabs(origin2[1])>largestnumlargestnum floatabs(origin2[1]);

    
origin2[0] /= largestnum;
    
origin2[1] /= largestnum;

    
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_pump_force) * 3000) ) / get_entity_distance(victim attacker);
    
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_pump_force) * 3000) ) / get_entity_distance(victim attacker);
    if(
velocity[0] <= 20.0 || velocity[1] <= 20.0)
        
velocity[2] = random_float(200.0 275.0);

    return 
1;

Not sure how it works tho.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 02-25-2017 , 06:44   Re: [REQ] PushPower (Examples)
Reply With Quote #4

bump
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-25-2017 , 06:56   Re: [REQ] PushPower (Examples)
Reply With Quote #5

i took this from menu knifes it's the part wher the knock :

P.S : about other cvar it's the same .

PHP Code:
new cvar_knife_strong_knock 
PHP Code:
cvar_knife_strong_knock register_cvar("knife_strong_knock" "7.0"); 
PHP Code:
stock create_velocity_vector(victim,attacker,Float:velocity[3])
{
    if(!
is_user_alive(attacker))
        return 
0;

    new 
Float:vicorigin[3];
    new 
Float:attorigin[3];
    
entity_get_vector(victim   EV_VEC_origin vicorigin);
    
entity_get_vector(attacker EV_VEC_origin attorigin);

    new 
Float:origin2[3]
    
origin2[0] = vicorigin[0] - attorigin[0];
    
origin2[1] = vicorigin[1] - attorigin[1];

    new 
Float:largestnum 0.0;

    if(
floatabs(origin2[0])>largestnumlargestnum floatabs(origin2[0]);
    if(
floatabs(origin2[1])>largestnumlargestnum floatabs(origin2[1]);

    
origin2[0] /= largestnum;
    
origin2[1] /= largestnum;

    if (
g_knife_combat[attacker])
    {
        
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim attacker);
        
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_combat_knock) * 3000) ) / get_entity_distance(victim attacker);
    }

    if (
g_knife_strong[attacker])
    {
        
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim attacker);
        
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_strong_knock) * 3000) ) / get_entity_distance(victim attacker);
    }

    if (
g_knife_axe[attacker])
    {
        
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim attacker);
        
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_axe_knock) * 3000) ) / get_entity_distance(victim attacker);
    }

    if (
g_knife_katana[attacker])
    {
        
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim attacker);
        
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_katana_knock) * 3000) ) / get_entity_distance(victim attacker);
    }

    if (
g_knife_hammer[attacker])
    {
        
velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_knife_hammer_knock) * 3000) ) / get_entity_distance(victim attacker);
        
velocity[1] = ( origin2[1] * (get_pcvar_float(cvar_knife_hammer_knock) * 3000) ) / get_entity_distance(victim attacker);
    }

    if(
velocity[0] <= 20.0 || velocity[1] <= 20.0)
        
velocity[2] = random_float(200.0 275.0);

    return 
1;


Last edited by yas17sin; 02-25-2017 at 06:58.
yas17sin is offline
Send a message via ICQ to yas17sin
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 02-25-2017 , 07:07   Re: [REQ] PushPower (Examples)
Reply With Quote #6

Yeah but all that needs to be put together, like in the video with special sound, certain damage on enemy team, a command which gives you the knife itself and so on.
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-25-2017 , 07:30   Re: [REQ] PushPower (Examples)
Reply With Quote #7

do you have models can you put it here ?

Last edited by yas17sin; 02-25-2017 at 07:33.
yas17sin is offline
Send a message via ICQ to yas17sin
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 02-25-2017 , 07:39   Re: [REQ] PushPower (Examples)
Reply With Quote #8

Well it doesnt matter, I can find those, if you plan to make a plugin, just use any
__________________
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-25-2017 , 07:44   Re: [REQ] PushPower (Examples)
Reply With Quote #9

okay. just wait.
yas17sin is offline
Send a message via ICQ to yas17sin
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-25-2017 , 09:08   Re: [REQ] PushPower (Examples)
Reply With Quote #10

Okay i finish it and i test it it's working fine all controlled by cvar :
PHP Code:
knife_effect(default:1//make effect when kill
knife_jump(default:380.0// controll gravity
knife_dmg(default:5// controll damage
knife_spd(default:500.0// controll speed
knife_power(default:17// controll knockback power 
P.S : i test it with PodBot if you can test it with real player that could be more beeter.

model and sound and .sma files are in .zip ;).

UPDATE : Logs in .zip
Attached Files
File Type: zip Candy-Knife-1.2.zip (150.8 KB, 28 views)

Last edited by yas17sin; 02-28-2017 at 13:35. Reason: UPDATE 1.2
yas17sin is offline
Send a message via ICQ to yas17sin
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 02:45.


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