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=225347)



LinkVehicleToInterior - xir - 13.02.2011

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


Re: LinkVehicleToInterior - xir - 14.02.2011

bump


Re: LinkVehicleToInterior - (SF)Noobanatior - 14.02.2011

can i see the code


Re: LinkVehicleToInterior - iggy1 - 14.02.2011

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


Re: LinkVehicleToInterior - xir - 14.02.2011

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



Re: LinkVehicleToInterior - (SF)Noobanatior - 14.02.2011

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


Re: LinkVehicleToInterior - iggy1 - 14.02.2011

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


Re: LinkVehicleToInterior - xir - 14.02.2011

still the same


Re: LinkVehicleToInterior - (SF)Noobanatior - 14.02.2011

with my code?


Re: LinkVehicleToInterior - xir - 14.02.2011

Thanks NOobanatior! It worked with your code, thanks.

Also thank you iggy I will also add that part Thanks