Truck Driver REALLY NEEDED - 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: Truck Driver REALLY NEEDED (
/showthread.php?tid=56582)
Truck Driver REALLY NEEDED -
Pawel_Shark - 29.11.2008
any ideas how to do that when someone enters a truck and attaches a trailer, he gets an checkpoint and when he reaches he gets a checkpoint back to the place he started at. When he gets to the 2nd checkpoint the trailer will deatach and he will get money
any ideas ?? plz help i really need this
Re: Truck Driver REALLY NEEDED -
xaxa - 14.09.2009
i need it too
Re: Truck Driver REALLY NEEDED -
Peter_Corneile - 14.09.2009
On top of your script
pawn Код:
new TruckCheckpoint[MAX_PLAYERS];
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInVehicle(playerid, 462)) //This id should be changed to your truck's model id ...
{
AttachTrailerToVehicle(5,1); //change the one to the id of your truck
SetPlayerRaceCheckpoint(playerid, 0, x,y,z,nextx,nexty,nextz, 5.0);
TruckCheckpoint[playerid] = 1;
}
return 1;
}
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
if(TruckCheckpoint[playerid] == 1)
{
SetPlayerRaceCheckpoint(playerid, 0, x,y,z, xnext,ynext,znext, 5.0);// First Checkpoint and the place to reach
TruckCheckpoint[playerid] = 2; // NEXT CP
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else if(TruckCheckpoint[playerid] == 2)
{
SetPlayerRaceCheckpoint(playerid, 0, x,y,z, xnext,ynext,znext, 5.0);//Second checkpoint and the back where you started
TruckCheckpoint = 3; // NEXT CP
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid,1000);
SendClientMessage(playerid,color,"Good Job");
}
return 1;
}
Not Tested yet
Re: Truck Driver REALLY NEEDED -
saiberfun - 14.09.2009
Quote:
Originally Posted by ►►►Peter Corneile◄◄◄
if(IsPlayerInVehicle(playerid, 462)) //This id should be changed to your truck's model id ...
|
nope it should be the vehicle id.
if u dunno it then create a new truck like
truck = CreateVehicle(..blah..);
or
truck = AddStaticVehicleVehicle(..blah..);
truck = the vehicleid then then u can do
if(IsPlayerInVehicle(playerid, truck))
didnt check the rest tho but it looks wrong too..
didnt check exactly.
Re: Truck Driver REALLY NEEDED -
Peter_Corneile - 14.09.2009
I know but i showed this just as an example and the trucks cant be used for any other purpose either i think .. And all the vehicles of that modelid (trucks) will be at the Trucker's place so it should be ok
And your way can be used too
Re: Truck Driver REALLY NEEDED -
emch0o - 15.09.2009
please give an example of what should appear filled with trucks and coordinates