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

https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld
https://sampwiki.blast.hk/wiki/SetVehicleVirtualWorld

Use them only players in the same virtualworld can see see each other, same for vehicles.

EDIT: If you want a different virtual world for each one use an integer variable as a counter and set the world of the player/vehicle to that number. And increase it by one everytime its used.

eg,
pawn Код:
new counter;//global

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 592 && ispassenger == 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;
}
If you want players in the same vehicle to see each other you will need to check if a player is already in the vehicle and if so... Set The player who is entering to the same world as the player in the vehicle......... (and thats why i don't write tutorials)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)