SA-MP Forums Archive
LinkVehicleToInterior ?! - 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: LinkVehicleToInterior ?! (/showthread.php?tid=200804)



LinkVehicleToInterior ?! - Yaszine - 19.12.2010

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 !


Re: LinkVehicleToInterior ?! - WillyP - 19.12.2010

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


Re : LinkVehicleToInterior ?! - Yaszine - 19.12.2010

Nothing changed !


Re: LinkVehicleToInterior ?! - WillyP - 19.12.2010

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.


Re : LinkVehicleToInterior ?! - Yaszine - 19.12.2010

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


Re: Re : LinkVehicleToInterior ?! - WillyP - 19.12.2010

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.


Re: LinkVehicleToInterior ?! - Rachael - 19.12.2010

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.


Re: LinkVehicleToInterior ?! - __ - 19.12.2010

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;
}



Re : Re: LinkVehicleToInterior ?! - Yaszine - 19.12.2010

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 !


Re: Re : Re: LinkVehicleToInterior ?! - __ - 19.12.2010

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?