LinkVehicleToInterior ?!
#1

Hey all, I have maked this teleportation to Derby Stadium :

pawn Код:
if (strcmp(cmdtext, "/derby", true) == 0)
    {
        SetPlayerPos(playerid, -1510.7020,1014.6202,1037.8568);
        SetPlayerInterior(playerid,15);
        new Float:X,Float:Y,Float:Z,Float:A;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        Car = CreateVehicle(502,X,Y,Z,A,-1,-1,-1);
        PutPlayerInVehicle(playerid, Car ,0);
        LinkVehicleToInterior(Car, 15);
        return 1;
    }
But when I tape /derby, it set my interior to 15 without Teleportation & give me a Hotring
I need when someone tape /derby = telep + set interior + give car & put it in the Hotring

Thankss very much !
Reply
#2

pawn Код:
if (strcmp(cmdtext, "/derby", true) == 0)
    {
        new Float:X,Float:Y,Float:Z,Float:A;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        SetPlayerInterior(playerid,15);
        SetPlayerPos(playerid, -1510.7020,1014.6202,1037.8568);
        Car = CreateVehicle(502,X,Y,Z,A,-1,-1,-1);
        LinkVehicleToInterior(Car, 15);
        PutPlayerInVehicle(playerid, Car ,0);
        GameTextForPlayer(playerid,"You entered a ~r~DERBY!",2000,5);
        return 1;
    }
Maybe..?
Reply
#3

Nothing changed !
Reply
#4

Quote:
Originally Posted by Yaszine
Посмотреть сообщение
Nothing changed !
Quote:
Originally Posted by Yaszine
Посмотреть сообщение
But when I tape /derby, it set my interior to 15 without Teleportation & give me a Hotring
I need when someone tape /derby = telep + set interior + give car & put it in the Hotring

Thankss very much !
Maybe becuase your explaining isn't detailed and understandable in English.
Reply
#5

Ah, sorry for my bad langue
I need a cmd /derby, it will teleport you to do stadium and give you a Hotring.
and players can't exit the car when them are in the derby stadium
I have made the /derby on top, but it give only the Hotring on place and doesn't teleport to the stadium and it sets the interior to 15 ..
I hope you've been understaded now, Help me! thx
Reply
#6

Quote:
Originally Posted by Yaszine
Посмотреть сообщение
Ah, sorry for my bad langue
I need a cmd /derby, it will teleport you to do stadium and give you a Hotring.
and players can't exit the car when them are in the derby stadium
I have made the /derby on top, but it give only the Hotring on place and doesn't teleport to the stadium and it sets the interior to 15 ..
I hope you've been understaded now, Help me! thx
Give me a few minutes, I'm doing something ATM.
Reply
#7

You need to create the vehicle at the bloodbowl, in your script its creating the vehicle where the player was before you teleported them. Also FUvictious is correct in that you need to LinkVehicleToInterior before you PutPlayerInVehicle.

[edit] oh I just looked at it more carefully, your original code should work if you swap LinkVehicleToInterior and PutPlayerInVehicle.
Reply
#8

Untested.

Command: (I haven't tested this or the coordinates, I used the coordinates and interior that you provided)
pawn Код:
if(strcmp(cmdtext, "/derby", true) == 0)
    {
        new
            Float: tmp_A;

        GetPlayerFacingAngle(playerid, tmp_A);
        SetPVarInt(playerid, "d_Car", CreateVehicle(502, -1510.7020, 1014.6202, 1037.8568, tmp_A, -1, -1, -1));
        SetPlayerPos(playerid, -1510.7020,1014.6202,1037.8568);
        SetPlayerInterior(playerid, 15);
        LinkVehicleToInterior(GetPVarInt(playerid, "d_Car"), 15);
        PutPlayerInVehicle(playerid, GetPVarInt(playerid, "d_Car"), 0);
        return 1;
    }
Callback to return the player to their vehicle if/when they try to exit.
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid) {
    if(GetPVarInt(playerid, "d_Car") != 0) PutPlayerInVehicle(playerid, GetPVarInt(playerid, "d_Car"), 0);
    return 1;
}
Reply
#9

Quote:
Originally Posted by __
Посмотреть сообщение
Callback to return the player to their vehicle if/when they try to exit.
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid) {
    if(GetPVarInt(playerid, "d_Car") != 0) PutPlayerInVehicle(playerid, GetPVarInt(playerid, "d_Car"), 0);
    return 1;
}
First it work very much, but the second I can exit the car without any prob !
Reply
#10

Quote:
Originally Posted by Yaszine
Посмотреть сообщение
First it work very much, but the second I can exit the car without any prob !
You can exit it or you can't?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)