Raised This Month: $ Target: $400
 0% 

HE knockback plugin, mathematics help...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 10-05-2004 , 14:54   HE knockback plugin, mathematics help...
Reply With Quote #1

Code:
/* AMX Mod script. * Special thanks goes to JGHG for MOST of the code! */ #include <amxmodx> #include <amxmisc> #include <engine> #define SPEED 800.0 public plugin_init() {     register_plugin("HE Knockback", "1.0", "ThantiK")     register_event("Damage", "hedamage_event", "b", "2!0", "4!0", "5!0", "6!0") } public hedamage_event(id) {     new MAXPLAYERS     MAXPLAYERS = get_maxplayers()     new inflictor = entity_get_edict(id, EV_ENT_dmg_inflictor)     if (inflictor <= MAXPLAYERS)         return PLUGIN_CONTINUE     new classname2[8]     entity_get_string(inflictor, EV_SZ_classname, classname2, 7)     if (!equal(classname2, "grenade"))         return PLUGIN_CONTINUE     new bangorigin[3]     bangorigin[0] = read_data(4)     bangorigin[1] = read_data(5)     bangorigin[2] = read_data(6)     new Float:upVector[3]     upVector[0] = float(bangorigin[0])     upVector[1] = float(bangorigin[1])     upVector[2] = float(bangorigin[2])     entity_set_vector(id, EV_VEC_velocity, upVector);     client_print(0, print_chat, "%d got hit by %d which is a %s, from %d, %d, %d", id, inflictor, classname2, bangorigin[0], bangorigin[1], bangorigin[2])     server_print("%d got hit by %d which is a %s, from %d, %d, %d", id, inflictor, classname2, bangorigin[0], bangorigin[1], bangorigin[2])     return PLUGIN_CONTINUE }

This was my idea back in the AMX mod days when it "couldn't be done"...now I've made it...but the calculation is messed up. Seems HE's only send you 1 direction based on where you are on the map. Would anyone mind taking a look at this and telling me what kind of calculation I gotta do to send the user in the correct direction?...and possibly even set up a variable on how strong the effect is?
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
 



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 17:18.


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