Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. function firstShow() local progress = ( ( getTickCount() - counter ) / 5000 ) local progress2 = ( ( getTickCount() - counter ) / 2000 ) :Oanim1 = interpolateBetween(1800, 0, 0, 1545, 0, 0, progress2, "Linear" ) alpha = interpolateBetween(alpha, 0, 0, 255, 0, 0, progress, "Linear") dxDrawImage(:Oanim1, 35, 50, 50, ":not/img/circle.png", 0, 0, 0, tocolor(255, 255, 255, alpha), true) if progress >= 0.40 then addEventHandler("onClientRender", root, secondShow) end end addEventHandler("onClientRender", root, firstShow) Warnings and errors do have influence on the smooth fps. Even if your fps is 60 or even 100... It could also be the images. If those are very large or unoptimised. (I do not know the file size, so I can't judge that) ":not/img/extend.png" ":not/img/circle.png" You can optimised them with .dds files. https://en.wikipedia.org/wiki/DirectDraw_Surface Tool to convert images in to .dds files: nightly.multitheftauto.com/files/shaders/DxTex.zip (not recommended for very large images and must be a power of two)
  2. dxDrawImage3D( x - 0.5, y - 1.25, z_ground, 1, 2.5, imagen, tocolor( 0, 255, 230, 255 ), 0, x, y, z +1 ) █XSIZE / 2 = █XOFFSET █YSIZE / 2 = █YOFFSET -- I am HERE on the LEFT / TOP-- -----\--/----- ------\/------ --LEFT / TOP-------------------- -------------------------------- -------------------------------- -------------------------------- ----------------RIGHT / BOTTOM-- LEFT / TOP = player position The size will be added in to the direction of the RIGHT / BOTTOM corner. SIZE > + \/ + Subtract 50% of the X Size and Y Size of the LEFT / TOP, will adjust the image position so that the image middle position is at the player position. --LEFT / TOP-------------------- -------------------------------- -------I WANT TO BE HERE-------- -------------------------------- ----------------RIGHT / BOTTOM--
  3. @Lalalu I know you didn't want to say that, because that would be very inhuman, but I just informed you what kind of effect it would have when a scripter says that to a scripter. You do not want people to get angry right? Then take my advice. Another thing, this is the scripting section. If you post code here, everybody would expect you to be a scripter. If you aren't a scripter, then make sure to write that down at the start of the topic. If you do not write that down, people would expect you to be capable of solve small adjustments like this. So make sure that the helpers are aware of your limitations. If I knew that you were not a scripter, I wouldn't have pointed out that this matter in the first place. I hope this information will help you in the future. Is the image position correct now? If not, be specific and show results(screenshots + code for example).
  4. ? dxDrawImage3D( x-0.5, y-1.25, z_ground, 1, 2.5, imagen, tocolor( 0, 255, 230, 255 ), 0, x, y, z +1 ) Using not a square image is a terrible mistake, but try this. And would you please stop that. Saying that is means the same as: 'I am too lazy to follow instructions and I will be waiting for somebody else to do it for me' You don't want to say that to people that are trying to help you.
  5. function zombset (player) -- this is clientside, not serverside! Use localPlayer instead of player. (you should be able to see a warning, if you do not use it.) local _, _, myrot = getElementRotation(localPlayer)
  6. (NOT little) * source code = update!
  7. I am eating popcorn for real, but it has nothing more to add except for turning clientside in to a hungry pac(kets)-man.
  8. Just send the account count to clientside. There are 11k accounts, eat my 11k popcorn. (1 trigger) The clientside can request: I want the account information of the accounts: 50 t/m 300 (1 trigger) The server will send back: (250 x account information in 1 TABLE and in 1 TRIGGER). It can't be more efficient... except for using the latent trigger variant.
  9. Your main problem is with the timer. Every time you enter the vehicle, it will create a new timer. function bekapcsoltOvEllenorzese(jatekos) beeping = setTimer ( function() if isPedInVehicle (jatekos) == true and getElementData (jatekos, "bekapcsoltOv") == false then triggerClientEvent ("beltWarning", jatekos) end bindKey (jatekos, "F5", "down", "öv") end, 1000, 0) end █ Creation of an infinity timer and saved in a global variable which is never killed. (and created a new one every time you enter a vehicle, which is causing the double bleep effect) But because you didn't debug your code properly you wouldn't be able to know that, as you are probably new to LUA. So follow this tutorial: IIYAMA: The understand of what your code is doing is more important than having working code.
  10. if the data should be shared with all players, then yes. Else you should go for the trigger[side]Event and for the less priority data the latent version.
  11. If you could test if elementdata does get send to the clients 100% successfully, even if it changes rapidly, then you might consider sending small updates using elementdata. So for example the player joins the server. Global: Every time you update something of your table, you update a counter which indicates which id this data contains. You wait for the resource to be load clientside. Then you send a triggerEvent from clientside to serverside. (saying: "I want cookies") The server sends with triggerEvent the whole table. (Included a ref id from the last update) From that moment you will be fetching elementdata from serverside and update the table. (the elementdata contains only the parts that are updated) This id you give to your elementdata can indicates if you are missing information. For example packets: 80, 81, 83 <-- Ey, I am missing update 82. I would say this is a very experimental thing to do, since I do not know what happens when elementdata stacks up. But I can tell you that using a trigger for an large amount of updates isn't a solution.(unless you update the table only ones in a while)
  12. @Einheit-101 root will accept everything, included players. There is nothing wrong with that.
  13. IIYAMA

    [BUG]META

    Probably the slash /, is not allowed. (even though it is allowed un-escaped in xml files) Or you could try to add: <min_mta_version client="1.5.4" server="1.5.4" />
  14. IIYAMA

    Help

    There is also another method, which works with the crosshair: https://wiki.multitheftauto.com/wiki/OnPlayerTarget https://wiki.multitheftauto.com/wiki/OnClientPlayerTarget Might be interesting for you as well. You can use it as fallback when you do not get it working with the cursor. Good luck!
  15. Show meta.xml Remove: gun1, gun2, gun3 and gun4 from the triggerServerEvent. Those elemens are clientside elements which shouldn't be trigger able.
  16. Ehm? I am here to help you else I wouldn't have read your post. Also you didn't asked us where you could add the spawn part in your code. You only asked us if we could take a look at the code where you tried to add it. To answer your new question: Spawn the player between line 16 and line 17. Also spawn the player between: 38 and 39. To fade the camera see code: addEventHandler("onPlayerSpawn", root, function () fadeCamera(source, true, 0.5) end)
  17. https://wiki.multitheftauto.com/wiki/GetPedMoveState or/and https://wiki.multitheftauto.com/wiki/GetPedSimplestTask or/and https://wiki.multitheftauto.com/wiki/GetPedTask or maybe this works as well: https://wiki.multitheftauto.com/wiki/GetPedTargetStart
  18. Can you script? If yes, then I will give you all functions you need. If no, then you should find a paid scripter.
  19. OnClientPlayerWeaponFire should be triggered.(client version) For serverside it is onPlayerWeaponFire and not onPlayerWeaponFired. (serverside version) I am not sure if this event will trigger on a frame render rate.
  20. I do not see anything related to spawning or fading the camera in this code. It is a 100% failure if there is no code... Would you mind stop fooling us? It is not even close to funny.
  21. An X amount of pixels on your resolution is automatic scaled to all other resolutions. This for example will create a perfect centred rectangle scaled for all resolutions: dxDrawRectangle((screenW * 0.5) - (50 * scalefactor), (screenH * 0.5) - (50 * scalefactor), 100 * scalefactor, 100 * scalefactor, tocolor(0, 0, 0, 145), false)
  22. I recent figured out that this is an easy way to calculate your absolute resolution to relative values: local yourScreenYResolution = -- <fill in> 900 wasn't it? local screenX, screenY = guiGetScreenSize() local scalefactor = 1 / yourScreenYResolution * screenY -- You created something of 50 pixels on 1440 x 900. outputDebugString(scalefactor * 50) -- And now it will be rescaled on all other resolutions correctly. Try it and don't buy it.
  23. local damageTimeCount = 0 addEventHandler("onVehicleDamage", getRootElement(), function(loss) damageTimeCount = damageTimeCount+1 local health = getElementHealth(source) - 250 local vehHealth = math.floor(health / 750 * 100) if vehHealth < 1 then setElementHealth(source, 250) end iprint("damageTimeCount: " .. damageTimeCount .. ", vehHealth 1: ", vehHealth) setTimer(function (vehicle, damageTimeCount) local health = getElementHealth(vehicle) - 250 local vehHealth = math.floor(health / 750 * 100) iprint("damageTimeCount: " .. damageTimeCount .. ", vehHealth 2: ", vehHealth) end, 50, 1, source, damageTimeCount) end) What is the result when you use this code?
  24. Almost as if SA-MP is missing some animations. Checked if it maybe had to do with the glitches. https://wiki.multitheftauto.com/wiki/SetGlitchEnabled But it seems that is not it. I also checked if it had to do with the FPS. (Which often causes animation/movement changes when it is higher than 30 fps) But it seems that is it not the cause either. Checked: setPedWalkStyle, which is also not responsible for it. If GTA san doesn't have this slowdown effect, then I guess it has something to do with improving the synchronization. If you do not slow down the animation, it might cause a small (visible) teleportation for other players because the direction velocity changes too quick.
  25. That has probably to do with the bandwidth saving (and maybe also finding it hard to decide which player should sync the vehicle).
×
×
  • Create New...