AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   getting a player to follow another player? (https://forums.alliedmods.net/showthread.php?t=11867)

lunarwolfx 03-30-2005 05:05

getting a player to follow another player?
 
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.

Marstuno 04-01-2005 20:15

Re: getting a player to follow another player?
 
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.

lunarwolfx 04-01-2005 21:39

it needs to loop, and that still doesnt work.

v3x 04-01-2005 22:55

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.


All times are GMT -4. The time now is 09:49.

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