SA-MP Forums Archive
Trailer Location - 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)
+--- Thread: Trailer Location (/showthread.php?tid=358577)



Trailer Location - WinterAce - 11.07.2012

Hello, what can I use to get the location of the trailer? I use /save in game to get vehicle locations, but you can't exactly enter a trailer..


Re: Trailer Location - coole210 - 11.07.2012

You can enter a trailer using scripting functions. (PutPlayerInVehicle)

You can also slowly drive it to reposition it.


Re: Trailer Location - RedFusion - 11.07.2012

So you are asking about entering a trailer?
You must assign an ID to the trailer.
pawn Код:
new trailer;
pawn Код:
OnGameModeInit()
{
trailer = CreateVehicle(cords and stuff..)

}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gototrailer", cmdtext, true, 10) == 0)
    {
        PutPlayerInVehicle(playerid,trailer,0);
        return 1;
    }
    //Other cmds here
    return 0;
}
I think this would work.


Re: Trailer Location - WinterAce - 11.07.2012

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
So you are asking about entering a trailer?
You must assign an ID to the trailer.
pawn Код:
new trailer;
pawn Код:
OnGameModeInit()
{
trailer = CreateVehicle(cords and stuff..)

}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gototrailer", cmdtext, true, 10) == 0)
    {
        PutPlayerInVehicle(playerid,trailer,0);
        return 1;
    }
    //Other cmds here
    return 0;
}
I think this would work.
Spot on, big help. One more problem, is there no way to get the trailer to drive at all? I need to move my trailer to a position I want it to respawn then /save for the co ordinates to make a CreateVehicle for it, cheers.


Re: Trailer Location - WinterAce - 11.07.2012

Please help ^


Re: Trailer Location - RedFusion - 12.07.2012

Use a truck to move it, and then use the command


Re: Trailer Location - clarencecuzz - 12.07.2012

You could use SetPlayerVelocity/SetVehicleVelocity, but it would be too jumpy and you might not get an accurate result, I think RedFusion's idea is the best for now.