Jump to content

Scripting Tutorial 1 - User selectable warp points


ijsf

Recommended Posts

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

  • MTA Team
Posted
oops, Lua is the language BUT you can write this in notepad! or Luaedit.

Q: Can I put this script in gta sa and play with it in SP? if so, how?

No, since you need MTA to run it.
Posted

Maybe I'm just stupid right now, but if another player than the one who created the teleporter steps into it and triggers the 'Script_onPlayerClick' Function, will it not beam the owner of the teleporter to the destination?

Posted

LOL @ some of the posts, its like they have stared at the tutorial / past months news but not actually read it

What program whas this script made? mIRC?

LOL

Posted
Maybe I'm just stupid right now, but if another player than the one who created the teleporter steps into it and triggers the 'Script_onPlayerClick' Function, will it not beam the owner of the teleporter to the destination?

I assume you mean the onMarkerHit event, not the onPlayerClick event.

Have a look at the function that warps you:

[lua]setElementPosition ( player, x, y, z )[/lua]

And the event function itself:

[lua]function Script_onMarkerHit ( player )[/lua]

This means it'll warp whoever triggered the event.

Posted

where I can get LUA soft? plz give me a link to a needed version :!:

Posted

driver2, thanx for info, but I've already downloaded LUAedit. I can open , edit and compile lua files with it.

-----------------------------------------

Good tutorial. And added video is great.

So we can create our own scripts, but can't test them?

One thing we needed too is 1-2 player server+client to test scripts.

Posted
Uhm. That was short. =S

These are only examples. They're meant to be as simple as possible. We won't be showing complicated game modes with hundreds of lines of code.

Posted

It would be possible for us to make a single-player mod for MTA, which would just start the game normally, but also give access to a lot of features that aren't specific to multiplayer, including scripting, but I think we'll just be improving deathmatch for a while.

Posted
What program whas this script made? mIRC?

Yes, this is clearly mIRC-style scripting ;)...not

oops, Lua is the language BUT you can write this in notepad! or Luaedit.

Q: Can I put this script in gta sa and play with it in SP? if so, how?

I won't recommend Luaedit, it wiped my scripts directory 2 times. The directory contained very advanced scripts which where EXTREMLY fun. QA Team knows ;)

Edit:

What's up with the new 'onResourceLoad', do I have to change my scripts AGAIN?

Posted

I've got another question.

[lua]

addEventHandler ( "onMarkerHit", getRootElement(), "Script_onMarkerHit" )

function Script_onMarkerHit ( player )

[/lua]

How can i define which variables are passed to the function by the event handler? Or how do i know which variables are passed by existing event handlers?

Maybe a little too indepth for this tutorial, this is probably something for later tutorials.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...