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

Yh i never thought of that JaToc, maybe this type would be appropriate
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 592 && ispassenger == 1)
    {
        new vw;
        for(new i; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i) || playerid == i)continue;
            if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_PASSENGER)
            {
                vw = GetPlayerVirtualWorld(i);
                SetPlayerVirtualWorld(playerid, vw);
                SetPlayerInterior(playerid,9);
                SetPlayerFacingAngle(playerid,0.0);
                SetPlayerPos(playerid, 315.856170,1024.496459,1949.797363);
                SetCameraBehindPlayer(playerid);
                InAndrom[playerid] = vehicleid;
                return 1;
            }
        }
        counter++; //decrease by one when they leave the interior
        SetPlayerInterior(playerid,9);
        SetPlayerVirtualWorld(playerid, counter);
        SetPlayerFacingAngle(playerid,0.0);
        SetPlayerPos(playerid, 315.856170,1024.496459,1949.797363);
        SetCameraBehindPlayer(playerid);
        InAndrom[playerid]=vehicleid;
        return 1;
    }
    //else if
    return 1;
}
That should work better i think.

EDIT: Come to think of it you could send the players to a virtualworld that is the vehicleid that way you know players will only see each other in the same vehicle... can't beleive i never thought of that before.
pawn Код:
SetPlayerVirtualWorld(playerid, vehicleid);//much better method
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)