Raised This Month: $ Target: $400
 0% 

getting a player to follow another player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lunarwolfx
Member
Join Date: Feb 2005
Old 03-30-2005 , 05:05   getting a player to follow another player?
Reply With Quote #1

well I'm trying to figure out how to get a player to follow another player

what I'm doing is:



Code:
public follow(id) { new player,body get_user_aiming(id,player,body) new whereiam[3],whereiwillbe[3] if(player<=0) { return PLUGIN_HANDLED; } get_user_origin(id,whereiam) get_user_origin(player,whereiwillbe) new move[3],Float:vector[3] move[0] = whereiam[0] - whereiwillbe[0] move[1] = whereiam[1] - whereiwillbe[1] IVecFVec(move, vector) entity_set_vector(id, EV_VEC_velocity, vector) set_task(0.1,"follow",id) }



I don't understand why the player isnt moving towards the other player.
lunarwolfx is offline
Marstuno
Junior Member
Join Date: Mar 2005
Old 04-01-2005 , 20:15   Re: getting a player to follow another player?
Reply With Quote #2

Code:
public follow(id) {     new player, body, whereiam[3], whereiwillbe[3], move[3], Float:vector[3]     get_user_aiming(id,player,body,9999)     if(player<=0)         return PLUGIN_HANDLED     get_user_origin(id,whereiam)     get_user_origin(player,whereiwillbe)     move[0] = whereiam[0] - whereiwillbe[0]     move[1] = whereiam[1] - whereiwillbe[1]     IVecFVec(move, vector)     entity_set_vector(id, EV_VEC_velocity, vector)     return PLUGIN_HANDLED } public setFollow(id) {     set_task(0.1,"follow",id)     return PLUGIN_HANDLED }

Don't execute a function within that function.
Marstuno is offline
lunarwolfx
Member
Join Date: Feb 2005
Old 04-01-2005 , 21:39  
Reply With Quote #3

it needs to loop, and that still doesnt work.
lunarwolfx is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-01-2005 , 22:55  
Reply With Quote #4

I've looped a function within a function before, had no problems. I did it with an HUD message; a count down sort of thing.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Reply


Thread Tools
Display Modes

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 09:49.


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