How to use 2 same interiors?
#1

Hello all

I want to use the same pizza interiors. So i i will make 2 pizza i exit in the wrong position.
So i want to make that i can use 2 same interiors and exit right.
i used the setplayervirtualworld, its not working.
Reply
#2

Two different Virtual World
Reply
#3

already try it but not work
Reply
#4

Quote:
Originally Posted by ScRipTeRi
Посмотреть сообщение
already try it but not work
then somethings wrong on your code, VirtualWOrld is the best
IsPlayerRangeOfPoint(.....) && GetPlayerVirtualWorld
Reply
#5

Quote:
Originally Posted by ScRipTeRi
Посмотреть сообщение
already try it but not work
Weird, mind at least showing us your code, because I used to do this technique and it works great, no problem

Example Code
pawn Код:
public OnGameModeInit()
{
    //Parameter | CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
    CreateDynamicPickup(1318, 2, 1.0, 2.0, 3.0, 0, 0, -1, 50.0);
    CreateDynamicPickup(1318, 2, 4.0, 5.0, 6.0, 1, 17, -1, 50.0);

    CreateDynamicPickup(1318, 2, 2.0, 4.0, 6.0, 0, 0, -1, 50.0);
    CreateDynamicPickup(1318, 2, 8.0, 10.0, 12.0, 2, 17, -1, 50.0);
}
Reply
#6

pawn Код:
new PIZZA_CP_ENTER;
new PIZZA_CP_EXIT;
//OnGameMode
PIZZA_CP_ENTER = CreateDynamicCP(-1721.3024,1359.6718,7.1853, 1.0);
PIZZA_CP_EXIT = CreateDynamicCP(372.4466,-133.1455,1001.4922, 1.0);
//OnPlayerEnterDynamicCP
if(checkpointid == PIZZA_CP_ENTER)
    {
    SetPlayerPos(playerid, 372.3520,-131.6510,1001.4922);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid, 359.9000);
    SetPlayerInterior(playerid, 5);
    SetPlayerVirtualWorld(playerid, 5);
    }
    if(checkpointid == PIZZA_CP_EXIT)
    {
    SetPlayerPos(playerid, -1725.8900,1359.3400,7.1875);
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle(playerid, 96.0000);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    }
this is my code
Reply
#7

This should work, just check the correct parameter of CreateDynamicCP and you will figure it out

pawn Код:
new
    PIZZA_CP_ENTER,
    PIZZA_CP_EXIT
;

public OnGameModeInit()
{
    //Parameter | CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid, Float:distance = 100.0);
    PIZZA_CP_ENTER = CreateDynamicCP(-1721.3024,1359.6718,7.1853, 1.0, 0);
    PIZZA_CP_EXIT = CreateDynamicCP(372.4466,-133.1455,1001.4922, 1.0, 1);
    return true;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == PIZZA_CP_ENTER)
    {
        SetPlayerPos(playerid, 372.3520,-131.6510,1001.4922);
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle(playerid, 359.9000);
        SetPlayerInterior(playerid, 5);
        SetPlayerVirtualWorld(playerid, 5);
    }
    if(checkpointid == PIZZA_CP_EXIT)
    {
        SetPlayerPos(playerid, -1725.8900,1359.3400,7.1875);
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle(playerid, 96.0000);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
    }
    return true;
}
Reply
#8

If you want to each players see interior with different virtual world use this:
pawn Код:
new PIZZA_CP_ENTER;
    new PIZZA_CP_EXIT;
    //OnGameMode
    PIZZA_CP_ENTER = CreateDynamicCP(-1721.3024,1359.6718,7.1853, 1.0);
    PIZZA_CP_EXIT = CreateDynamicCP(372.4466,-133.1455,1001.4922, 1.0);
    //OnPlayerEnterDynamicCP
    if(checkpointid == PIZZA_CP_ENTER)
    {
        SetPlayerPos(playerid, 372.3520,-131.6510,1001.4922);
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle(playerid, 359.9000);
        SetPlayerInterior(playerid, 5);
        SetPlayerVirtualWorld(playerid, playerid+1);
    }
    if(checkpointid == PIZZA_CP_EXIT)
    {
        SetPlayerPos(playerid, -1725.8900,1359.3400,7.1875);
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle(playerid, 96.0000);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
    }
Reply
#9

it don't work again :/
Reply
#10

In the exit checkpoint check for

pawn Код:
// Example

if (GetayerVirtualWorld(playerid) == 5)  
{
   // shop exit 1 set pos of 1st shop and vw 0
}
else if(GetPlayerVirtualWorld(playerid) == 6)
{
// Shop exit 2 - set pos of second shop exit and vrtual world to 0
}

// Your code

 public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
* * if(checkpointid == PIZZA_CP_ENTER)
* * {
* * * * SetPlayerPos(playerid, 372.3520,-131.6510,1001.4922);
* * * * SetCameraBehindPlayer(playerid);
* * * * SetPlayerFacingAngle(playerid, 359.9000);
* * * * SetPlayerInterior(playerid, 5);
* * * * SetPlayerVirtualWorld(playerid, 5);
* * }
* * if(checkpointid == PIZZA_CP_EXIT)
* * {
        if(GetPlayerVirtualWorld(playerid) == 5)
        {
* * * * SetPlayerPos(playerid, -1725.8900,1359.3400,7.1875);
* * * * SetCameraBehindPlayer(playerid);
* * * * SetPlayerFacingAngle(playerid, 96.0000);
* * * * SetPlayerInterior(playerid, 0);
* * * * SetPlayerVirtualWorld(playerid, 0);
        }
        else..
// example given above
Ignore the stars in code, copied with mobile.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)