Raised This Month: $ Target: $400
 0% 

C++ -> AMXX velocity length?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-28-2010 , 16:47   C++ -> AMXX velocity length?
Reply With Quote #1

I have a line of c++ code that I have been trying to convert to AMXX [pawn] (its from a large metamod plugin, im converting)

anyways.. the line is
PHP Code:
if(pEntity->v.velocity.Length() > || pEntity->v.maxspeed <= || pEntity->v.deadflag != DEAD_NO
I know how to modify everything except for velocity.Length(), I do not know what I should use for this (the entity is a player) I have seen a few things regarding length, but still, I dont know exactly what to use.

Thanks for considering to help me
__________________
+|- KARMA Respectively

HLM is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-28-2010 , 16:58   Re: C++ -> AMXX velocity length?
Reply With Quote #2

Get entity velocity then use
PHP Code:
vector_length(:args
native.

->
PHP Code:
new Float:vVel[3];
pev(idpev_velocityvVel);

if(
vector_length(vVel) > 0)
   
//something... 
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 05-29-2010 at 03:10.
Alka is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-28-2010 , 17:41   Re: C++ -> AMXX velocity length?
Reply With Quote #3

much obliged, so im going to be getting the velocity stored to a vector, then use vector_length(), and all will work? if so, thank you very much!
__________________
+|- KARMA Respectively

HLM is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 05-28-2010 , 19:21   Re: C++ -> AMXX velocity length?
Reply With Quote #4

FYI, the length of a vector corresponds to
Code:
sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[3])
Or the square root of the sum of the squares of its components.
Seta00 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-28-2010 , 20:43   Re: C++ -> AMXX velocity length?
Reply With Quote #5

Quote:
Originally Posted by Seta00 View Post
FYI, the length of a vector corresponds to
Code:
sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[3])
Or the square root of the sum of the squares of its components.
aka magnitude.
__________________
fysiks is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 05-28-2010 , 22:37   Re: C++ -> AMXX velocity length?
Reply With Quote #6

you can look at the header file vector.h in sdk to see how this method defined.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
TSuNaMi_
BANNED
Join Date: Jan 2009
Location: After 2018 World
Old 05-29-2010 , 07:36   Re: C++ -> AMXX velocity length?
Reply With Quote #7

what is default step lenght in cs ?
TSuNaMi_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-31-2010 , 02:13   Re: C++ -> AMXX velocity length?
Reply With Quote #8

Quote:
Originally Posted by TSuNaMi_ View Post
what is default step lenght in cs ?
Each weapon has their own max speed:
http://wiki.amxmodx.org/CS_Weapons_Information
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 05:15.


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