SA-MP Forums Archive
How to use 2 same interiors? - 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)
+--- Thread: How to use 2 same interiors? (/showthread.php?tid=483319)



How to use 2 same interiors? - ScRipTeRi - 25.12.2013

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.


Re: How to use 2 same interiors? - Patrick - 25.12.2013

Two different Virtual World


Re: How to use 2 same interiors? - ScRipTeRi - 25.12.2013

already try it but not work


Re: How to use 2 same interiors? - ToiletDuck - 25.12.2013

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


Re: How to use 2 same interiors? - Patrick - 25.12.2013

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



Re: How to use 2 same interiors? - ScRipTeRi - 25.12.2013

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


Re: How to use 2 same interiors? - Patrick - 25.12.2013

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



Re: How to use 2 same interiors? - Aliassassin123456 - 25.12.2013

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



Re: How to use 2 same interiors? - ScRipTeRi - 25.12.2013

it don't work again :/


Re: How to use 2 same interiors? - Cypress - 25.12.2013

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.