Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 29/12/21 in Posts

  1. Motivation Recently I'm working on vice city stories map conversion project, thinking whatever I can also convert the path from the single-player to the MTA. there's a traffic resource made by one of our lovely community members CrystalMV @Reyomin. however, a few documentation were in there regarding its traffic file structure since it is encoded in binary. For sure, we do need a bit more understanding of the basics of how this thing works before we can start doing some magic on that. Disclaimer: The information might contain errors due to extracting by eyeball directly guessing from code ? The Variables Traffic Map File Structure Description Identifier Type Description Node Block X int (4 bytes) X, / 1000 for actual value Y int (4 bytes) Y, / 1000 for actual value Z int (4 bytes) Z, / 1000 for actual value RX int (2 bytes) RotX, / 1000 for actual value RY int (2 bytes) RotY, / 1000 for actual value Connection Block Start int (4 bytes) The Start node index of a connection (Refer by index from node block) End int (4 bytes) The End node index of a connection (Refer by index from node block) Bend int (4 bytes) The blending point of a connection (Refer by index from node block) Traffic type unsigned integer (1 byte) Traffic Type, 1: ped, 2: car, 3: boat, 4: plane Lights unsigned short (2 bytes) Traffic light direction has two sub value, can obtain them by light_1= lights % 4 , light_2= floor(lights/4) it can be: 1: “NS”, 2: “WE” 3: “PED” (Red for all cars, no matter what direction, use when peds are crossing roads) Speed unsigned integer (1 byte) Value from 0 – 255, indicate the max speed limit when passing through the node Left lane Number of left lanes does this node have Right lane Number of right lanes does this node have Density Indicate the density of how many traffic can generate forbidden turn Block C1 int (4 bytes) The Start node index of a connection (Refer by index from node block) C2 int (4 bytes) The End node index of a connection (Refer by index from node block) At last I also posted another copy in my blog, Feel free to correct me anything you found in the following reply. At last, I'd like to appreciate all the hard work that the author made into this work, although it's an old stuff ?
    5 points
  2. Wow, I'm very happy to see my scripts are still relevant, thanks! But it can be a negative thing as well, I mean it wasn't supposed to end up this way, back then I tried to improve the script, then I tried to make a new, a more advanced ped system from scratch but didn't have enough time, and to make things even worse, the code I wrote then looks horrible to me now So happy to feel appreciated, yet the fact that everyone's focused on my work that still wasn't satisfying enough to myself, gives me this unpleasant feeling that I gotta clean up this mess, gotta finish the work I once started but I don't know when I'm going to try scripting on MTA again Conversion of game paths to my path format sounds interesting, but making my own paths instead of converting the ones from the game was the reason I came up with my format and traffic editor to begin with. I was having trouble understanding some things in the game's format, and the paths have things like multiple nodes in a straight line, which needlessly uses more data. Now, to the documentation details. node_conns tells the connection ID from node IDs. That is, node_conns[node1_id][node2_id] = connection_id. Also, node coordinates are decimal fixed-point numbers, not floats, and RX/RY each takes 2 bytes as opposed to 4. Reading the value as integer and dividing it by 1000, you get the actual value. I had some problems converting between bytes and floats, and integers were faster to process. Finally, traffic lights. The value 3: "PED" means red for all cars, and that's when the peds cross the road. Normally it would work according to pedestrian traffic lights, but as far as I know, those are neither synced, nor scriptable - at least they weren't when I made the resource.
    2 points
  3. Hmm, im gonna give a try. Probably if i have questions ill come here. Thanks for the advice! Hmmm i see, yeah probably, this is mostly for self learning. mta was one of the games i played the most. now that im into this programming world, would like to try my own thing haha! thank for the advice Sorry. i was kinda confuse making the post
    1 point
  4. I would like to add that peds should be created on the server-side and then the syncer of the ped, which can be checked using the client-side isElementSyncer function, should control it, for example using the methods as described by FernandoMTA. I did do experiments many years ago when the peds still had to be controlled using old functions. From my experience I can say that creating a bot system is very complicated. Also there is no access to pre-made API about navigational meshes or the math surrounding it so the design does require actual work. I am not sure if this project is a good idea for a self-proclaimed beginner like you.
    1 point
  5. Moving this into the scripting section!
    1 point
  6. Hi, very cool that you started scripting! Good luck with your adventures. Slothbot is a bit complex, and although a bit outdated nowadays, I think you can still use some of the methods it used to control the peds you want to have, in your own script instead of just using the entire slothbot resource (just my advice). What you need to code the bot AI that follows a player and kills it if it's not dead is a way for it to repeatedly check for that player/players around itself and do certain actions. What I would do (clientside) is some sort of infinite timer that makes the bot(s) check for nearby enemies and walk towards them to attack them. The reason I'd do this clientside is because you have the following functions that you can use, like you said https://wiki.multitheftauto.com/wiki/SetPedAimTarget https://wiki.multitheftauto.com/wiki/SetPedControlState I can give you an example if you want, but you should give it a try and ask questions if you find specific issues that you can't solve Best of luck @Sentineldev12
    1 point
  7. Don't lie, we know a lot about your activities. As the ban reason indicates, you got a chance to correct yourself and stop those activities, but you chose to keep trying with spoofers and more. So now you are permanently banned.. this ban cannot be appealed anymore. @Maquin
    1 point
  8. التركيبة : guiSetInputMode ( string mode ) المود الي تبغاه : "allow_binds": binds are enabled, hence using a key such as t in an editbox will still activate the chatbox (default) "no_binds": binds are disabled, hence using a key such as t in an editbox will not activate the chatbox "no_binds_when_editing": binds are always enabled except when an editable editbox or memo has input فالحالة هذي حط no_binds_when_editing guiSetInputMode("no_binds_when_editing")
    1 point
  9. بعد الكلام الإخوة الي فوق , لو تبغى مثال تفضل هذا سكربت لي لو انت مت بيحط نص من فلوسك عالارض والي يجي يقدر ياخذهم (مثل نظام جي تي ايه سان اندرياس ) وطبعاً استخدمت القسمة وقسمت الفلوس على /2 والفكره سهلة https://community.multitheftauto.com/index.php?p=resources&s=details&id=18635
    1 point
  10. اول شي السلام عليكم ورحمه الله وبركاته رح اسويها علي setTimer ويلي هو مؤقت يسوي شي كل وقت او يسوي شي بعد فترة محددة من الزمن المثال الأول: رح اشرحلك فيه طريقة انشاء شي معين كل فتره معينة --Server function FunctionName( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0,root) --Code end setTimer(FunctionName, 5000, 0) -- لاحظ الرقم 0 ---------------------------------------------------------------------------------------- --Client function FunctionName( ) exports["guimessages"]:outputClient("message from client file.",0,255,0) --Code end setTimer(FunctionName, 5000, 0) -- لاحظ الرقم 0 اوكي ننتقل للمثال الثاني: رح اشرحلك فيه انشاء شي معين بعد فتره معينة --Server function FunctionName( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0,root) --Code end setTimer(FunctionName, 5000, 1) -- لاحظ الرقم 1 ---------------------------------------------------------------------------------------- --Client function FunctionName( ) exports["guimessages"]:outputClient("message from client file.",0,255,0) --Code end setTimer(FunctionName, 5000, 1) -- لاحظ الرقم 1 اذا لاحظت الفرق بين المثال الأول والمثال الثاني شي واحد يلي هوه الرقم 0 والرقم 1 هي يلي تحكم في نوع المؤقت يعني المؤقت رقم 0 يسوي شي معين كل فتره زمنيه معينه والمؤقت رقم 1 يسوي شي معين بعد فتره زمنيه معينه اخر شي ويلي هوه المثال الثالث: كيف تحدد وقت المؤقت الزمني يلي هي تكون او ماتعرفها مابعرف يلي هي العلامات شو هي العلامات يلي هي علامة الضرب [ * ] علامة القسمة [ / ] علامة الطرح [ - ] علامة الجمع [ + ] هاذي شو فايده منها رح تفيدك كثير في البرمجه طيب مابدي اطول كلامي عشان ماتمل وانت تقرأ اعطيك : مثال --Server function FunctionName( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0) end setTimer(FunctionName, 6000, 0) -- رقم 6000 = 6 ثواني -- يمكن كتابته بصورة مختلفة مثلاً setTimer(FunctionName, 6*2000, 0) -- 2000 * 6 = 6000 وهذه فائدة الضرب -- طيب اذا بدي اسوي المؤقت انو يخرجلي رسالة كل 6 دقايق مثلاً شو اسوي ----------------------------------------------------------------------- -- هاذه المثال : يلي بل أسفل يقولك كيف رح يكون function Timer( ) -- Timer = اسم الأمر ويمكنك كتابته اي شيء ممكن تقدر تكتبه exports["guimessages"]:outputServer(root,"welcome to server",0,255,0) end setTimer(Timer, (6*70*1000), 0) -- 6*70*2000 = 6 دقائق بس هاذا يلي كان عندي اتمنه انك فهمت علي وتكون استفدت من هاذا الشرح البصيط واذا بتكتب علي طول علامات القسمه لها فايده كيف تعرف انو هاذا شي ياخذ القسمه وياخذ علامات الباقيه مثل الأمثله يلي عطيتك فوق وشرحتها انا عطيتك مثال علي شو فائده منها واتمنه انو شرح يفيدك والسلام عليكم ورحمه الله وبركاته
    1 point
  11. That's a very heavy accusation, I was wondering if you could back it up by proof. Mabako leaked the code - you can even go and ask himself about it. He also admitted it in one the files that he published with the gamemode.
    1 point
×
×
  • Create New...