lalucidaniel Posted December 15, 2012 Share Posted December 15, 2012 Ok so I read mta scripting wiki Explain this a bit more for me: Second example - A gamemode /counterstrike /meta.xml /counterstrike.lua /buymenu.lua The counterstrike.lua contains similiar to the following features: Let players choose their team and spawn them Provide them with weapons, targets and instructions (maybe read from a Map, see below) Define the game's rules, e.g. when does the round end, what happens when a player dies .. and maybe some more The buymenu.lua is a clientside script and creates a menu to buy weapons This example can be called a gamemode, since it not only intereferes with the gameplay, but actually defines the rules of it. The type attribute indicates that this example works with the Map manager, yet another resource that was written by the QA Team to manage gamemodes and map loading. It is highly recommended that you base your gamemodes on the techniques it provides. This also means that the gamemode probably won't run without a map. Gamemodes should always be as generic as possible. An example for a map is stated in the next example. So I create a Counterstrike.lua (as example , mine is named different) for this script /counterstrike /meta.xml /counterstrike.lua /buymenu.lua then where do I place this one? And what to place in buymenu.lua ( I mean what commands) Link to comment
uhm Posted December 15, 2012 Share Posted December 15, 2012 that meta stuff ( ... ) goes in meta.xml and in the files with a lua extension you code the actual script it's actually on that very wiki page, bro check the section "Creating a working script" Link to comment
lalucidaniel Posted December 15, 2012 Author Share Posted December 15, 2012 so: /counterstrike /meta.xml /counterstrike.lua /buymenu.lua goes into script.lua I was told to make at the begining of the tutorial? Link to comment
uhm Posted December 15, 2012 Share Posted December 15, 2012 in script.lua you type stuff like 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) aight? so the actual LUA statements that determine what goes on in your server then theres a difference between server and client side scripts though: note that buymenu.lua has type="client" (see below) most of your code will go server side, but some features such as GUIs (clickable menus), drawing things on screen, playing music, handling peds and so on go in clientside scripts <script src="counterstrike.lua" /> <script src="buymenu.lua" type="client" /> This list: /counterstrike /meta.xml /counterstrike.lua /buymenu.lua it's just the file structure inside your resource, you don't have to put that list anywhere. However in the meta.xml file you define what files are related to your script. Mainly for those .lua scripts, but also for downloading images for display onscreen to clients or downloading mods for your players to use. Check out "Meta.xml" on the wiki for in-depth information. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now