AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   laser guided enitity (https://forums.alliedmods.net/showthread.php?t=28409)

Ramono 05-14-2006 04:22

laser guided enitity
 
Send a entity to a point.
Example :
Im aiming to a wall.
Code:
new origin[3] get_user_origin (id,origin,3)
This gets the point were im aiming,

now there is a entity somwhere in the map, and i want it to move ( not teleport ) it to that origin.
Somthing like a laser guided rocket.

Any suggestions?

Thanks,
Ramon

Cheap_Suit 05-14-2006 04:31

Edit:

Code:
stock entity_set_follow_origin(entity, Float:Origin[3], Float:speed) {     if(!is_valid_ent(entity)) return 0     new Float:entity_origin[3]     entity_get_vector(entity, EV_VEC_origin, entity_origin)     new Float:diff[3]     diff[0] = Origin[0] - entity_origin[0]     diff[1] = Origin[1] - entity_origin[1]     diff[2] = Origin[2] - entity_origin[2]     new Float:length = floatsqroot(floatpower(diff[0], 2.0) + floatpower(diff[1], 2.0) + floatpower(diff[2], 2.0))     new Float:Velocity[3]     Velocity[0] = diff[0] * (speed / length)     Velocity[1] = diff[1] * (speed / length)     Velocity[2] = diff[2] * (speed / length)     entity_set_vector(entity, EV_VEC_velocity, Velocity)     return 1 }

(Modified) From: The Bazooka plugin

nordy 05-14-2006 04:34

lol not the mine but laser pointer he mean

Cheap_Suit 05-14-2006 04:43

Sorry, new code.

nordy 05-14-2006 04:45

oo oky

nordy 05-14-2006 04:45

hey CHEAP SUIT maybie you can help me..?!


All times are GMT -4. The time now is 16:28.

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