Raised This Month: $ Target: $400
 0% 

Using velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kmal2t
BANNED
Join Date: Apr 2006
Old 06-11-2007 , 22:15   Using velocity
Reply With Quote #1

This makes a player's jump distance longer. Does anyone know a good way to "manually" do this with vectors or whatever? velocity_by_aim unfortuantely uses a multiplier (iVelocity) that can't be a float.
Code:
#include <amxmodx> #include <fakemeta> new Float:Vel1[33][3], Float:Vel2[33][3]; public plugin_init() { register_forward(FM_PlayerPreThink,"FM_pthink"); } public FM_pthink(id) {     if(is_user_alive(id) && !(pev(id, pev_flags) & FL_ONGROUND)) {         new myVar[33]    //whatever formula I have for jump distance         pev(id,pev_velocity,Vel1[id]);         velocity_by_aim(id,myVar[id],Vel2[id]);         Vel2[id][2] = Vel1[id][2];         set_pev(id, pev_velocity, Vel2[id]);     } }
kmal2t is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 06-12-2007 , 00:00   Re: Using velocity
Reply With Quote #2

Try taking a look at this:
http://forums.alliedmods.net/showthread.php?t=49466
stupok is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 06-12-2007 , 02:01   Re: Using velocity
Reply With Quote #3

I'd already seen that but after looking it over the chr_engine stuff again and tinkering with it it might work.

Last edited by kmal2t; 06-12-2007 at 02:30.
kmal2t is offline
mogel
Senior Member
Join Date: Jan 2007
Old 06-13-2007 , 13:16   Re: Using velocity
Reply With Quote #4

Hi,

simple multiply the velocity

Code:
public SpeedBoost(player) {
    // Beschleunigen
    new Float:velocity[3]
    get_user_velocity(player, velocity)
    velocity[0] *=2 
    velocity[1] *=2 
    velocity[2] *=2 
    set_user_velocity(player, velocity)

    return PLUGIN_HANDLED
}
hand, mogel
__________________
mogel is offline
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 10:43.


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