Jump to content

Need help in creating spawn points.


Recommended Posts

I got a little problem in understanding the scripting in MTA, I used to play SA-MP before but, creating a spawn point or simply creating a script in MTA seems hard for me. I can't find any simple explanation without the scripting language as an answer.

BTW, back in SA-MP im using the EDITOR and PAWNO to create spawn locations. It was very simple.

Link to comment

Hello new MTA coder,

My name is Chris, and I would be happy to help you learn Lua. I am assuming you are using the 'play' gamemode/resource, with this you will need to modify the broph.map file in the 'play' resource. Scroll through that file until you find something like this:

<spawnpoint id="ranch" posX="-711" posY="957" posZ="12.4" rotation="90"></spawnpoint> 
<spawnpoint id="pirate" posX="2005" posY="1543" posZ="13.5" rotX="270"></spawnpoint> 
<spawnpoint id="grove" posX="2485" posY="-1667" posZ="13.3" rotX="0"></spawnpoint> 
<spawnpoint id="hill" posX="-2405" posY="-598" posZ="132.6" rotX="128"></spawnpoint> 

Now this part is very basic, you can remove some of those spawn points, yours already might only have 1 spawnpoint, too add more just copy and paste the line down to make another. You will need to specify as unique id with each spawn point, it doesn't matter what it is, also you can set the posX, posY, posZ positions, to find these just use the freeroam resource and press F1, and you will see the positions there.

I hope this has helped you, happy coding

Link to comment

You cannot technically 'create' a spawn point - such thing does not exist in MTA itself. The thing which exists is a function:

spawnPlayer 

You can use it to script the spawn points (if you're making your own gamemode) - that's where the true simplicity comes from :) There's also a Spawnmanager resource (basic spawn point functions) among the standard MTA resources. If you use another gamemode, it may have its own specific spawn system or use the Spawnmanager resource.

SA-MP scripting looked easier to me when I had just come to MTA, but when I got familiar with MTA scripting, I had no problems with it. In contrast, when I tried some SA-MP scripting a few months ago after a long break, it was really confusing. After all, SA-MP may have some things easier to make, but often at the cost of reduced flexibility. For example, you may just call a function to make a GUI window show up. In MTA, you need to create the parts of the window (such as buttons, text fields) yourself, what needs more than one function call, but in exchange, you have the freedom to make the window contain whatever you want :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...