Raised This Month: $ Target: $400
 0% 

set_user_velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-17-2004 , 16:04   set_user_velocity
Reply With Quote #1

very strange

i get error when i compile plugin

Quote:
Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase

amx_girlthrow.sma(39) : error 017: undefined symbol "set_user_velocity"

1 Error.
Press any key to continue . . .
i got the #include <engine>
Quote:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
here is the section it is in...
Code:
public grenid(parm[]){     new id = parm[0]     new string[32], grenadeid = 0     do     {         grenadeid = get_grenade_id(id, string, 31, grenadeid)     }     while (grenadeid &&!equali(HEGRENADE_MODEL,string));     if (grenadeid)     {         new grenage_vel[3]         grenage_vel[0] = 0         grenage_vel[1] = 0         grenage_vel[2] = 0         set_user_velocity(grenadeid, grenage_vel)     } }

whats wrong?
__________________
Burnzy is offline
Send a message via AIM to Burnzy
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-17-2004 , 16:15  
Reply With Quote #2

The set_user_velocity native from xtrafun is in xtrafun.inc for compatibility. Use this instead:
Code:
entity_set_vector(index, EV_VEC_velocity, vector)

The parameter "vector" has to be a float. If you need to have it a "normal" cell, use:
Code:
new Float:tmpVector[3] IVecFVec(newVelocity, tmpVector) entity_set_vector(index, EV_VEC_velocity, tmpVector)
__________________
hello, i am pm
PM is offline
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-17-2004 , 16:19  
Reply With Quote #3

no idea what u said.... did u mean do this?

Code:
public grenid(parm[]){     new id = parm[0]     new string[32], grenadeid = 0       new Float:tmpVector[3]       IVecFVec(newVelocity, tmpVector)       entity_set_vector(index, EV_VEC_velocity, tmpVector)     do     {         grenadeid = get_grenade_id(id, string, 31, grenadeid)     }     while (grenadeid &&!equali(HEGRENADE_MODEL,string));     if (grenadeid)     {         new grenage_vel[3]         grenage_vel[0] = 0         grenage_vel[1] = 0         grenage_vel[2] = 0         entity_set_vector(index, EV_VEC_velocity, vector)     } }
__________________
Burnzy is offline
Send a message via AIM to Burnzy
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-18-2004 , 04:19  
Reply With Quote #4

Do this:
Code:
public grenid(parm[]){     new id = parm[0]     new string[32], grenadeid = 0     do     {         grenadeid = get_grenade_id(id, string, 31, grenadeid)     }     while (grenadeid &&!equali(HEGRENADE_MODEL,string));     if (grenadeid)     {         new Float:grenage_vel[3]         grenage_vel[0] = 0.0         grenage_vel[1] = 0.0         grenage_vel[2] = 0.0         entity_set_vector(grenadeid, EV_VEC_velocity, grenage_vel)     } }
(not tested)
__________________
hello, i am pm
PM is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-18-2004 , 04:47  
Reply With Quote #5

so EC_VEC_velocity is setting users velocity in the direction of your vector, right?
__________________
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
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-18-2004 , 04:53  
Reply With Quote #6

Yes, EV_VEC_velocity is unlike EV_VEC_angles a real vector. EV_VEC_angles only stores the rotation vectors around the 3 axis. I think they implemented it in that way so you can easily rotate a model. For example, you only add 30 to his velocity[0] to rotate him 30 degrees aroung the x axis. To get a normalized vector out of that, you need to call the anglevectors function. I have an implementation (which was created with slight help of the Quake2 programmers ) in my SuperKeeper plugin (somewhere in Plugins section).
As EV_VEC_velocity is a vector, it can store a direction and a velocity (the length of the vector). The HL engine only has to add the entity's velocity vector to its origin to move it.
__________________
hello, i am pm
PM is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 07-18-2004 , 18:00  
Reply With Quote #7

PM, would you set the users aiming that way?

How would I be able to set a certain player to be looking up/down, left/right, etc?
__________________
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
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-19-2004 , 07:48  
Reply With Quote #8

I thought there was a native for that... Not sure though.
I don't think the v_angle will be updated to the client when you change it, I think you have to update it manually somehow.
__________________
hello, i am pm
PM is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 07-19-2004 , 14:02  
Reply With Quote #9

yeah. you cant really rotate a client, it would seem. but if i use a trigger_teleport and set it to -180 or -90 its pretty funny seeing people walk on their side. They like WTF?
__________________
QwertyAccess is offline
Burnzy
Veteran Member
Join Date: Apr 2004
Old 07-19-2004 , 18:24  
Reply With Quote #10

im back and thx PM for the help. Now works
__________________
Burnzy is offline
Send a message via AIM to Burnzy
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 20:13.


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