[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
#2

are you okay? I think no, because there is not H of houses, just pickups, toutorial realy bad
Reply
#3

I agree, this is a good tutorial, but it shows how to use pickups, not really anything house related.
Reply
#4

A few errors with your code :P. You're missing a pair of brackets in your fourth code snippet and your fifth code snippet is missing a closing bracket. Also, this
pawn Code:
SetPlayerPos(playerid,Float: X, Float: Y, Float: Z:); // X, Y, Z are the coordinates they will be teleported to when they walk into pickup.
You should tell them that they need to replace the Float's as well as the variables, people might get confused .
Otherwise, it's a OK tutorial for your first .
Reply
#5

This is very bad for first tut when i first looked up at the title i was thinking that he is making a tutorial on how to make a the green house pickup wich is 1273 then i saw that u only send player to interior this is not so good tut man.
Reply
#6

It seems that you guys didn't read his thread? He says that it's not related to anything with the ownership of a house. It just shows how to use pickups .
Reply
#7

Quote:
Originally Posted by bartje01
View Post
It seems that you guys didn't read his thread? He says that it's not related to anything with the ownership of a house. It just shows how to use pickups .
Basically, there are houses using 'pickups' and 'checkpoints'. They took this one as a house system using pickups not checkpoints and thank you thread maker. This will help some people using pickups .
Reply
#8

Quote:
Originally Posted by bartje01
View Post
It seems that you guys didn't read his thread? He says that it's not related to anything with the ownership of a house. It just shows how to use pickups .
exactly. Thank you! lol
Reply
#9

Quote:
Originally Posted by System64
View Post
are you okay? I think no, because there is not H of houses, just pickups, toutorial realy bad
Your spelling is pretty bad.. Are you okay?
Reply
#10

well, what you just did was making a pickup outside a house and inside the house. then you made a command wich is /enter and /exit?

to be honest i dont think this can be called a house making tutorial. more like a pickup making tutorial

anyway, Good Job
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)