Jump to content

IIYAMA

Moderators
  • Posts

    6,058
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. You can also move the oldTx, oldTy, oldTz, px, py, pz validation to here. Or here, line 96 @Bean666
  2. Basic validation: (works in most cases just fine) if isElement(ped) and oldTx and oldTy and oldTz and oldPx and oldPy and oldPz then Advanced validation: (recommended using this when the data comes from user input, export functions or database. But using it for here is also fine.) if isElement(ped) and type(oldTx) == "number" and type(oldTy) == "number" and type(oldTz) == "number" and type(oldPx) == "number" and type(oldPy) == "number" and type(oldPz) == "number" then
  3. For example: local player = getElementData(source, "leader") local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_enemy_check, 500, 1, source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) To: local player = getElementData(source, "leader") if isElement(player) then local oldTx, oldTy, oldTz = getElementPosition(player) local oldPx, oldPy, oldPz = getElementPosition(source) setTimer(follow_move, 800, 1, source, oldPx, oldPy, oldPz, oldPx, oldPy, oldPz) end setTimer(follow_enemy_check, 500, 1, source)
  4. The owner has complied with providing evidence that this gamemode is unique. @Patrick has validated that. No further accusations will be tolerated without proof. The first topic has been hidden. (This is a copy) @Jacuuuu Please move some of those pictures inside of your topic. And always do that for new [SELL] related topics. That way we can at least moderate if there are people trying to sell stolen resources. Note: if you disagree with our actions you should send us a message, instead of trying to evade our actions. That way this issue would have been resolved a long time ago.
  5. You could reduce the amount of zombies. If you want to compare a local machine with a VPS, it is best to bring both of them a little bit closer to each other. That is if you want to know if it is the server that is responsible for the lag, or if it is your internet connection. https://wiki.multitheftauto.com/wiki/Command_fakelag Enable fakelag: <fakelag>1</fakelag> Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch\mtaserver.conf Command: /fakelag <packet loss> <ping> <ping variance> Join a healthy server and adjust the values for the command that you are going to use. <packet loss> = % how much packet loss you have (information that is not delivered and has to be resend) Information can be found here: /shownetstat <ping> = should be filled in with the amount of ping you have. <ping variance> = how much your ping is jumping up from the base value. Example: /fakelag 1 100 50 1% packet loss 100 ping 50 ping variance: ping + ping variance 100 + 50 = 100 t/m 150 ping
  6. The data rate is indeed an issue. I capped my own ped resource on 300ms. But the quantity also plays a role. It is bad practice to send the same information twice. If the client knows a ped is running, the server does not have to send that information again. If there are no peds around you, the data rate by this resource should be nearly 0. Are you sure that it sends data on the onClientRender rate?
  7. There is only 1 thing you need to know about internal arguments. Those ones that are after the callBack function. If you mix internal arguments with arguments(from serverside), you have to make sure that the last internal argument is not a nil value. Because when all arguments are converted to parameters, both lists will be merged and the first list(internal arguments) will collapse on nil values at the end of the table. Problem: internal2 = nil callServer('isAccountRegistered', username, password, caseVariable, function(internal1, internal2, state) end, "internal1", internal2) Is OK: internal2 = false callServer('isAccountRegistered', username, password, caseVariable, function(internal1, internal2, state) end, "internal1", internal2) As you can see here: list1 = {1, 2, nil, 4, nil} -- internal arguments list2 = {6, 7, 8, 9, 10} for i=1, #list2 do list1[#list1 + 1] = list2 [i] end print(unpack(list1)) -- 1, 2, nil, 4, 6, 7, 8, 9, 10, -- The nil value at index 5 is missing.
  8. thx! Sorry for my late reply, I didn't notice the notification. The syntax for that function: bool callServer (callFunctionName string [, argument1, argument2, ... ] [, callbackFunction function [, argument1 (internal), argument2 (internal), ...]] ) https://gitlab.com/IIYAMA12/mta-communication-enchantment/tree/master/documentation/syntax#syntax-1 Multiple values can be send over by just adding them between the functionName and the callBackFunction. functionName: 'isAccountRegistered' callBackFunction: function(state) end callServer('isAccountRegistered', username, function(state) end) -- 1 callServer('isAccountRegistered', username, password, function(state) end) -- 2 callServer('isAccountRegistered', username, password, caseVariable, function(state) end) -- 3 It goes through all arguments and detects if there is a function, then that one will be the callBack function. See here where that happens in the source code: https://gitlab.com/IIYAMA12/mta-communication-enchantment/-/blob/master/sync/sync_c.lua#L77 https://gitlab.com/IIYAMA12/mta-communication-enchantment/-/blob/master/sync/sync_shared.lua#L250 So you want to do that, what you already can do and doing it already? ?
  9. You could attach the camera to the ped, see example in this link: https://wiki.multitheftauto.com/wiki/GetCamera The example explains how to attach the camera to a vehicle, without the need of updating the camera with onClient(Pre)Render.
  10. Colshapes are more reliable. You could try these functions: https://wiki.multitheftauto.com/wiki/GetElementColShape < use on marker https://wiki.multitheftauto.com/wiki/GetColShapeSize If there is some abnormality in height --> https://wiki.multitheftauto.com/wiki/CreateColTube (https://forum.multitheftauto.com/topic/100069-tut-addeventhandler-on-a-group-of-elements-small-tutorial/)
  11. IIYAMA

    Time?

    Yes, @Tekken just gave you that one a few seconds ago.
  12. IIYAMA

    Time?

    You probably did it correctly, the only problem is that this event cannot be cancelled. Since the damage has already happened on clientside a while(few milliseconds) ago. This event represents a reflection of the past, not the moment the player got damaged. The now moment: onClientPlayerDamage
  13. local loc_ if #locations > 1 then repeat loc_ = math.random(#locations) until loc_ ~= loc else loc_ = locations[1] end loc = loc_ To not repeat, you need to repeat ?.
  14. It is not the zombie resource alone that causes the error. Another resource is making clientside peds, this combination will make it possible for the error to appear. If you do not have clientside created peds in your server, then you will not be able to get this error.
  15. if getDistanceBetweenPoints3D ( x,y,z, zx,zy,zz ) < 50 and not isElementLocal (zomb) then I guess it is because the ped is created clientside. I haven't seen this error before to be honest.
  16. Oh sorry, I meant this one: https://wiki.multitheftauto.com/wiki/Shader_examples#dxDrawCircle but you still need that image to make the borders smooth.
  17. This one is less demanding: https://wiki.multitheftauto.com/wiki/DxDrawCircle Photoshop: Create a png image (256 × 256), with . Give black borders. Fill with a white colour if always filled, else use behind the image. If filled with a white colour, it can be re-coloured with: https://wiki.multitheftauto.com/wiki/DxDrawImage tocolor(255,255,255,255) Create texture with mipmaps enabled: https://wiki.multitheftauto.com/wiki/DxCreateTexture What does mipmaps do? https://flylib.com/books/en/1.541.1.66/1/ Try to give the image
  18. Yes that could work in terms of ped management. But that does not solve the hard coded error, that will occur when the client has not added the <event> yet, while receiving <that event> from serverside. It can even lead to desync when serverside is not sure if the client has received it's message. Sure you can repeatedly send the same data, but that will be an unnecessary data transfers (in my opinion). You want to start the dialogue between clientside and serverside when you know that both sides are ready, so that your resource can be optimized for data reduction.
  19. No, when for example a control state has changed, you keep that information on the server. With this information you can inform new/not loaded clients about the current states of the peds. pedDataCollection = {} -- set-up pedDataCollection[ped] = { running = false } local pedData = pedDataCollection[ped] pedData.running = true It can also reduce data tranfers between the client and the server. So if you know that you set the ped to run, you do not have to tell all clients later again that the ped is running. It is, but it gives error when a client has not loaded their resources. Which is in my opinion not very clean. You want to reduce errors to the minimal to prevent lag.
  20. Unfortunately there are no guaranties that it will be a success. All you can do is making sure that you bring a lot of people in to your project. That way you can validate your concept(s) before you are actually going to building it. And a lot of trial and error testing is important. That being said, a lot of patiences until you got your concept and prototype-gamemode right is key here.
  21. I only succeeded once. It takes a lot of time, unmeasurable... If it is a simple gamemode like [gamemodes]/[hay]/hay (except for the math...), it is more achieve able. If you are talking about a RPG gamemode, you should rely more on community resources, else you need a lot of people to make it to a success. The risks of not finishing the gamemode is very high in general. Keeping motivation is the hardest part... if you stop temporary, the risk of not finishing increases. So make sure to not have an exam in between, or a teammate that has exams... I moved your topic to resources, since a gamemode is a resource from the very core.
  22. The syncer (which can be anybody as long as the ped is streamed in for that player) will synchronized the following: Position Rotation Velocity < probably ??? unknown stuff, I did not test everything ??? The most other things are not synchronized. For example: Control state (triggerClientSide/elementData required) Model (unless set by serverside) Dimension/interior (unless set by serverside) See next page You have to keep track of the ped control states on serverside. You can use tables for that or even elementData, just pick what you can work with. But you probably want to start with keeping track of loaded players. The following code is used in the beta resource that I shared not long ago. local players = getLoadedPlayers() -- table {player, player, player} triggerClientEvent (players, "event-name", ped, "walk", true) --------------------- local loadedStatus = isPlayerLoaded (player) -- true/false Client Server My dataManagement Library used in the script above, might be a little bit complex but feel free to use:
  23. banner.thumb.jpg.6a6f3964895eb053008138288a6f07c9.jpg

    This is a [beta] release for the turret resource. The resource is about creating turrets in your world and assigning owners to it (account-names). Followers/profile visitors will be able to download the resource before anybody else. See [BETA] download below. The resource will be available on the community once all ? are found and important features (from you guys?) are implemented.

     

    Feature list:

    • Custom rockets  (Customizable through Lua scripting)
      The behaviour of rockets are writing from scratch. Heat-seeking ones even support re-sync position/orientation.
       
    • Turret creation and management
       
    • Replace all rockets with custom ones (Feature can be enabled/disabled through the resource settings)
       
    • Easter egg
      Can be found within area69. Once triggered something will change in the game.

     

     

    Resource settings in admin panel:

    The available settings will enable and disable the replacements of default rockets with custom rockets.

    • On foot (recommended ping < 150)
    • Vehicle (recommended ping < 80)

    If the recommendations are not met, nothing bad will happen as you can't get hit by your own rockets, but it might look a bit weird for the rocket creator ?. The rockets are created serverside, this means that the one that creates them will notice a delay[ping] between firing and seeing the rocket. For the other players  the moment of creation should look OK.

    afbeelding.thumb.png.390b7b5ae5e70d2ce0d05b8e1599ad24.png

     

    Open GUI?

    • Login as admin
      Spoiler

      Modify scripts/security_s.lua if you want this to work differently

       

    Command:

    /turret

    Features:

    • Add/remove turret
    • Multi user support (limited to 1 editor for each turret)
    • Set position/orientation
    • Add/remove turret owners (account-names)

    GUI-early-version.thumb.png.402f1784b15ee529ef050e10365421b7.png

     

    Pros custom rockets

    • Re sync heat-seeking rockets
    • Multi syncers
    • More reliable rocket speed. People with low FPS will see the same speed as players with high FPS.
    • Customizable without GTA restrictions.
    • Can be created serverside.

    Cons custom rockets

    • More CPU will be used to compute the custom behaviour of the projectiles. (Serverside as well as clientside)
    • More data will be transferred between client and server.
    • Not streamable from clientside. (Creates a delay[ping] for the rocket creator)

     

    Developers:

     

    Special thanks to:

     

    [BETA] Resource download:

    turrets.zip

    Enjoy. Don't forget to leave some feedback!

     

    Hint for the easter egg, if you can't find it. ?

    Spoiler

    afbeelding.png.bda0678259376e05e5f19e0487b73202.png

     

  24. Neither of those weapons have bullet sync enabled. The following weapons did work for the client variant in the past: https://wiki.multitheftauto.com/wiki/OnClientPlayerWeaponFire As for the camera, since it 'semi-auto'(as far as I can remember) a bindkey would fit perfectly: https://wiki.multitheftauto.com/wiki/BindKey
×
×
  • Create New...