Raised This Month: $32 Target: $400
 8% 

Ask for help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 04-12-2022 , 23:57   Ask for help
Reply With Quote #1

Request master repair SMA, thank you




new cvar_pump_active;
new cvar_pump_force;
Floatperator*(Float:,_(Floatper1, oper2)
{
return floatmul(oper1, float(oper2));
}

Floatperator/(Float:,_(Floatper1, oper2)
{
return floatdiv(oper1, float(oper2));
}

boolperator>(Float:,Float(Floatper1, Floatper2)
{
return 0 < floatcmp(oper1, oper2);
}

boolperator<=(Float:,Float(Floatper1, Floatper2)
{
return 0 >= floatcmp(oper1, oper2);
}

get_entity_distance(ent1, ent2)
{
new Floatrig1[3] = 0.0;
new Floatrig2[3] = 0.0;
entity_get_vector(ent1, cvar_pump_active, orig1);
entity_get_vector(ent2, cvar_pump_active, orig2);
return floatround(get_distance_f(orig1, orig2), cvar_pump_active);
}

set_user_velocity(entity, Float:vec[3])
{
return entity_set_vector(entity, 2, vec);
}

get_user_velocity(entity, Float:vec[3])
{
return entity_get_vector(entity, 2, vec);
}

public plugin_init()
{
register_plugin("Pump Knockback (when shot by one)", "1.0", "v3x & Chronic");
register_event("Damage", "event_Damage", 296, "2>0");
cvar_pump_active = register_cvar("pump_knockback", 380, cvar_pump_active, cvar_pump_active);
cvar_pump_force = register_cvar("pump_force", "10", cvar_pump_active, cvar_pump_active);
return 0;
}

public event_Damage(id)
{
if (!get_pcvar_num(cvar_pump_active))
{
return 0;
}
if (!is_user_alive(id))
{
return 0;
}
new weapon;
new attacker = get_user_attacker(id, weapon);
if (!is_user_alive(attacker))
{
return 0;
}
if (weapon == 21)
{
new Float:vec[3] = 0.0;
new Floatldvelo[3] = 0.0;
get_user_velocity(id, oldvelo);
create_velocity_vector(id, attacker, vec);
vec[0] = floatadd(vec[0], oldvelo[0]);
new var1 = vec[1];
var1 = floatadd(var1, oldvelo[1]);
set_user_velocity(id, vec);
}
return 0;
}

create_velocity_vector(victim, attacker, Float:velocity[3])
{
new var1;
if (!is_user_alive(victim) || !is_user_alive(attacker))
{
return 0;
}
new Float:vicorigin[3] = 0.0;
new Float:attorigin[3] = 0.0;
entity_get_vector(victim, cvar_pump_active, vicorigin);
entity_get_vector(attacker, cvar_pump_active, attorigin);
new Floatrigin2[3] = 0.0;
origin2[0] = floatsub(vicorigin[0], attorigin[0]);
origin2[1] = floatsub(vicorigin[1], attorigin[1]);
new Float:largestnum = 0.0;
if (floatabs(origin2[0]) > largestnum)
{
largestnum = floatabs(origin2[0]);
}
if (floatabs(origin2[1]) > largestnum)
{
largestnum = floatabs(origin2[1]);
}
origin2[0] = floatdiv(origin2[0], largestnum);
new var3 = origin2[1];
var3 = floatdiv(var3, largestnum);
velocity[0] = floatmul(origin2[0], get_pcvar_float(cvar_pump_force) * 3000) / get_entity_distance(victim, attacker);
velocity[1] = floatmul(origin2[1], get_pcvar_float(cvar_pump_force) * 3000) / get_entity_distance(victim, attacker);
new var2;
if (velocity[0] <= 20.0 || velocity[1] <= 20.0)
{
velocity[2] = random_float(1128792064, 1133084672);
}
return 1;
}
wy19850 is offline
Send a message via Skype™ to wy19850
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-13-2022 , 13:49   Re: Ask for help
Reply With Quote #2

What? I don't see a .sma. That is a decompiled plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 04-13-2022 , 22:03   Re: Ask for help
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
What? I don't see a .sma. That is a decompiled plugin.
My friend, can you rewrite this plugin? CS1.5 weapon hits a separate plugin
Attached Files
File Type: sma Get Plugin or Get Source (pump_knockback.sma - 46 views - 2.9 KB)
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 04-13-2022 , 22:27   Re: Ask for help
Reply With Quote #4

Can you rewrite this plug-in, please
wy19850 is offline
Send a message via Skype™ to wy19850
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 04-13-2022 , 22:54   Re: Ask for help
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?t=26457
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 04-14-2022 , 00:15   Re: Ask for help
Reply With Quote #6

Quote:
Originally Posted by +ARUKARI- View Post
pump_knockback.amxx doesn't work in CS1.5
wy19850 is offline
Send a message via Skype™ to wy19850
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 04-14-2022 , 00:17   Re: Ask for help
Reply With Quote #7

Quote:
Originally Posted by +ARUKARI- View Post
Thank you, my friend
wy19850 is offline
Send a message via Skype™ to wy19850
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 19:11.


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