AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   entity_set_vector (setting user velocity) (https://forums.alliedmods.net/showthread.php?t=6526)

ThantiK 10-05-2004 11:42

entity_set_vector (setting user velocity)
 
I'm trying to set a users velocity with this, but its not working...I'm using id passed in the damage event like so:

Code:
register_event("Damage", "hedamage_event", "b", "2!0", "4!0", "5!0", "6!0")

Code:
public damage_event(id) {

Code:
    new vector[3]     vector[0] = 0     vector[1] = 0     vector[2] = 0     entity_set_vector(id, EV_VEC_velocity, vector);
Why wouldn't that work? -- pass the ID of the player to the entity set vector function, and I'm getting a tag mismatch...?

Johnny got his gun 10-05-2004 12:02

Use a Float vector.

Code:
new Float:vec[3] vec[0] = 0.0

ThantiK 10-05-2004 14:19

hey jghg, if a read_data is a decimal, how do I convert to float?

I'm doing basically this:
Code:
new Float:upVector[3]     upVector[0] = read_data(1)     upVector[1] = read_data(2)     upVector[2] = read_data(3)     entity_set_vector(id, EV_VEC_velocity, upVector);

But tag type mismatch...=/

Also, can setting velocity raise a user off the ground?

BAILOPAN 10-05-2004 14:25

cast it to a float with float()

ThantiK 10-05-2004 14:28

haha, ok...I'm retarded. ;)


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

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