Jump to content

Some questions reguarding scripting....


Guest Stephengp

Recommended Posts

Hello,

I wanted to start scripting for MTA:SA, but I have some questions first:

1) The code looks similar to C++, is it the same, because i see some scripts using "end" instead of "}".

2) What is the difference between server-side and client-side scripting?

3) Is it possible to make a script that you can use on someone else's server?

4) Can I make a script and then run MTA to use it without owning a server> (similar t question 3)

That's about it for now. Thanks for any help in advance,

Stephen

Link to comment
Hello,

I wanted to start scripting for MTA:SA, but I have some questions first:

1) The code looks similar to C++, is it the same, because i see some scripts using "end" instead of "}".

2) What is the difference between server-side and client-side scripting?

3) Is it possible to make a script that you can use on someone else's server?

4) Can I make a script and then run MTA to use it without owning a server> (similar t question 3)

That's about it for now. Thanks for any help in advance,

Stephen

1) No, lua is not the same as C++. It does share common keywords and control structure like C++ has, but the syntax is different in a lot of ways. See here for more info: http://lua-users.org/wiki/TutorialDirectory.

2) Well, client-sided scripts run on the clients’ computer while server-sided scripts run solely on the remote server. It’s pretty much like server/client-side programming for the web. You code programming logic on the server-side and front-end functionality on the client-side.

3) Yes, you can redistribute your scripts.

4) Yes, see 3 ;)

Link to comment

1) I wouldn't say Lua's syntax is very similar to C++.

Lua:

something = 1 
if something == 1 then 
    doSomething() 
else 
    doSomethingElse() 
end 

C++

int something = 1; 
if (something == 1) { 
    doSomething(); 
} 
else { 
    doSomethingElse(); 
} 
  

2) Server-side scripts are executed on the server while client-side scripts are downloaded for the client and executed locally. Some functions like GUI stuff can be used client-side only.

3) You can use any script on any server as long as you have admin access to it.

4) I'm not completely sure what you mean but you can't execute a script if you don't have admin access at the server.

Edit: Dang, Ace_Gambit was faster ;P

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