Jump to content

Current RP Script


Deddalt

Recommended Posts

Alright, well, I have been working on making an RP server with a few friends of mine, and currently, I think it has gone quite well. I have started creating the script and have had a lot of help from those of you here on the MTA forums. I have a problem where I can't test-run my MTA script, so I don't know if anything is wrong with my script. I figure I'll tackle that problem first.

My script is located at: c:/program files/MTA San Andreas/server/mods/deathmatch/resources/rrp/

My folder contains: Revolution.lua, client/client.lua, meta.xml, and other small scripts to help out.

My meta.xml contains:

    "Maverick" type="server" name="rrp" description="rrp" /> 
    

When I run the MTA server, I type "gamemode rrp", which is the name of the folder that all of this is contained in. Immediately when I start the MTA server it tells me "Could not parse 'settings.xml' file . Starting with an empty settings registry." I attempt "gamemode rrp", and it returns " 'rrp' is not a valid gamemode."

Now that I have that problem out of the way, I'd like to ask if anyone can tell me if there are errors in this script, to the best of my knowledge (which is minimal), I can't find anything wrong with this script, other than some unfinished commands, which I already know about and plan on fixing.

My current script is located at : http://www.pastebin.com/f8ad3762

I'd be grateful if you could alert me to any errors in this script, also if you could help me with my gamemode issue. Also, I heard that setAccountData only sets the data for that session, if that is correct, I have to start over with this script. Is this true?

Link to comment
Also, I heard that setAccountData only sets the data for that session, if that is correct, I have to start over with this script. Is this true?

Yes, this is true for DP2. The account data is erased when the server shuts down. It is supposedly solved in DP3 so my advice is to keep the script because it should work in the next release.

Link to comment

Thank god, I was going to cry if I had to rewrite the script. Also, is it possible for the player to modify their account info? I have some understanding that the account data is saved on THEIR computer, which could mean that they can edit it. If that's true, I need to find a way to write their account data to my server.

Link to comment

The first error you get can be safely ignored and the second one is because you used type="server" in your info tag in the meta.xml but it should be type="gamemode" if you want to start the resource using "gamemode rrp". The attribute "type" in the info tag specifies the type of the whole resource (which is important for other resources like mapmanager/votemanager and so on) so it can be either a "gamemode" a "map" or anything else when it's just used as a utility script.

Link to comment

Woah thats a lot of code ;)

Errors:

You forgot "then" really really really often.

You forgot to use "elseif" instead of "if" at some parts where it was needed.

You wrote "or or" two times.

(Syntax:)

if blah == poo then --Note that using brackets like " if (blah == poo) then" is optional 
--do this 
elseif blah ~= poo then 
--do that 
else 
--do nothing 
end 

If you use "elseif" or "else" after you made an if check there is no second "end" needed just one to close the first "if" line.

Anyway i corrected all syntax mistakes and i commented non-working parts/lines out. You will see them so you can fix it yourself.

http://deddalt.pastebin.com/m4e5ce68b

The second script seemed to be ok but i renamed all "next" to "nextt" because next is a global function or whatever that is used by lua.

http://deddalt.pastebin.com/m5c1ae81

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