AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [ H3LP ] Something like velocity_by_aim ? (https://forums.alliedmods.net/showthread.php?t=296420)

CrazY. 04-20-2017 12:14

[ H3LP ] Something like velocity_by_aim ?
 
Hello, exists something like velocity_by_aim? I need this because I'm creating a wall climb, but I want move the player with the W, A, D keys, dont only with W.

OciXCrom 04-20-2017 13:27

Re: [ H3LP ] Something like velocity_by_aim ?
 
https://www.amxmodx.org/api/vector/velocity_by_aim ???

CrazY. 04-20-2017 14:59

Re: [ H3LP ] Something like velocity_by_aim ?
 
I tell something like, dont the velocity by aim. I need speed to the move direction, dont aim position.

OciXCrom 04-20-2017 15:16

Re: [ H3LP ] Something like velocity_by_aim ?
 
You said exactly that... Check if the player is holding the A/D keys and move him in that direction. You can check and see how a wall climb plugin works.

CrazY. 04-20-2017 17:07

Re: [ H3LP ] Something like velocity_by_aim ?
 
Tryied with entity_set_vector(id, EV_VEC_velocity...), but have some mistakes. Only work correctly with W key...

Natsheh 04-21-2017 00:50

Re: [ H3LP ] Something like velocity_by_aim ?
 
Left is negative , right is positive
PS : this idea is similar to call of duty advance warfare player boost jump

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Velocity By Side"
#define VERSION "1.0"
#define AUTHOR "Natsheh"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /goRight""clcmd_right")
    
register_clcmd("say /goLeft""clcmd_left")
}

public 
clcmd_right(id)
{
    new 
Float:vVelo[3];
    
fm_velocity_byside(id400vVelo)
    
set_pev(idpev_velocityvVelo)
    
client_print(idprint_chat"* Boost Right.")
}

public 
clcmd_left(id)
{
    new 
Float:vVelo[3];
    
fm_velocity_byside(id, -400vVelo)
    
set_pev(idpev_velocityvVelo)
    
client_print(idprint_chat"* Boost Left.")
}

/* Credits TO VEN */
stock fm_velocity_byside(indexmultiplierFloat:velocity[3])
{
    new 
Float:vec[3]
    
pev(indexpev_v_anglevec)
    
engfunc(EngFunc_MakeVectorsvec)
    
global_get(glb_v_rightvec)
    
    
velocity[0] = vec[0] * multiplier
    velocity
[1] = vec[1] * multiplier
    velocity
[2] = vec[2] * multiplier



CrazY. 04-21-2017 08:35

Re: [ H3LP ] Something like velocity_by_aim ?
 
Quote:

Left is negative , right is positive
I know about that.

Quote:

this idea is similar to call of duty advance warfare player boost jump
Ok, I will try extract some code from your example.

CrazY. 04-21-2017 09:10

Re: [ H3LP ] Something like velocity_by_aim ?
 
Thanks Natsheh, worked perfectly.

Results in my next aliens vs predator :D


All times are GMT -4. The time now is 17:59.

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