Trailer Location
#1

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..
Reply
#2

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

You can also slowly drive it to reposition it.
Reply
#3

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.
Reply
#4

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.
Reply
#5

Please help ^
Reply
#6

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)