Follow player
#1

I need a script that makes it so player follow the player wherever he goes.
Reply
#2

Well, there is no animation of the player walking with the other player...
But it's possible, here's the code...
Put this write up the script, after the defines and the includes, but not after the OnGameModeInit...
PHP код:
new Drags[MAX_PLAYERS]; 
Then...
Put this wherever you want...
PHP код:
Drags[playerid] = SetTimerEx("DragPlayer"3000true"ii"playeriddraggingid// Replace playerid and draggerid to the ID's of the players...
//playerid is the player who is dragging, and the draggingid is the id of the player getting dragged. 
Then add this outside any callbacks(Better at the very end of the script)...
PHP код:
forward DragPlayer(playeriddraggingid);
public 
DragPlayer(playeriddraggingid)
{
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    
SetPlayerPos(draggingidX+1YZ+1);
    return 
1;

And when you want to end the dragging process, use this..
PHP код:
KillTimer(Drags[playerid]); //Replace the playerid with the id of the dragger. 
Rep+ if i helped.
Edit: There is a lot of methods of doing it, this is mine, if you don't like it, wait for a response from other people.
Reply
#3

« Would help if you handed out some code to aid in making this command, but you know, Scripting Help isn't really for making you a command...
But if someone was going to be kind, then they'd need some basis to go on, rather than nothing and guess everything. » - Sew_Sumi
^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)