AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Using velocity (https://forums.alliedmods.net/showthread.php?t=56345)

kmal2t 06-11-2007 22:15

Using velocity
 
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]);     } }

stupok 06-12-2007 00:00

Re: Using velocity
 
Try taking a look at this:
http://forums.alliedmods.net/showthread.php?t=49466

kmal2t 06-12-2007 02:01

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

mogel 06-13-2007 13:16

Re: Using velocity
 
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


All times are GMT -4. The time now is 10:43.

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