[Tutorial] Making Houses With Pickups
#1

Making Houses With Pickups


Okay so, many of us cant figure out checkpoints or its just too confusing. This is a simple way of making a pickup make you go into a interior or even a teleport to a location.
This is NOT a house ownership script.

This can also be use to just make a player teleport on pickup.

Okay, to start out we need our coordinates. Go to the location [in game] and do /save (name). This will save the coordinates. To find them go to: My Documents\GTA San Andreas User Files\SAMP In there, there is a file named: savedpositions

Now we need to open pawno to start scripting.

At the top under includes put.
pawn Code:
new house;
We will need this for the pickup.

Moving on. Now we need to define the "house" with a pickup.
To make the location of the pickup we will need to do this:

pawn Code:
house = CreatePickup(model,type, Float:X, Float:Y, Float:Z, Virtualworld);
For more info on model and type click their names.
For the X Y Z get the coordinates we saved in-game.

In this case i will be using pickup id (model) 19133 (red arrow)
Add this under OnGameModeInit()
pawn Code:
house = CreatePickup(19133, 1, 1641.7367,2044.9491,11.3199, -1);
The -1 means it will show up in all worlds.

How do i get the coordinates? Easy, go into the folder i posted at the top, and you want to copy the bolded numbers (on yours not mine): AddPlayerClass(294,1595.4994,2038.1703,11.4688,88.6041,0,0,0,0,0,0); // house

Ok now we made the first pickup!
Next we need to make the pickup teleport us to a location. under:
for interior location and ids: https://sampwiki.blast.hk/wiki/InteriorIDs
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
    if(pickupid == house)
    {
        SetPlayerPos(playerid,Float: X, Float: Y, Float: Z:); // X, Y, Z are the coordinates they will be teleported to when they walk into pickup.
        SetPlayerInterior(playerid, (id)); // this is the interior id they will be set to.
        return 1;
    }
in my case it will look like:
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == house)
    {
        SetPlayerPos(playerid,-2645.3020,1408.5741,906.2734);
        SetPlayerInterior(playerid, 3);
        return 1;
    }

Now, when you walk into the pickup you will be teleported to the location. Since this is for a house, when you are inside the house you will need to get the new coordinates for the exit door Pickup and the new coordinates for when you walk into the exit pickup. For that follow the steps but instead of
pawn Code:
new house;
you would use
pawn Code:
new houseexit;

Hope this helped! This is my first tutorial so cut me some slack! If you have any problems let me know and ill help. And if i forgot anything leave a comment. Give some rep if it helped!
Reply


Messages In This Thread
Using Pickups (houses) - by SnG.Scot_MisCuDI - 05.12.2011, 03:38
Re: Making Houses With Pickups - by System64 - 05.12.2011, 05:11
Re: Making Houses With Pickups - by Thresholdold - 05.12.2011, 05:42
Re: Making Houses With Pickups - by [HiC]TheKiller - 05.12.2011, 06:53
Re: Making Houses With Pickups - by BlackRolePlay - 05.12.2011, 17:49
Re: Making Houses With Pickups - by bartje01 - 05.12.2011, 18:28
Re: Making Houses With Pickups - by PlayHard - 05.12.2011, 19:45
Re: Making Houses With Pickups - by SnG.Scot_MisCuDI - 05.12.2011, 21:00
Re: Making Houses With Pickups - by SnG.Scot_MisCuDI - 05.12.2011, 21:02
Re: Making Houses With Pickups - by olabv - 06.12.2011, 13:09

Forum Jump:


Users browsing this thread: 1 Guest(s)