Help with script please.
#1

Hello,

With help form abernathy and a few other people i have managed to get my script looking like below. The only problem left is that when the player enters the checkpoint all the trailers respawn including other players. How do i code it so that only the trailer being towed is forced to respawn and not all the other players trailers as well.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if (IsPlayerInVehicle(playerid,vehicleid))
	if (IsTrailerAttachedToVehicle(vehicleid))
 	{
		GameTextForPlayer(playerid, "~r~Congratulations! ~n~Successfully Completed! ~n~~g~$5,000", 5000, 3);
		GivePlayerMoney(playerid, 5000);
		DisablePlayerCheckpoint(playerid);
		SetVehicleToRespawn(vehicleid);
		SetVehicleToRespawn(Trailer[0]);
		SetVehicleToRespawn(Trailer[1]);
	}
	else
	{
		GameTextForPlayer(playerid, "~r~You need a trailer. ~w~~n~Noob", 2000, 3);
	}
	else
	{
		DisablePlayerCheckpoint(playerid);
	}
	return 1;
}
Thanks in advance,
Josh
Reply
#2

You have to check which trailer is attached to the car and then respawn that trailer.
Reply
#3

And how do i do that?

Thanks,
Josh
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)