setting a virtual world for each interior on each different vehicle
#1

Each plane has an interior, but i'm not sure on how i would go about adding a new interior for each plane.

e.g, person 1 enters shamal at LV, person 2 enters shamal at LS, they can both see each other.., but how could i make it so you can only see the person who enters the same plane as you do.

Thank you to anybody who can help,
also i if i need to post my objects just say, cheers.

my code:
pawn Код:
new InAndrom[MAX_PLAYERS];
new InShamal[MAX_PLAYERS];
new InNevada[MAX_PLAYERS];

//onplayerconnect
InAndrom[playerid]=0;
InShamal[playerid]=0;
InNevada[playerid]=0;

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 592 && ispassenger == 1)
        {
                SetPlayerInterior(playerid,9);
                SetPlayerFacingAngle(playerid,0.0);
                SetPlayerPos(playerid, 315.856170,1024.496459,1949.797363);
                SetCameraBehindPlayer(playerid);
                InAndrom[playerid]=vehicleid;
        }
    if (GetVehicleModel(vehicleid) == 519 && ispassenger == 1)
        {
                TogglePlayerControllable(playerid, 0);
                SetTimerEx("UnfreezePlayer", 3000, false, "d", playerid);
                SetPlayerFacingAngle(playerid,270.0);
                SetPlayerPos(playerid, 1377.7186,-3785.6904,1226.5165);
                SetCameraBehindPlayer(playerid);
                InShamal[playerid]=vehicleid;
        }
    if (GetVehicleModel(vehicleid) == 553 && ispassenger == 1)
        {
                TogglePlayerControllable(playerid, 0);
                SetTimerEx("UnfreezePlayer", 3000, false, "d", playerid);
                SetPlayerFacingAngle(playerid,15.0);
                SetPlayerPos(playerid, 1777.8147,-3872.2085,1206.4860);
                SetCameraBehindPlayer(playerid);
                InNevada[playerid]=vehicleid;
        }
        return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & 16 && InAndrom[playerid] > 0)
        {
                new Float:X,Float:Y,Float:Z,Float:A;
                GetVehiclePos(InAndrom[playerid],X,Y,Z);
                GetVehicleZAngle(InAndrom[playerid],A);
                X+=(5*floatsin(-floatsub(A,45.0),degrees)),
                Y+=(5*floatcos(-floatsub(A,45.0),degrees));
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,X,Y,floatsub(Z,0.94));
                SetPlayerFacingAngle(playerid,A);
                SetCameraBehindPlayer(playerid);
                InAndrom[playerid]=0;
        }
if (newkeys & 16 && InShamal[playerid] > 0)
        {
                new Float:X,Float:Y,Float:Z,Float:A;
                GetVehiclePos(InShamal[playerid],X,Y,Z);
                GetVehicleZAngle(InShamal[playerid],A);
                X+=(5*floatsin(-floatsub(A,45.0),degrees)),
                Y+=(5*floatcos(-floatsub(A,45.0),degrees));
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,X,Y,floatsub(Z,0.94));
                SetPlayerFacingAngle(playerid,A);
                SetCameraBehindPlayer(playerid);
                InShamal[playerid]=0;
        }
if (newkeys & 16 && InNevada[playerid] > 0)
        {
                new Float:X,Float:Y,Float:Z,Float:A;
                GetVehiclePos(InNevada[playerid],X,Y,Z);
                GetVehicleZAngle(InNevada[playerid],A);
                X+=(5*floatsin(-floatsub(A,45.0),degrees)),
                Y+=(5*floatcos(-floatsub(A,45.0),degrees));
                SetPlayerInterior(playerid,0);
                SetPlayerPos(playerid,X,Y,floatsub(Z,0.94));
                SetPlayerFacingAngle(playerid,A);
                SetCameraBehindPlayer(playerid);
                InNevada[playerid]=0;
        }
        return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)