Scripting Introduction Hindi
Introduction
Resources Mta mahatvapurṇa hissa hai(Resources Mta का एक महत्वपूर्ण हिस्सा हैं). Ek resource ka rup Folder ya fhir zip hotha hai aur wos main collection of files hoti hain(एक Resources अनिवार्य रूप से फाइलों का एक संग्रह है जिसमें एक फोल्डर या ज़िप फाइल है), plus ek meta file hota hai jo batatha hai ke kaise resource ko load kiye jai aur resource mai kya kya files hai. Resource ko start bhi kiya ja sakta hai aur stop bhi kiya jha saktha hai, aap ek sath mai aap multiple scripts bhi chala sakthe hai.
Scripting ka sab kuch resource mein hi hota ha. MTA resources define kartha hai khi who gamemode, map hai ya kuch aur hai, Mta ke sath resources aathe hai wose aap aphe gamemode mai use kar sakthe hai.
Tip: Lua scripting ke liye ap ka first step lua editor hona chahiye. Ye scripting ko bohat aashan bana tha hai. ham ye sab recommend kar the haiSublime Text, Notepad++ aur LuaEdit. Ek aur unofficial mta sa script editor hai MTA Script Editor. |
Ek Working Script Ko Banana
Sab se pehle ham sikhe ge ke kese aik basic script ko banaya jaata hai jismai players ko sheher me chalne dete hain, ek ke bad ek.
Appki sari Scripts Kahan Par Hoti Hain?
ham script ke file structure ko dekhte hain. Apne MTA Server folder mai jhaiye aur fhir neeche bathaye wohe path pai jahiye
server/mods/deathmatch/resources/
aap waha pe bahut sare zip files dekhe gai, woh sab simple scripts hai jo Mta ke sath aathe hai. jab aapka local server start hotha hai woh sab zip files apneaap unzip ho kar load ho jathe hai.
Abhi aap ko kudka resource banana ha to waha par ek folder banahiye, woh nam aap jo marzi hai woh rak sakthe hai. ham is tutorial mai folder ka nam "myserve" rakhe gay. Ab ap is neche diye gaye path pe honge
server/mods/deathmatch/resources/myserver/
Resource Ko Identify Karna
Server ko malum hona chaiye ke yeh resource kya hai, woske liye aik meta.xml file ko create karna chahiye. Ye file ko root directory mai hona chahiye, So hamere tutorial myserver folder hai. to ab aap ek text (txt) file create karo aur woshe ye nam do "meta.xml", phir aap ise notepad se open kare.
Phir ye codes aap meta.xml mai daliye
<meta> <info author="aapkanam" type="gamemode" name="My Server" description="My first MTA server" /> <script src="script.lua" /> </meta>
Is <info /> tag mai ek "type" field bhi hai jo server ko batata hai ke ye resource gamemode aur map nahi hai jo badme explaine kar diya jayega. Gamemode ek cheez hai jis mai bohat saari scripts hoti hain. <script /> tag batata hai ke is script mai konsi konsi files hain, jo ke ham agge banaye gay.
...........