[SOLVED] Using Pickups to enter a building
#1

Alright I have this

Код:
new tostudio;
new fromstudio;


public OnGameModeInit()

tostudio = CreatePickup(1239, 1, X, Y, Z);
fromstudio = CreatePickup(1239 , 1, X, Y, Z);


public OnPlayerPickupPickup()

if(pickupid == tostudio)
SetPlayerPos(playerid, X, Y, Z);
SetPlayerInterior(playerid, 5);

if(pickupid == from studio)
SetPlayerPos(playerid, X, Y, Z);
And when I go to test it,,, I can get into the building just fine... But when i go to exit the building,,, I run into the pickup,, and everything just goes gray 0_o like im running in some blank space..

Could someone tell me what im doing wrong
Reply
#2

You need to
pawn Код:
SetPlayerInterior(playerid, 0);
When you exit.
Reply
#3

That didnt work either... It just took me to some random place on the map really high in the air and droped me =/
Reply
#4

What have you put as the X, Y and Z variables because they are most probably wrong.
Reply
#5

here is what i have exactly

Код:
new towlvi;
new fromwlvi;

public OnGameModeInit()
{

towlvi = CreatePickup(1239, 1, 2462.7932,2244.4746,10.8203);//ICON OUTSIDE BUILDING
fromwlvi = CreatePickup(1239, 1, 1298.8892,-796.4041,1084.0078);//ICON INSIDE BUILDING

return 1;
}


public OnPlayerPickupPickup(playerid, pickupid)
{

if(pickupid == towlvi)
SetPlayerPos(playerid, 1299.1359,-794.6379,1084.0078);
SetPlayerInterior(playerid, 5);

if(pickupid == fromwlvi)
SetPlayerPos(playerid, 2462.8064,2240.8918,10.8203);

return 1;
}
Reply
#6

pawn Код:
new towlvi;
new fromwlvi;

public OnGameModeInit()
{
  towlvi = CreatePickup(1239, 1, 2462.7932,2244.4746,10.8203);//ICON OUTSIDE BUILDING
  fromwlvi = CreatePickup(1239, 1, 1298.8892,-796.4041,1084.0078);//ICON INSIDE BUILDING
  return 1;
}


public OnPlayerPickupPickup(playerid, pickupid)
{
  if(pickupid == towlvi)
  {
    SetPlayerPos(playerid, 1299.1359,-794.6379,1084.0078);
    SetPlayerInterior(playerid, 5);
  }
  if(pickupid == fromwlvi)
  {
    SetPlayerPos(playerid, 2462.8064,2240.8918,10.8203);
    SetPlayerInterior(playerid, 0);
  }
  return 1;
}
Reply
#7

Sweet thanks guys... Works just fine now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)