Jump to content

Basic Problem


Fishy

Recommended Posts

Okay, So I have a resource that I can't start in the admin panel, the name does not even appear in the panel so I can't find it.

It's a welcome message.

The file is located here

C:\Program Files (x86)\MTA San Andreas 1.4\server\mods\deathmatch\resources

It is called message

C:\Program Files (x86)\MTA San Andreas 1.4\server\mods\deathmatch\resources\message

It has two folders inside, one is a .xml and one is a .lua

I am nameing them : message.lua and meta.xml

Names:

message.lua & meta.xml

Here are the codes for them

Note : I am making a script not gamemode

Meta.xml file

message.lua file:

function greetPlayer ( )

local joinedPlayerName = getPlayerName ( source )

local serverName = getServerName( )

outputChatBox ( "Welcome " .. joinedPlayerName .. " to ".. serverName .."!" , source, 255, 255, 255 )

end

addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer )

Please help me!

Link to comment
  • MTA Team
  

    "some_name" author="Fishy" type="script" version="1.0.0" /> 
    

I corrected your meta.xml.

@Fishy: Did you refresh your resources with /refresh (you can also write 'refresh' without the ' in the server console)

Link to comment

Okay, I fixed the problem. I now can find the resource and run it successfully, but it seems the code is broken.

I took the code from wiki

function greetPlayer ( )

local joinedPlayerName = getPlayerName ( source )

local serverName = getServerName( )

outputChatBox ( "Helllo " .. joinedPlayerName .. " Wekcome to ".. serverName .."!" , source, 255, 255, 255 )

end

addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer )

Btw, the problem was i named my meta "meta.xml" and you only have to name it "meta"

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