Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 13/03/17 in all areas

  1. A few months ago we decided to set up a project called Countryside RP (CRP). I am theoretically the founder of the whole project, but in my opinion the current staff are all founders of the project, there would not be a project without them. We have been managing the forums, discord channel and some small features since the creation date. We also started sculpting the server, I can tell you it is fun to do but might be quite boring sometimes. Besides the history and all, I will tell you a few things about the project. The server of Countyside RP is based in the area of San Andreas County; most likely Red County, Bone County and Flint County. Tierra Robada County and Whetstone County are included as well. All towns and counties are connected between town halls, all town halls are working under the San Andreas County Government. The Sheriff's Department and Fire Department take care of protection, emergency medical services and fire. There are many things to do, for example: go fishing, work for the postal delivery or go clean some streets. Hang out with your friends, marry your dear fiance(e) or create a faction which might turn out into a well-based company. You can make your own choices: live under a bridge with your homeless mates or focus on making career and enjoying the happy-family feeling. We are currently working with a free server and free forums, which will change in the future when we are nearby the grand opening. We would like to see you on our forums to help us to improve the project on the field of development or administration, suggestions and criticism is welcome. We are also looking for people to support us on the field of administration, factions, management and development. Do not hestitate to contact me on discord or the forums if you are interested! You might want to take a look on our forums or join our Discord server, you can contact us from here or just PM me. Pictures might come soon, we just wanted to tell you something about the project. The grand opening, as we call it, is far away, but we will keep you posted about the latest updates. Enjoy your time on MTA, peace out! Cronus, Community Manager Sipapi, Assistant Community Manager Emma, Head of Staff Mike, Head of Factions Blueline, Head of Administrational Affairs
    1 point
  2. وبالاخر ابو ريالين هههههههه لا امزح امزح سوي قمرة قياده للتحكم بالمركبه سوي شراء المركبه للجروب يقدر اي شخص يخشها في الجروب سوي اسم الداتا بملف خارجي طبعا المهم سوي شوية شغلات ومافي غير اللي اشترى السفينه هو اللي يقدر يتحكم باللي يسوقون السفينه وكذا وطلب زياره للسفينه من الزوار وكذا وكذا وكذا وما عندي افكار وش اسويلك ذذ كل شي يطير من راسي لا جيت افتح النوت باد
    1 point
  3. function getRandom ( aTable , aMoney ) for k,v in ipairs ( aTable ) do local aPlr = getRandomPlayer ( v ) outputChatBox ( aPlr , root ) givePlayerMoney ( aPlr , tonumber ( aMoney ) ) end end جربه + حطه باول الكود getRandom ( aTable , aMoney ) aTable -- اسم الجدول aMoney -- عدد المال
    1 point
  4. ههههههههههههههههه يب شفت كيف التربيه صح عليك هههههههههههه
    1 point
  5. مافيه شي يرجعلك برقم والمتغير راح تصير قيمته هذا الرقم يعني كأني حاط رقم
    1 point
  6. "شيل من راسك " ما اعرف حاول
    1 point
  7. Try this: addPedClothes(source, texture, model, type) You are actually writing those args in the wrong sequence.
    1 point
  8. 1 point
  9. الحين احرجتهم انت
    1 point
  10. This is a complex problem but you can make it work almost perfect in most cases. Changing unoccupied_vehicle_sync_interval like 3aGl3 suggested (and the other sync intervals too) is a good start. I'm using 10ms on all of them except lightweight sync where 100ms is used: <!-- Player sync interval. Default: 100 --> <player_sync_interval>10</player_sync_interval> <!-- Lightweight (player) sync interval. Used when players are far apart. Default: 1500 --> <lightweight_sync_interval>100</lightweight_sync_interval> <!-- Camera sync interval. Default: 500 --> <camera_sync_interval>10</camera_sync_interval> <!-- Ped sync interval. Default: 400 --> <ped_sync_interval>10</ped_sync_interval> <!-- Unoccupied_vehicle sync interval. Default: 400 --> <unoccupied_vehicle_sync_interval>10</unoccupied_vehicle_sync_interval> <!-- Keysync mouse rotation sync interval. For limiting key sync packets due to mouse movement. Default: 100 --> <keysync_mouse_sync_interval>10</keysync_mouse_sync_interval> <!-- Keysync analog movement sync interval. For limiting key sync packets due to joystick movement. Default: 100 --> <keysync_analog_sync_interval>10</keysync_analog_sync_interval> This high sync intervals are barely noticeable on the server's CPU usage (Debian 8.7, mtasa-1.5.3), same applies for the network speed (Avg: 30 kBit/s) with 2 players online. Now this isn't everything you need, you would also need something that detects and update differences in positioning. Here's one potential solution, first the server side code which will obtain the current coordinates of a first (and a second trailer attached to an invisible Tanker semi truck attached to the first trailer). Coordinates server side will match the element syncer which should be the player who is driving the big rig. -- Trailer sync function trailerSyncTimers[client] = setTimer(function(client) -- Sync first truck trailer if there is any if vehicles and vehicles[client] and isElement(vehicles[client]) and isElement(getElementData(vehicles[client], "GTWvehicles.attachedTrailer")) then local tx,ty,tz = getElementPosition(getElementData(vehicles[client], "GTWvehicles.attachedTrailer")) local trx,try,trz = getElementRotation(getElementData(vehicles[client], "GTWvehicles.attachedTrailer")) setElementData(getElementData(vehicles[client], "GTWvehicles.attachedTrailer"), "GTWvehicles.trailer.location", toJSON({tx,ty,tz, trx,try,trz})) else killTimer(trailerSyncTimers[client]) end -- Sync first truck trailer if there is any if trailers and trailers[client] and trailers[client][1] and isElement(trailers[client][1]) and isElement(getElementData(trailers[client][1], "GTWvehicles.second_trailer")) then local tx,ty,tz = getElementPosition(getElementData(trailers[client][1], "GTWvehicles.second_trailer")) local trx,try,trz = getElementRotation(getElementData(trailers[client][1], "GTWvehicles.second_trailer")) setElementData(getElementData(trailers[client][1], "GTWvehicles.second_trailer"), "GTWvehicles.trailer.location", toJSON({tx,ty,tz, trx,try,trz})) end end, 250, 0, client) Now on the client side. This is where the coordinates are obtained from the trailer object itself which we set on the server earlier. Here's where we'll look for the big changes like if the trailer is rotated ~45 degrees for a player looking at the rig from the outside while everything looks perfectly normal to the driver. We'll also check for differences in positioning, in this case a distance of 20 units are used while the difference in rotation are π/6 rad (30 degrees) setTimer(function() for k,v in pairs(getElementsByType("vehicle", root, true)) do if getVehicleType(v) == "Trailer" and getElementData(v, "GTWvehicles.trailer.location") and getElementData(v, "GTWvehicles.towingVehicle") and getElementData(v, "GTWvehicles.towingVehicle") ~= getPedOccupiedVehicle(localPlayer) then local data = fromJSON(getElementData(v, "GTWvehicles.trailer.location")) --outputChatBox("Trailer "..k.." is streamed in at position: {"..math.floor(data[1])..", ".. -- math.floor(data[2])..", "..math.floor(data[3]).."} with rotation: {"..math.floor(data[4])..", ".. -- math.floor(data[5])..", "..math.floor(data[6]).."}") local tx,ty,tz = getElementPosition(v) local trx,try,trz = getElementRotation(v) --local sx,sy,sz = getElementVelocity(v) --outputChatBox("Updated trailer position for player: "..getPlayerName(localPlayer)..", Diff: x: ".. -- math.floor(math.abs(tx-data[1])).." sx: ("..math.floor(sx).."), y: ".. -- math.floor(math.abs(ty-data[2])).." sy: ("..math.floor(sy).."), z: ".. -- math.floor(math.abs(tz-data[3])).." sz: ("..math.floor(sz).. -- "), Diff rot: rx: "..math.floor(math.abs(trx-data[4])).. -- ", ry: "..math.floor(math.abs(try-data[5]))..", rz: "..math.floor(math.abs(trz-data[6]))) local t_tower = getElementData(v, "GTWvehicles.towingVehicle") if t_tower and isElement(t_tower) then setTimer(attachTrailerToVehicle, 100, 1, t_tower, v) end local t2_tower = getElementData(t_tower, "GTWvehicles.second_tower") if t2_tower and isElement(t2_tower) then setTimer(attachTrailerToVehicle, 100, 1, t2_tower, v) end if math.abs(tx-data[1]) > 20 or math.abs(ty-data[2]) > 20 or math.abs(tz-data[3]) > 20 or (math.abs(trz-data[6]) > 30 and math.abs(trz-data[6]) < 150) then --outputChatBox("Old pos: "..math.floor(tx)..", "..math.floor(ty)..", "..math.floor(tz)) setElementPosition(v, data[1],data[2],data[3]) setElementRotation(v, data[4],data[5],data[6]) --local tx,ty,tz = getElementPosition(v) --outputChatBox("New pos: "..math.floor(tx)..", "..math.floor(ty)..", "..math.floor(tz)) end end end end, 500, 0) Next thing to do here would be to not allow an element to stream out. This is slightly easier tho since you only need to pass the newly created trailer element (and the semi truck) to the client and then use setElementStreamable client side. Here's an example I've been using to solve this issue with trains carrying 20-30 trailers. Server: triggerClientEvent(root, "GTWvehicles.onStreamOut", root, vehicles[client]) Client: function check_stream_out(c_train) setElementStreamable(c_train, true) end addEvent("GTWvehicles.onStreamOut", true) addEventHandler("GTWvehicles.onStreamOut", root, check_stream_out) This code is a part of https://github.com/404rq/GTW-RPG/tree/v4.0-development and might need a few adjustments to work in your server but it shows the principles. vehicles[client] contains the semi truck and trailers[client][1] contains the first trailer. The trailer can identify it's tower from it's element data set to: GTWvehicles.towingVehicle which is set upon creation. If you're having any trouble, try changing the values in this line, that's pretty much how aggressive the sync will be, if it's too aggressive you may experience other issues: if math.abs(tx-data[1]) > 20 or math.abs(ty-data[2]) > 20 or math.abs(tz-data[3]) > 20 or (math.abs(trz-data[6]) > 30 and math.abs(trz-data[6]) < 150) then I hope this works for you too
    1 point
  11. هههههههههههه تسلملي يا قلبي +_+
    1 point
  12. كم مره كررت الموضوع وقالوا لك محاولتك وين ماحد فاضي يبرمج لك كذا على البارد المستريح اما ان تحاول او تشوفلك واحد بمقابل مادي
    1 point
  13. "onPlayerWasted" getDeadPlayers triggerClientEvent addEvent addEventHandler guiGridListAddRow getPlayerName guiGridListSetItemText
    1 point
  14. انا ببيعه وبحذفه و الي يشتريه حر فيه ينشره يحذفه من عنده هو حر وبالنسبة للتصميم قريبا بظبطه وبنشره للبيع مرة اخري مع تصميم احلي @Killer Project
    1 point
  15. وعليكم السلام ورحمة الله وبركاته بالتوفيق لك وان شاء الله تكون ناجح في مواضيعك
    1 point
  16. كودك صح ولا ما صح ما يهمني انا اعطيته فكرة مب على اساس متصلحة ولا غيره انا اعطيه حالة السيارة بالنسبة لصحتها على العموم انهي الموضوع وكمان انا احب اتفلسف وحياك الله @Master_MTA @!#NssoR_) شوف صاحب الموضوع اذا يبي شي من هذا الموضوع او اغلقه يا نسور
    1 point
  17. ما ادري لو سواهم احد قبلي ولا لا وما ادري صحيحين او لا المهم بسم الله نبدا countElementsInInterior وظيفة حساب عدد الالمنت في البيت او المكان الداخلي Shared Function Syntax : ? countElementsInInterior(element elmenttype , int int) Required Arguments : elementtype: نوع الالمنت اللي تبي تجيب int: رقم المكان الداخلي او البيت زي ما تسمونه Returns ترجع لك بعدد الالمنت الموجودين في البيت او المكان الداخلي Code: function countElementsInInterior(elementtype,int) local countplayersinInterior=0 for k,v in ipairs(getElementsByType(elementtype)) do if getElementInterior(v)==int then countplayersinInterior=countplayersinInterior+1 end end return countplayersinInterior end Example: addCommandHandler('count',function() local players=countElementsInInterior('player',5) outputChatBox('the player count is'..players,255,255,255,true) end) getElementsInInterior وظيفة جلب الالمنت في المكان الداخلي او البيت Shared Function Syntax : ? getElementsInInterior(element elementtype,int int) Required Arguments : elementtype: نوع الالمنت اللي تبي تجيب int: رقم المكان الداخلي او البيت زي ما تسمونه Returns: تشبه اللي قبلها كثير لكن هذي ترجع لك بالالمنت اللي داخل المكان الداخلي نفسه Code: function getElementsInInterior(elementtype,int) local playersinInterior={} for k,v in ipairs(getElementsByType(elementtype)) do if getElementInterior(v)==int then table.insert(playersinInterior,v) end end return playersinInterior end Example: addCommandHandler('count',function() local players=getElementsInInterior('player',5) for k,v in ipiars(players) do outputChatBox(getPlayerName(v),255,255,255,true) end end)
    1 point
  18. 1 point
  19. صديقى على الفيس هوا شرحلى عوز يعمل ايه
    1 point
  20. ThatsMe although it wont fit in the bounds, you can still place it; water planes would be your only issue. For the IDs you can use a dynamic streamer. "Though lag would roll in in some bits"
    1 point
  21. مو بس انت انت و مسطر و نيكست و نيسكت 2 و خلف والكثير ، الي نستيه بالقلب
    1 point
  22. I guess you're looking for processLineOfSight. However, it does not return the rotation directly so you have to calculate it from the returned normal vector.
    1 point
  23. مود الرنت سيستم سيرفر طاره المصمم @3NAD
    1 point
×
×
  • Create New...