LinkVehicleToInterior
#1

hello , i need help with this linkvechiletointerior ...

When im ingame, tele to a stadium and spawn any car manually with my /veh command
the cars are invisible, i dont understand

i got this on my vehicle command

LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));

but still invisislbe
Reply
#2

bump
Reply
#3

can i see the code
Reply
#4

Do you use virtual worlds? You might need to set that too.
Reply
#5

pawn Код:
COMMAND:v(playerid, params[])
{
    if(!PLVL[playerid]) return 0;
    if(PlayerInfo[playerid][pAdminLevel] >=3)
    {
    if(sscanf(params,"s",params)) return SendClientMessage(playerid, Yellow, "Usage: /v <vehicle ID/name>");
    new vehicle = GetVehicleModelIDFromName(params);
    if(IsNumeric(params)) vehicle = strval(params);
    else vehicle = GetVehicleModelIDFromName(params);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, Red, "Invalid vehicle ID/name");
    else
    {
        new Float:x, Float:y, Float:z, Float:a;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        GetXYInFrontOfPlayer(playerid, x, y, 5.0);
        CreateVehicle(vehicle, x, y, z, a, -1, -1, 100);
        LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));
      }
    } else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
    return 1;
}
Reply
#6

your linking the modelid to the interior not the vehicleid do you have a function like GetVehiclelIDFromName?
or go....
pawn Код:
COMMAND:v(playerid, params[])
{
    if(!PLVL[playerid]) return 0;
    if(PlayerInfo[playerid][pAdminLevel] >=3)
    {
    if(sscanf(params,"s",params)) return SendClientMessage(playerid, Yellow, "Usage: /v <vehicle ID/name>");
    new vehicle = GetVehicleModelIDFromName(params);
    if(IsNumeric(params)) vehicle = strval(params);
    else vehicle = GetVehicleModelIDFromName(params);
    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, Red, "Invalid vehicle ID/name");
    else
    {
        new Float:x, Float:y, Float:z, Float:a;
new vid;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, a);
        GetXYInFrontOfPlayer(playerid, x, y, 5.0);
        vid = CreateVehicle(vehicle, x, y, z, a, -1, -1, 100);
        LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
      }
    } else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
    return 1;
}
that will work too
Reply
#7

Try using this too,
pawn Код:
SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid));//will work with the above example.
Well spotted Noobanatior i didn't see that.
Reply
#8

still the same
Reply
#9

with my code?
Reply
#10

Thanks NOobanatior! It worked with your code, thanks.

Also thank you iggy I will also add that part Thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)