[Tutorial] How I Script interiors
#1

Hi, Welcome to my tutorial on how to script interiors.
Firstly, I am a beginner, And I know this isn't efficient but it works.

Now The Steps:

1. You will need the includes: a_samp and a_players

2. Above OnGameModeInit we have to create these lines:
They will make our Whatsimacallit's

pawn Код:
new House1Enter;
new House1Exit;
3. Under OnGameModeInit we will create our pickups

pawn Код:
(Press Tab Once)House1Enter = CreatePickup (Modelid, X, Y, Z, Virtualworld(Everyone can see -1);
(Press Tab Once)House1Exit = Createpickup (Modelid, X, Y, Z, Virtualworld);
Then on OnPlayerPickUpPickup make our functions that will let us into and out of the house.
pawn Код:
if(pickupid = House1Enter)
{
SetPlayerPos(Position Of The Interior);
SetPlayerInterior(playerid, Id Of the Interior);
return 1
}
if(pickupid = House1Exit)
{
SetPlayerPos(Position of where you want your exit, Not at the door move it further away);
SetPlayerInterior(playerid, 0)
return 1;
}
return 1;
Enjoy!
Reply
#2

You should write code out, so people can use it as examples, and instead of writing in where the code should be, comment outside of it (using the correct commenting syntax for pawn), as well as using the [pawn][/pawn] tags to wrap your code in.

Also, get the code right. You're using the equal sign incorrectly for an if comparing statement, you need to cover these things because newbies who read these tutorials to actually learn from are going to be very confused by what you've done when they try to compile it.
Reply
#3

This honestly should of just never been posted. Unless you intend to add some serious fixes and revisions to this, to make it an actually easy system to use for newer SA-MP coders.
Reply
#4

You seriously have nothing nice to say? It works fine for me, There's obviously some flaws but it works and thats the main thing!
Reply
#5

We're giving you tips on how you can improve your tutorial, you should be grateful instead of being rude that we actually took the time to give you some advice.
Reply
#6

Oh not you Calgon, You were nice. This Steven person is a rude SOB
Reply
#7

Use this instead:
pawn Код:
public OnPlayerPickupPickup(playerid, pickupid)
{
    if(pickupid == House1Enter)
    {
        SetPlayerPos(playerid, X, Y, Z);
        SetPlayerInterior(playerid, ID);
    }
    if(pickupid == House1Exit)
    {
        SetPlayerPos(playerid, X, Y, Z);
        SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Also, make this more clear, for example:
pawn Код:
CreatePickup(pickupid, type, X, Y, Z, VirtualWorld);
This way we know what to put, unlike;
pawn Код:
CreatePickup (Co-Ords,Co-Ords, Co-Ords, Virtualworld
Which doesn't tell me what co-ords go where. Do I put my X, Y and Z Co-ords three times? Which order do my co-ords go in? Where is the pickup model or type? Etc.
Reply
#8

What's next? A tutorial for using SendClientMessage?

Just kidding lool

Could be a little more detailed though (and saying that a_samp is required is bit 'well duh').
Reply
#9

We've all said pretty much the same thing, but i'm the Son Of a Bitch. Awesome.
Reply
#10

You're the one who said this shouldn't have been posted, that's not what I said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)