Help with getin and getout
#1

Hello,

I made a /getin command to get with your vehicle into an garage (this is for PD garage (different VW because of lagg))
and an /getout to get back in VW 0 and place you with your car at LSPD.

but it don't teleport the car with you, only yourself...

pawn Код:
command(getin, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0 ,1588.1971, -1635.9882, 13.3903)) //Door 0
        {
            SetPlayerPos(playerid, 2313.7886, 2447.9248, 2.8986);
            SetPlayerInterior(playerid, GetPlayerInterior(playerid));
            SetPlayerVirtualWorld(playerid, 1);
            new tmpcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(tmpcar, 2313.7886, 2447.9248+2, 2.8986);
            SetVehicleVirtualWorld(tmpcar, GetPlayerVirtualWorld(playerid));
            LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(playerid));
        }
    }
    return 1;
}

command(getout, playerid, params[])
{
    if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0 ,2313.7886, 2447.9248, 2.8986)) //Door 0
        {
            SetPlayerPos(playerid, 1588.1971, -1635.9882, 13.3903);
            SetPlayerInterior(playerid, GetPlayerInterior(playerid));
            SetPlayerVirtualWorld(playerid, 0);
            new tmpcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(tmpcar, 1588.1971, -1635.9882+2, 13.3903);
            SetVehicleVirtualWorld(tmpcar, GetPlayerVirtualWorld(playerid));
            LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(playerid));
        }
    }
    return 1;
}
Reply
#2

I have two similar commands. You may compare them to yours to find your errors.
pawn Код:
YCMD:enter(playerid, params[], help)
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 613.4926,-607.1959,17.2266))
    {
        new playercar = GetPlayerVehicleID(playerid);
        new playerseat = GetPlayerVehicleSeat(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            LinkVehicleToInterior(playercar, 18);
            SetVehicleVirtualWorld(playercar, 1);
            SetPlayerVirtualWorld(playerid, 1);
            SetPlayerInterior(playerid, 18);
            SetVehiclePos(playercar, 1302.519897,-1.787510,1001.028259);
            SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259);//SDGarageEntrance
            PutPlayerInVehicle(playerid, playercar, playerseat);
        }
        else
        {
            SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259);//SDGarageEntrance
            SetPlayerInterior(playerid, 18);
            SetPlayerVirtualWorld(playerid, 1);
        }
    }
    return 1;
}
YCMD:exit(playerid, params[], help)
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1302.519897,-1.787510,1001.028259))
    {
        new playercar = GetPlayerVehicleID(playerid);
        new playerseat = GetPlayerVehicleSeat(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            LinkVehicleToInterior(playercar, 0);
            SetVehicleVirtualWorld(playercar, 0);
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid, 0);
            SetVehiclePos(playercar, 613.4926,-607.1959,17.2266);
            SetPlayerPos(playerid, 613.4926,-607.1959,17.2266);//SDGarageExit
            PutPlayerInVehicle(playerid, playercar, playerseat);
        }
        else
        {
            SetPlayerPos(playerid, 613.4926,-607.1959,17.2266);//SDGarageExit
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    return 1;
}
Reply
#3

Converted:
pawn Код:
command(enter, playerid, params[], help)
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 613.4926,-607.1959,17.2266))
    {
        new playercar = GetPlayerVehicleID(playerid);
        new playerseat = GetPlayerVehicleSeat(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            LinkVehicleToInterior(playercar, 18);
            SetVehicleVirtualWorld(playercar, 1);
            SetPlayerVirtualWorld(playerid, 1);
            SetPlayerInterior(playerid, 18);
            SetVehiclePos(playercar, 1302.519897,-1.787510,1001.028259);
            SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259);//SDGarageEntrance
            PutPlayerInVehicle(playerid, playercar, playerseat);
        }
        else
        {
            SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259);//SDGarageEntrance
            SetPlayerInterior(playerid, 18);
            SetPlayerVirtualWorld(playerid, 1);
        }
    }
    return 1;
}
command(exit, playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1302.519897,-1.787510,1001.028259))
    {
        new playercar = GetPlayerVehicleID(playerid);
        new playerseat = GetPlayerVehicleSeat(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            LinkVehicleToInterior(playercar, 0);
            SetVehicleVirtualWorld(playercar, 0);
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid, 0);
            SetVehiclePos(playercar, 613.4926,-607.1959,17.2266);
            SetPlayerPos(playerid, 613.4926,-607.1959,17.2266);//SDGarageExit
            PutPlayerInVehicle(playerid, playercar, playerseat);
        }
        else
        {
            SetPlayerPos(playerid, 613.4926,-607.1959,17.2266);//SDGarageExit
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    return 1;
}
Reply
#4

Is that also working when i have someone in my car and i type /getin he gets with me?
Reply
#5

You changed the first line. He must still alter the coordinates to his enter and exit points.
Reply
#6

How to make it also when i have a passenger (like a criminal in the back, and i wanna take him into the garage) will he get teleported with me?
Reply
#7

Edit: He teleportes to the coord but not in the vehicle + not in the right vw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)