Help with script please. - 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: Help with script please. (
/showthread.php?tid=82784)
Help with script please. -
Bofhead - 20.06.2009
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
Re: Help with script please. -
mamorunl - 20.06.2009
You have to check which trailer is attached to the car and then respawn that trailer.
Re: Help with script please. -
Bofhead - 20.06.2009
And how do i do that?
Thanks,
Josh