05.12.2011, 03:38
(
Last edited by SnG.Scot_MisCuDI; 28/12/2011 at 08:41 PM.
)
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;
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 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);
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;
}
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;
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!