SA-MP Forums Archive
Following the cop - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Following the cop (/showthread.php?tid=139915)



Following the cop - mike555 - 06.04.2010

If somebody could help me, I need a script that will allow player, when he's cuffed, to follow the officer. Or something like this/ Will be very pleaseful if you would help me to do that!



Re: Following the cop - Beaver07 - 06.04.2010

just get the cops position and set the cuffed players position constantly behind them until they are uncuffed


Re: Following the cop - yosswat - 06.04.2010

Maybe something like that "Drag" only PD , but you can change !

Код:
		if(strcmp(cmd, "/drag", true) == 0) // by J,C
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(!IsACop(playerid))
			{
			  SendClientMessage(playerid, COLOR_GRAD1, "You are not a cop!");
			  return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /drag [playerid/PartOfName]");
				return 1;
			}
			new newcar = GetPlayerVehicleID(playerid);
			new playa;
			playa = ReturnUser(tmp);
			if(IsACopCar(newcar) || IsNgCar(newcar) || IsAnFbiCar(newcar))
			{
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
			      new Float:x, Float:y, Float:z;
			      GetPlayerPos(playa,x,y,z);
			      if(PlayerToPoint(5, playerid, x, y, z))
			      {
			      	PutPlayerInVehicle(playa,newcar,1);
			      	GetPlayerName(playa, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string, sizeof(string), "* %s drags %s to his/her car/moped.", sendername ,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "Player is not near you.");
						}
					}
			  }
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GRAD1, "You are not in police vehicle!");
			}
	  }
	  return 1;
	}



Re: Following the cop - mike555 - 07.04.2010

I know this command. I have "/drag" on my server.
I'm a scripting beginner so i'll be very happy if you would help me with this.
I don't need "/drag".
I need command that will make player following the cop!




Re: Following the cop - [LSR]State_Trooper - 07.04.2010

Just guessing here but use something like:

GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(giveplayerid,playerid);


Re: Following the cop - mike555 - 07.04.2010

Quote:
Originally Posted by [LSR
State_Trooper ]
Just guessing here but use omething like:

GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(giveplayerid,playerid);
Thank you for your suggestion, but I have already said that i'm a scripting beginner. I know thiscommands that you said, but i don't know how to use it!




Re: Following the cop - [LSR]State_Trooper - 07.04.2010

Are you using factions like in a GF edit or teams?? I may give you the code :P


Re: Following the cop - mike555 - 07.04.2010

I'm using La-Rp.
Will be very thankful for your help.
I'd want to ask you to make another command. And connect it with "/cuff".
Thank you for your help!



Re: Following the cop - mike555 - 07.04.2010

Would you help me?


Re: Following the cop - [LSR]State_Trooper - 07.04.2010

ill try yea.