SA-MP Forums Archive
GetPlayerVirtualWorld(playerid) - 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: GetPlayerVirtualWorld(playerid) (/showthread.php?tid=405979)



GetPlayerVirtualWorld(playerid) - Buzzbomb - 08.01.2013

I dont know what it is but this code Sucks it dont work it skips what the hell its tould to do..
Does what it wants to do


/enter works Great .... Takes you to the right Place
pawn Код:
CMD:enter(playerid,params[])
{
else if(IsPlayerInRangeOfPoint(playerid, 5.0,1743.4860,-1795.7599,13.6674))// Los Santos Fire Station Entrance....
    {
         SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
         SetPlayerFacingAngle(playerid, 248.4081);
         SetCameraBehindPlayer(playerid);
         SetPlayerInterior(playerid,6);
         SetPlayerVirtualWorld(playerid, 4);
         format(string, sizeof(string),"Welcome To San Fierro Fire Department");
         SendClientMessage(playerid, ORANGE,string);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0,1748.4948,2080.3115,10.8203))// Las Ventures Fire Station Entrance....
    {
         SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
         SetPlayerFacingAngle(playerid, 248.4081);
         SetCameraBehindPlayer(playerid);
         SetPlayerInterior(playerid,6);
         SetPlayerVirtualWorld(playerid, 5);
         format(string, sizeof(string),"Welcome To San Fierro Fire Department");
         SendClientMessage(playerid, ORANGE,string);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0,-2025.3016,67.0200,28.4671))// San Fierro Fire Station Entrance....
    {
         SetPlayerPos(playerid,246.783996,63.900199,1003.640625);
         SetPlayerFacingAngle(playerid, 248.4081);
         SetCameraBehindPlayer(playerid);
         SetPlayerInterior(playerid,6);
         SetPlayerVirtualWorld(playerid, 6);
         format(string, sizeof(string),"Welcome To San Fierro Fire Department");
         SendClientMessage(playerid, ORANGE,string);
    }
        return 1;
}
/exit No it dont work it takes you to The first Command San Fierro Fire Department Virtual worlds are Being Set And Showing On command when i type /iwinfo It Sends me a message stating that im in that interior and virtual world but the damn exit sends me to san fierro no matter what i DO here the code..
pawn Код:
CMD:exit(playerid,params[])
{
else if(IsPlayerInRangeOfPoint(playerid, 5.0,246.783996,63.900199,1003.640625)) // San Fierro Fire Station Entrance....
        {
            if(GetPlayerVirtualWorld(playerid) == 6)
            {
                SetPlayerPos(playerid,-2025.3016,67.0200,28.4671);
                SetPlayerFacingAngle(playerid, 248.4081);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if(GetPlayerVirtualWorld(playerid) == 4)
            {
                SetPlayerPos(playerid,-2025.3016,67.0200,28.4671);
                SetPlayerFacingAngle(playerid, 248.4081);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if(GetPlayerVirtualWorld(playerid) == 5)
            {
                SetPlayerPos(playerid,-2025.3016,67.0200,28.4671);
                SetPlayerFacingAngle(playerid, 248.4081);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid,0);
                SetPlayerVirtualWorld(playerid, 0);
            }
            return 1;
    }

OMFG "facepalm" Nevermind I see the problem but there others but they dont have same Exit cords but u stay in the interior and u never leave


Re: GetPlayerVirtualWorld(playerid) - Tom1412 - 08.01.2013

in each command you start with else if, you should start the first of with if, then else if


Re: GetPlayerVirtualWorld(playerid) - RedCrossER - 08.01.2013

Start with only if in first statement


Re: GetPlayerVirtualWorld(playerid) - kaisersouse - 08.01.2013

Quote:
Originally Posted by RedCrossER
Посмотреть сообщение
Start with only if in first statement
This. You're opening w/ an 'else'


Re: GetPlayerVirtualWorld(playerid) - Buzzbomb - 10.01.2013

I fixed it .. Thanks for the replies.. Cant Do else If.. Wont work had add all same Interior and Cordinates to one if Statement then everything work flowlessly