SA-MP Forums Archive
/enter and /exit error - 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: /enter and /exit error (/showthread.php?tid=541577)



/enter and /exit error - EmilLykke - 12.10.2014

Hello there.

I have these three positions for a police department, it's three different places. But I want the /enter's to go to the same point, but different virtual worlds...


Here are the codes.
Number one works fine, but the other two doesn't work.

The /enter's works perfectly fine. But the /exit's doesn't work out. Only number one.
Please have a close look, and tell me the issue. Thanks.

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 1525.2760, -1677.8524, 5.8906)) { // LSPD ARMOURY
            SetPlayerPos(playerid, 316.524993, -167.706985, 999.593750);
            SetPlayerVirtualWorld(playerid, 6775);
            SetPlayerInterior(playerid, 6);
        } else if(IsPlayerInRangeOfPoint(playerid, 5, 2101.1606, -1360.3644, 23.9844)) { // LSPD ARMOURY
            SetPlayerPos(playerid, 316.524993, -167.706985, 999.593750);
            SetPlayerVirtualWorld(playerid, 6776);
            SetPlayerInterior(playerid, 6);
        } else if(IsPlayerInRangeOfPoint(playerid, 5, 941.09, -1718.44, 13.97)) {
            SetPlayerPos(playerid, 316.524993, -167.706985, 999.593750);
            SetPlayerVirtualWorld(playerid, 6777);
            SetPlayerInterior(playerid, 6);
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 316.524993, -167.706985, 999.593750))  // LSPD ARMOURY
    {
        new world = GetPlayerVirtualWorld(playerid);
        if(world == 6775)
        {
            SetPlayerPosEx(playerid, 5, 1525.2760, -1677.8524, 5.8906);
            SetPlayerVirtualWorld(playerid, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5, 316.524993, -167.706985, 999.593750)) // LSPD ARMOURY A
    {  
        new world = GetPlayerVirtualWorld(playerid);
        if(world == 6776)
        {
            SetPlayerPosEx(playerid, 5, 1525.2760, -1677.8524, 5.8906);
            SetPlayerVirtualWorld(playerid, 0);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5, 316.524993, -167.706985, 999.593750)) // LSPD ARMOURY B
    {
        new world = GetPlayerVirtualWorld(playerid);
        if(world == 6777)
        {
            SetPlayerPosEx(playerid, 5, 941.09, -1718.44, 13.97);
            SetPlayerVirtualWorld(playerid, 0);
        }
    }



Re: /enter and /exit error - EmilLykke - 12.10.2014

The weird thing is, the first one works...


Re: /enter and /exit error - Abagail - 12.10.2014

You are doing it wrong. The correct way would be,
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 316.524993, -167.706985, 999.593750))  // LSPD ARMOURY
    {
        new world = GetPlayerVirtualWorld(playerid);
        if(world == 6775)
        {
            SetPlayerPosEx(playerid, 5, 1525.2760, -1677.8524, 5.8906);
            SetPlayerVirtualWorld(playerid, 0);
        }
        else if(world == 6776)
        {
            SetPlayerPosEx(playerid, 5, 1525.2760, -1677.8524, 5.8906);
            SetPlayerVirtualWorld(playerid, 0);
        }
        else if(world == 6777)
        {
            SetPlayerPosEx(playerid, 5, 941.09, -1718.44, 13.97);
            SetPlayerVirtualWorld(playerid, 0);
        }
    }



Re: /enter and /exit error - EmilLykke - 12.10.2014

Thank you very much! It worked out... Funny I was stupid enough not to think about that though...