SA-MP Forums Archive
Virtual World... - 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: Virtual World... (/showthread.php?tid=309343)



Virtual World... - dorperez - 07.01.2012

Hey Guys !

Sorry for bumping previuse topic..

I have been downloaded this interior ( https://sampforum.blast.hk/showthread.php?tid=93619 ) and I want do that when player enter to vehicle number 51 it will teleport me to the interior.

Tnx guys !!


Re : Virtual World... - rbcrp - 07.01.2012

Код:
OnPlayerStateChange(playerid, newstate, oldstate) 
{
     new carid = GetPlayerVehicleID(playerid);
     new carmodel = GetVehicleModel(carid);
     if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
     {
          if(carmodel == 51)
          {
               SetPlayerInterior(playerid, interiorid);
               SetPlayerPos(playerid, x, y, z);
          }
          else return SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z); <--brings the car also
     }
}
This should work but if it doesnt please feel freee to message me on here and i can try to help you with you're issues.

Try this, if it doesnt work then please feel free to show me what happens or you're errors.

I ican try to hel pyou out as much as posisble.


Re: Virtual World... - dorperez - 08.01.2012

Hey man tnx for the replay

It doesn't teleport me to the interior =\

If you can see in the system there is line:

pawn Код:
if(newstate == PLAYER_STATE_PASSENGER && GetPlayerVehicleID(playerid) == 57)
    {
        SetPlayerPos(playerid, 2084.479980, -1374.825928, 300.628052);
        SetPlayerFacingAngle(playerid, 0);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 1);
        Inenforcer[playerid] = GetPlayerVehicleID(playerid);
    }
Now when I am adding SetPlayerVirtualWorld(playerid, 1); it teleport me to the interior normaly but I am falling from the sky..




Re : Virtual World... - rbcrp - 08.01.2012

did you change interiorid to the one that you are trying to go to?


Re: Virtual World... - dorperez - 08.01.2012

No man, When I download the system it was defineded like this..


Re: Virtual World... - dorperez - 11.01.2012

Help plz