#1

Okey, so I have been scripting and doing checkpoints to go in an interior and out of it using /enter and /exit. The problem is that if i have two ''barber shops'' and one interior. I've did the same co-oridates and when you go in it's all good but when I try and go out the side goes out from a different one.

Example:

I went into the Barber Shop of Idlewood, *goes into the interior* when i go out of the shop using /exit than i go out from the ''Barber Shop'' located at Market near the Burger Shot. If someone can help me out in this problem please I would appricete it very much. Maybe someone can give me an example using such as this tutorial:


https://sampforum.blast.hk/showthread.php?tid=330001
Reply
#2

Show us what you made so far.
Reply
#3

Okey, i'll show you an example of how i did it:

Example:


pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2116.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 4366.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
        }
    }
    if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
    }
    return 1;
}
Reply
#4

Just change the world's IDs.

pawn Код:
SetPlayerVirtualWorld(playerid, worldid)
https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld

Example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2116.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
            SetPlayerVirtualWorld(playerid, 1)

        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 4366.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
            SetPlayerVirtualWorld(playerid, 2)
        }
    }
    if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0)
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0)
        }
    }
    return 1;
}
Reply
#5

Tried it and it didn't work, anyone can help please?
Reply
#6

When entering the Idlewood barber shop set the player's vw to 2 for ex.
However when entering the Market's barber shop set it to 3.

Now when you /exit, check the player's vw (GetPlayerVirualWorld) if its == 2, set the idlewood coords,
if its == 3 set the market exit coords.
Reply
#7

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
When entering the Idlewood barber shop set the player's vw to 2 for ex.
However when entering the Market's barber shop set it to 3.

Now when you /exit, check the player's vw (GetPlayerVirualWorld) if its == 2, set the idlewood coords,
if its == 3 set the market exit coords.
Can you give me an example with code cause i didn't really understand you.
Reply
#8

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
When entering the Idlewood barber shop set the player's vw to 2 for ex.
However when entering the Market's barber shop set it to 3.

Now when you /exit, check the player's vw (GetPlayerVirualWorld) if its == 2, set the idlewood coords,
if its == 3 set the market exit coords.
This is what he means:
Код:
   if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            if(GetPlayerVirtualWorld(playerid) == 2)
            {
              SetPlayerPos(playerid, 2116.3108,-1279.5417,13.5469);//AmmunationExit
            }
            else if(GetPlayerVirtualWorld(playerid) == 3)
            {
            SetPlayerPos(playerid, 4366.3108,-1279.5417,13.5469);//AmmunationExit
            }
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0)
        }
    }
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)