Virtual World !
#1

Hey Guys !

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 !!
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(GetPlayerVehicleID(playerid) == 51)
    {
      SetPlayerPos(playerid, X, Y, Z);
      SetPlayerFacingAngle(playerid, A);
    }
  }
  return 1;
}
replace X Y Z and A with some coords of an object from the map and later replace them with the correct coords
Reply
#3

When I am enter the vehicle as a passager I am falling...That how I defineded it:

pawn Код:
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  {
    if(GetPlayerVehicleID(playerid) == 55)
    {
        new Float:X, Float:Y, Float:Z;
        GetVehiclePos(Inenforcer[playerid], X, Y, Z);
        SetPlayerPos(playerid, X+4, Y, Z);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 1);
        Inenforcer[playerid] = 0;
        TogglePlayerControllable(playerid,0);
        SetTimerEx("wwelocker",1500,0,"i",playerid);
    }
  }
Reply
#4

Set the interior BEFORE you set the position. Otherwise there's the off chance that they'll fall slightly before you change the interior
Reply
#5

Nothing dude ...Help plz ..
Reply
#6

This might help you

Quote:
Originally Posted by Sir_Brock
Посмотреть сообщение
What Kye recommended to me was using a virtual world for the interior, so I did. On the spawn for Rappers (interior 5)/Grove (interior 2)/Drug Dealers (interior 12) on my server, I have made them spawn in virtual world 1.

And the in OnPlayerInteriorChange I have written this...
Код:
if((newinteriorid == 5 || newinteriorid == 2 || newinteriorid == 12) && GetPlayerVirtualWorld(playerid) == 0) SetPlayerVirtualWorld(playerid, 1);
if((oldinteriorid == 5 || oldinteriorid == 2 || oldinteriorid == 12) && newinteriorid == 0 && GetPlayerVirtualWorld(playerid) == 1) SetPlayerVirtualWorld(playerid, 0);
Kye says that he isn't sure whether this will be something that will be changed in 0.3b, so for now, this is the best solution going.
Reply
#7

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
This might help you
What should I do with that ?
Reply
#8

UP !!
Reply
#9

Help ...
Reply
#10

Didnt Worked

I have found this line
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 427)
    {
        SetPlayerPos(playerid, 2084.479980, -1374.825928, 300.628052);
        SetPlayerFacingAngle(playerid, 0);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 1);
        Inenforcer[playerid] = GetPlayerVehicleID(playerid);
    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)