Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 24/05/17 in Posts

  1. This tutorial will guide you to install MTA-Server 64 bits and NGINX as external web server. What is NGINX? Is a high performance web server, it can be used to make players download your server at full available link speed with a high compression rate. Droplet used: 512MB Ram 1vCore 100/100 Uplink Centos 7.3.1611 x64 Requirements: Root permissions. Here is the resources used in IDLE (6 hours graph). 1 - Lets prepare our system! Change to root user. $ sudo su We need to update our distro, we want the latest packages. $ yum -y update Now we will install some packages that we will use along this tutorial (screen to manage screens, unzip to .zip and EPEL for extra RHEL packages). $ yum -y install screen $ yum -y install unzip $ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm $ rpm --install --nosignature epel-release-latest-7.noarch.rpm Start your firewall (You can check firewall status with service firewalld status). $ service firewalld start Lets open just ports that we use on MTA and NGINX. 22126 for MTA Query list, 22003 for MTA Server, 22005 for HTTP files and 20080 for NGINX server. $ firewall-cmd --permanent --zone=public --add-port=22126/udp $ firewall-cmd --permanent --zone=public --add-port=22003/udp $ firewall-cmd --permanent --zone=public --add-port=22005/tcp $ firewall-cmd --permanent --zone=public --add-port=20080/tcp You should see "success" at the end of each command from firewall Now we will reload firewall to make active our new rules. $ firewall-cmd --reload 2 - Setting up MTA Server. Now we will download all necessaries files to start our MTA Server. Navigate to /home and create a directory called MTA. $ cd /home $ mkdir MTA $ cd MTA Download all files (Server, base config and resources). $ wget https://linux.multitheftauto.com/dl/multitheftauto_linux_x64.tar.gz $ wget https://linux.multitheftauto.com/dl/baseconfig.tar.gz $ wget https://mirror.multitheftauto.com/mtasa/resources/mtasa-resources-latest.zip Extract everything. $ tar -xvf multitheftauto_linux_x64.tar.gz $ tar -xvf baseconfig.tar.gz $ unzip mtasa-resources-latest.zip Rename multitheftauto_linux_x64 to server. $ mv multitheftauto_linux_x64 server Now we will move our baseconfig files to server folder and remove old files. $ cd baseconfig $ mv * ../server/mods/deathmatch $ cd .. $ rm baseconfig -f -r $ rm baseconfig.tar.gz -f Now we will do the same thing as we did above, but with our resources files, just create folder, and move everything. $ mkdir server/mods/deathmatch/resources $ mv -t server/mods/deathmatch/resources [admin] [editor] [gameplay] [gamemodes] [managers] [web] Ok, now that we finished with server files, we will move our server folder to / and remove MTA folder (MTA folder is inside /home directory). $ mv server / $ cd .. $ rm * -f -r We need to set 777 permission to mta-server64 bin file. $ cd /server $ chmod -R 777 mta-server64 Now we will create a screen called "server-screen" and start our server (Just for test). $ screen -S server-screen $ ./mta-server64 We expect to see a message like this: Server started and is ready to accept connections! Now that everything is working we will stop MTA server and minimize our screen. CTRL + c $ clear CTRL a + CTRL d 3 - The fun part. Lets install NGINX and create a server file. (NGINX uses modular server files). $ yum -y install nginx $ service nginx stop $ cd /etc/nginx/conf.d $ vi mta-server.conf Lets insert some lines of code inside our .conf file. Don't break the indentation of the file. (Use INSERT in your keyboard to insert files and not replace) server { listen 20080; root /server/mods/deathmatch/resource-cache/http-client-files; server_name localhost; access_log off; } Save and exit. Press ESC Press : Type wq and hit enter Now we will change our global NGINX server configs. $ vi /etc/nginx/nginx.conf On the top of the file put this: worker_rlimit_nofile 5000; Increase worker_connections 1024 to 5000 worker_connections 5000; Below access_log /var/log/nginx/access.log main; insert this lines: gzip on; gzip_types *; We don't want to use NGINX as public web server, so lets change the default port. Change: listen 80 default_server; and listen [::]:80 default_server; to listen 8081 default_server; listen [::]:8081 default_server; The top of your config file need to look like this: Start your NGINX server. $ service nginx start Test NGINX config. If you open this address and download a file, MTA Server block is ok. http://YOUR_SERVER_IP:20080/admin/client/admin_ACL.lua To test compression, navigate to: http://www.whatsmyip.org/http-compression-test/ And use this URL: http://YOUR_SERVER_IP:20080/admin/client/admin_ACL.lua 4 - Change MTA config file. Now we will point our download URL to NGINX URL. $ cd / $ vi /server/mods/deathmatch/mtaserver.conf Change <httpdownloadurl></httpdownloadurl> to: <httpdownloadurl>http://YOUR_SERVER_IP:20080</httpdownloadurl> 5 - Starting MTA Server. Resume screen. $ screen -r server-screen Start MTA Server. $ ./mta-server64 Minimize screen. CTRL a + CTRL d Its done, now your server is ready to accept connections and download all mods with fast speed. Useful links:
    4 points
  2. تم انشاء الشرح نظراً لوجود بعض الاشخاص الذين يطلبون المساعدة وعند التجربة يكون الناتج خاطئ نظراً لوجود اخطاء في ملف الميتا ما هو ملف الميتا وما هي اهميته في السكربت ؟ ملف الميتا هو اهم جزء من السكربت حيث انه هو المسؤول عن تشغيل باقي الملفات الاخرى بمعنى انه اذا كان هناك سكربت بدون ملف ميتا فإنه بغير فائدة . بعض الملاحظات xml : صيغة ملف الميتا تكون هكذا meta : اسم ملف الميتا يكون هكذا meta.xml : الصيغة الكاملة للملف تكون هكذا . الآن سأشرح ابسط شئ في ملف الميتا وهو تعفيل الملفات الاخرى فيه . ولكن اولاً ما هو التكون الرئيسي لملف الميتا ؟ انظر المثال الثاني وستعرف <meta> <!-- الكلام في هذا السطر لا يشكل اي شئ في ملف الميتا --> </meta> . والآن كيفية تفعيل ملفات السكربت .. انظر المثال التالي لتعرف كيف تقوم بتفعيل الملفات داخل ملف الميتا . في البداية يوجد بعض الاساسيات مثل <script /> يتم وضع اكواد تعفعيل الملفات الاخرى فيه وما يتعلق بها .. للملفات التيم يمكنك الكتابة فيها فقط src اسم الملف الذي تريد تفعيله مع الصيغة الخاصة بهذا الملف type نوع الملف اللذي تريد تفعيله ومن امثلته "client" او "server" او "shared". cache وهذه تستعمل لإخفاء الملفات التي تم تحميلها <meta> <script src="الملف و الصيغة" type="نوع الملف" /> </meta> <!-- ex 1 --> <meta> <script src="file.lua" type="shared" /> </meta> <!-- ex 2 --> <meta> <script src="file.lua" type="shared" /> <script src="server.lua" type="server" /> <script src="client.lua" type="client" cache="false" /> </meta> . ملاحظة مهمة جداً يجب ان يكون الملف موجود داخل السكرب لكي تستطيع تشغيل السكربت . والآن كيف تضع ملف " صور / صوت / خط / الخ " داخل ملف الميتا ؟ . في البداية يوجد بعض الاساسيات مثل <file /> يتم وضع اكواد تعفعيل الملفات الاخرى فيه وما يتعلق بها .. مثل الصور و الصوت / الخ src اسم الملف الذي تريد تفعيله مع الصيغة الخاصة بهذا الملف . مثال لتفعيل ملف في ملف الميتا <meta> <file src="الملف و الصيغة"/> </meta> <!-- ex 3 --> <meta> <file src="image.png" /> </meta> <!-- ex 4 --> <meta> <file src="image.png" /> <file src="sound.mp3" /> </meta> . تعلمت كيف تقوم بتفعيل الملفات الآن كيف تقوم بوضع الحقوق الخاصة بك ؟ . في البداية يوجد بعض الاساسيات مثل <info /> يتم بداخلها وضع اكواد الـ حقوق مثل author وهو الشخص الذي انشأ السكربت version وهو اصدار السكربت name اسم الـ سكربت description وصف مختصر لـ السكربت type وهو نوع الـسكربت ومن امثلته "gamemode" او "script" او "map" او "misc". . مثال لوضع الحقوق على السكربت <meta> <info author = "من صنع السكربت" name = "اسم السكربت" version = "اصدار السكربت" description = "وصف مختصر" type = "نوع السكربت"/> </meta> <!-- ex 5 --> <meta> <info author = "killerProject" name = "test" version = "1.0.0" description = "test test test" type = "script" /> </meta> <!-- ex 6 --> <meta> <info author = "you" name = "killer job" version = "1.5.0" description = "kill people" type = "script" /> </meta من الشروحات الاخرى لمن يريد التوسع في معرفة ملف الميتا . وضع ملفات الماب داخل ملف الميتا .. مثل وضع الملفات التي يمكن الكتابة فيها الا انه ينقص بعد الاكواد مثل نوع الملف ويوجد شئ جديد وهو موقع التصميم في العالم الوهمي . في البداية يوجد بعض الاساسيات مثل <map /> يتم وضع اكواد تفعيل ملف التصميم داخلها src اسم ونوع ملف التصميم dimension مكان التصميم بالنسبة للعالم الوهمي . مثال لكيفية وضع اكواد تفعيل ملفات التصميم <meta> <map src="اسم وصيغة ملف التصميم" dimension="رقم العالم الوهمي"></map> </meta> <!-- ex 7 --> <meta> <map src = "killerProject.map" dimension = "4112"></map> </meta> <!-- ex 8 --> <meta> <map src = "MyMap.map" dimension = "0"></map> </meta> . الآن وقت الشرح من نوع آخر وهو الاعدادات الخاصة بالسيرفر مثل الوقت / عدد ذخيرة الاسلحة الخ <settings> <setting name="" value=""/> </settings> يوجد صفحة خاصة بالإعدادات التي يمكنك التعديل عليها https://wiki.multitheftauto.com/wiki/Settings_system من الاساسيات الاخرى friendlyname اسم الشئ الذي تريد تغيير اعداداته accept القيمة التي تريد تغيير اعدادات الملف اليها examples بعض الامثال على القيمة التي وضعتها desc وصف الاعدادات التي وضعتها . مثال من الويكي على تغيير الاعدادات من ملف الميتا <meta> <settings> <setting name="roundlimit" value="[6]" /> <setting name="teamdamage" value="[1]" /> <setting name="teambalance" value="[1]" /> <setting name="spazammo" value="[25]" /> <setting name="m4ammo" value="[100]" /> <setting name="shotgunammo" value="[25]" /> <setting name="sniperammo" value="[20]" /> <setting name="ak47ammo" value="[120]" /> <setting name="rifleammo" value="[40]" /> <setting name="deserteagleammo" value="[45]" /> <setting name="pistolammo" value="[132]" /> <setting name="uziammo" value="[150]" /> <setting name="tec9ammo" value="[150]" /> <setting name="silencedammo" value="[65]" /> <setting name="grenadeammo" value="[4]" /> <setting name="satchelammo" value="[4]" /> <setting name="teargasammo" value="[4]" /> <setting name="molatovammo" value="[4]" /> <setting name="isAllowedToShoot" value="true" /> </settings> </meta> يوجد شروحات اخرى عن ملف الميتا سيتم شرحها في اقرب وقت بإذن الله مثل <include /> Include resources that this resource will use resource: Resource name that you want to start with this resource minversion: Minimum version that resource needs to be (optional) maxversion: Maximum version that resource needs to be (optional) <config /> Config file (.xml) can be accessed by resource, possible parameters are: src: The file name of the config file type: The type of the config file: "client" or "server" <export /> This exports functions from this resource, so other resources can use them with call function: The function name type Whether function is exported server-side or client-side (valid values are: "client", "server" and "shared") http: Can the function be called via HTTP (true/false) <html /> src: The filename for the HTTP file (can be a path) default: The html file is one that is shown by default when visiting /resourceName/ on the server. Only one html can be default, the rest are ignored. (true/false) raw: The html file is not parsed by the Lua interpreter and is treated as binary data. Must be used for binary files (images mainly) (true/false) <settings> <setting name="" value=""/> </settings>: Most gamemodes use settings system to let server admins to configure it how they like. For instance you could set round time and then use get and set to get the value or change it, respectively. <min_mta_version /> Minimum version requirements for this resource to run correctly. When authoring resources, the minimum version should usually be set to the current released version of MTA:SA (which at the moment is "1.5.4"). See example for example. client: The minimum client version server: The minimum server version <aclrequest /> A list of ACL rights this resource will need. <sync_map_element_data /> Controls whether map element data such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource. false: Disable transfer of map element data for all resources. This can reduce map download times considerably. true: Enable transfer of map element data for all resources. (If false and true are set in different resources, true will have priority and all resources will transfer map element data) <oop/> OOP - Please refer to OOP for documentation. false: Disable OOP. true: Enable OOP. <download_priority_group/> If not set, the download priority group for a resource defaults to 0. If this is set higher than 0, then the resource will be downloaded and started on the client earlier than other resources. If set to less than 0, the resource will be downloaded and started on the client later than other resources. هدف هذا الشرح هو تعليم الاشخاص المبتدئين اما بالنسبة للشرح في آخر هذا الموضوع فهو لـمن يريد ان يعرف اكثر عن ملف الميتا والسلام خير ختام
    2 points
  3. انصحك بذي يعسل انا اعرف اصحاب الاستضافه شخصيا ناس كويسه باذن الله خدماتهم زينه
    2 points
  4. السلام عليكم ، الموضوع مهم امتحانات ( حانات ) اختبارات ( بارات ) ردودكم
    1 point
  5. Yes, that pretty much does what you said, but as far as I understand your code, whatever this code does, the if opponentStreak and opponentName then part might still be true on rare occasions. It would be better to put them in an else block, if the one with the loop found someone, do not run this code as well, it's just one of those things that might never happen, but when it does, you have no idea what caused it. I know right? I still have a couple of years old code as well, when I just started pretty much everything (LUA was my first language), it's soo awkward to look at..
    1 point
  6. لو ما سويت كانسل راح تطلع بالشات الا لو تبي تطلع بالشات ما تستخدم كانسل افنت .
    1 point
  7. + هذي فكرتكـ .. مو فكرتي , يعني ما تجي تسوي اقتباس لردي وتحط بعدين فكرتك راح تسبب مشاكل بسبب انه ممكن يكون تقارب بين اسماء اللاعبين . https://wiki.multitheftauto.com/wiki/GetPlayerFromPartialName افضل حل يستخدم فنكشن
    1 point
  8. Ahora es que hay dueños españoles también. Son okupas de GM
    1 point
  9. Well you don't necessarily need to avoid community resources. What I do is this: 1. I browse a bit at the free resources. 2. If something catches my eye I download it, test it and if I like it's idea I start editing 90% of it so that it works perfectly for my needs 3. Take ideas from a resource and make it myself if it's too bugged.
    1 point
  10. Possibly a firewall/AV is blocking his TCP connection to that server
    1 point
  11. Todo esto se soluciona con una buena certificación
    1 point
  12. The concept of letting serverside and clientside work together isn't very difficult. It actually the same as you and me having a conversation. You communicate with me that you have a problem with a script. Noah > IIYAMA Then I reply on your topic and gave you some tips. IIYAMA > Noah Then you process those tips and send me request to send you more information. Noah > IIYAMA Which I am sending you back now. IIYAMA > Noah During this conversation you have send me 2 messages and I have send you 2 messages back. @koragg showed you the functions you can use to start a conversation. Lets start a conversation between the Server and all clients! So a part of the conversation goes like this: (the rest of the conditions you have to fill in by yourself) Server: A lonely player named <John> enters a lonely vehicle. 'onVehicleEnter' gets triggered on serverside. Lets give the vehicle weapon so it can kill other lonely players!!! The server saves that the vehicle has a weapon now(for example in to a table). Oh great it has been saved! Now let all lonely players know that a vehicle has super weapons! triggerClientEvent to all the players. Clients: Oh man we all got mail from the server!! It said that a lonely vehicle has weapons now!! Now we all have to attach weapons to it on all our computers! Noooo!! This sucks damn. setElementParent(weapon, vehicle) Client: The lonely player named <John> pushed his left mouse button down! Yes, I am an a vehicle. Yes, it is a hydra. Yes, I am happy to be alive. Server, I am firing up!!! setElementData on his vehicle firing true. Clients: I received element:~yData oh oh. It said that a lonely hydra is firing fire! Which weapons did I attach on it? Ah wait I added them a few seconds ago, when a lonely player entered his lonely vehicle! Lets fire these hydra flame weapons! setWeaponState firing true Server: A lonely player named <John> crashed his hydra into his mother. There was nothing left of his mother, neither of his poor hydra dragon. setElementData on his vehicle firing false. Clients: I received element:~yData oh oh. It said that a lonely hydra isn't firing any more. What could have happened? setWeaponState firing false.
    1 point
  13. Try: Settings->Video->Anti-aliasing->Off
    1 point
  14. تمام يعسل تعال يقلبي تشرف السيرفر راسلني بالخاص اوريك سكربتات السيرفر مع العلم جميع السكربتات من صنعنا ولا سكربت منقول
    1 point
  15. سيرفر نوعا ما جميل ، بس والله التقليد شين مرة...... @Master_MTA
    1 point
  16. You'll have to get a screenshot of the GTASA map and calculate the world position refered to the clicked position. Just to give you an idea.
    1 point
  17. Hello community, I'll be explaining the basics of LUA as I understand it. CONTENT Foreword My background Part 1 - Let's get started! Part 2 - Variables (Extra: concat) Foreword First of all I wanna make some things clear, I'm not the best scripter in the world let be in LUA. Second, I can write stuff here that some programmers will disagree that's why I am saying 'as I understand it'. I'm going to try and make this understandable for the beginner starting from scratch. My Background My name is Billy, I'm from Belgium and I've been interested in LUA since I started MTA in 2011, I've tried many times to understand LUA and thanks to IIYAMA I've continued trying and never gave up, he taught me a lot but I never saw the entire picture, Why? Because I was to focussed on trying to make something I want instead of learning the language first. I've seen C# in 1 school year and it learned me to understand and learn programming languages on my own. Part 1 - Let's get started! The first things we need to understand are datatypes in my opinion. In LUA there isn't that much to explain about datatypes since we don't need to declare them with our variable. BUT we need to make sure that variable data is of the same datatype. So we can't combine numbers and text we'd need to convert these numbers to plain text to fit in. (More about this later). Part 2 - Variables There are 2 types of variables, local and global. Example: local localVariable -- Here is 'localVariable' the name globalVariable -- Here is 'globalVariable' the name, ALSO we don't write global Now, what's the difference? globalVariable = "Hello" function funcName () local localVariable = "World" -- the name 'localVariable can only be used inside this function end outputChatBox(globalVariable) outputChatBox(localVariable) -- Result only globalVariable will be outputted, if we put the output inside the function local would work as well This would work, globalVariable = "Hello" function funcName () local localVariable = "World" -- the name 'localVariable can only be used inside this function outputChatBox(localVariable) end outputChatBox(globalVariable) Try avoiding the use of global variables as much as possible! Part 2 Extra - Concat We can use both variables as plain text but to merge them we have to 'concat' them. What is concat? Text example: LUA Example: local localVariable = "Hello" outputChatBox(localVariable.." World!") .. is concat you can see it as a + (Do not see it as a + for calculations but for adding text to eachother) ________________________________________________________________________________ If this is the end of the tutorial? That's what you guys decide, it took me some time for this and I am definitely not the best teacher but if you guys think I should continue I definitely will. I have a lot more to feature to finish the entire basics I hope this will be accepted as a good attempt to teaching. Kind regards Billy
    1 point
×
×
  • Create New...