Jump to content

[REQUEST] Weekly tutorials!


tuuker

Recommended Posts

In wiki they dosn't explaining everything good. Example look this: https://wiki.multitheftauto.com/wiki/Writing_Gamemodes

I dont understand anything what they speak about that line code:

<map> 
    <spawnpoint id="spawnpoint1" posX="1959.5487060547" posY="-1714.4613037109" posZ="877.25219726563" rot="63.350006103516" model="0"/> 
    <pickup id="Armor 1" posX="1911.083984375" posY="-1658.8798828125" posZ="885.40216064453" type="armor" health="50" respawn="60000"/> 
    <flag posX="1959.5487060547" posY="-1714.4613037109" posZ="877.25219726563" team="blue" /> 
    ... 
</map> 

Where sould it even take place? Does i need to make some.map file? If i have then how i register it, so server knows that i want to use it? Does i have to add code into meta.xml?

After that where will that code goes:

-- retrieve a table with all flag elements 
local flagElements = getElementsByType ( "flag" ) 
-- loop through them 
for key, value in pairs(flagElements) do 
    -- get our info 
    local posX = getElementData ( value, "posX" ) 
    local posY = getElementData ( value, "posY" ) 
    local posZ = getElementData ( value, "posZ" ) 
    local team = getElementData ( value, "team" ) 
    -- create an object according to the flag position 
    createObject ( 1337, posX, posY, posZ ) 
    -- output the team that we created a base for 
    outputChatBox ( "Base for team " .. team .. " created" ) 
end 

is .map files only for making objects in game or what? if i wanna make pickups, add cars sould i use .map files then?

Link to comment
I suggest you, don't try to script gamemodes too soon. You should start modifying simple scripts, so you can understand how this works. For example, changing texts on scripts, modifying coordinates, etc... I've started with that.

LOL man xD... I didnt say that i dont undestand codes, didnt i? If i wouldnt understand them then i guess i wouldnt ask something like that in my previous replay....

Edited by Guest
Link to comment
I suggest you, don't try to script gamemodes too soon. You should start modifying simple scripts, so you can understand how this works. For example, changing texts on scripts, modifying coordinates, etc... I've started with that.

LOL man xD... I didnt say that i dont undestand codes, didnt i? If i wouldnt understand them then i guess i wouldnt ask something like that in my previous replay....

Actually The Kid was right - You can't start writing gamemode on beginning.

Your first scripts should be like outputting random text from table to chatbox every 1 minute,

Your second scripts should be like teleporting players on marker hit,

etc etc.

After successful play with a lot of scripts (like at least 1 month) - you can start think about BASIC gamemode.

If i have then how i register it, so server knows that i want to use it? Does i have to add code into meta.xml?

Everything is explained on wiki, search "meta.xml".

if i wanna make pickups, add cars sould i use .map files then?

It can be done both with scripting and map files.

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