Jump to content

Problem with my scripting


Traxy

Recommended Posts

Hey! i have figured out that i wona start creating a server and want to learn how to script! :D

But my problems comes alredy at the werry beginning!...

This is my code!

______________________________________________________________________________

addEventHandler("onPlayerJoin", getRootElement(), joinHandler)" />

________________________________________________________________________________

and when i try to start the server with this code

it pops up a ERROR mesg on the command prompt

ERROR coulden`t parse meta file for resource "myserver"

What dose this mean actualy?

when i start up my "script" program i get a new Error mesg that says

"missing attribute value attribute" on som of the sentense i got that i code

But what dose this actualy means?.. what must i do to get this server up going? :P

am onestly a noob on this thing so i hope some of you guys or girls coud help me out a litle!

am REALY greatfoul for those who help me out! you thank you so mutch for helping me!

and yeah one more thing.... HAPPY NEW YEAR! :D

Link to comment

That's because you put it all on one file, it should be two separate files: meta.xml, and the script that we can call it: script.lua, so it would look like this:

meta.xml:

"YourName" type="gamemode" name="My Server" description="My first MTA server" /> 

script.lua:

local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10 
function joinHandler() 
spawnPlayer(source, spawnX, spawnY, spawnZ) 
fadeCamera(source, true) 
setCameraTarget(source, source) 
outputChatBox(" Welcome to My Server ", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 

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...