Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Meta src path

    You could use an export to import a table with your custom oop functions. Even though you will be indexing this table to access these functions instead of multiple variables. Another option could be loadstring. https://www.lua.org/pil/8.html
  2. This is something you can only figure out by debugging your code. Since you haven't done that properly, you go to the forum and say: 'it doesn't work but I do not know why'. But if you did do that properly, then you could say: 'This variable contains a wrong value.' This is NOT properly debugging: Staring at the debug console and waiting for an error/warning to show up. So follow a tutorial instead:
  3. not supported. The only thing you can do is create an overwrite, which will take a lot of time.
  4. you could try to find those with: https://community.multitheftauto.com/index.php?p=resources&s=details&id=7549
  5. There is an error/warning on line 28 when you write /check, don't talk bull:~. Use this tutorial to find your problem:
  6. You can't understand that the script overwrites/re-sync the melee damage that is given to peds by players? If that is not what you want, then indeed there is no possible way to help you.
  7. As I said before, it isn't fixable that way. I gave you a solution, use it if you really want it. Scripting is required as this is the scripting section.
  8. The way peds receive damage from melee attacks. If you use that resource outside the boundary on a ped, you would know. But I do not recommend you to use everything from that resource, because it is very old and consumes a lot of data.
  9. By creating an overwrite, that's the only fix. Need inspiration on how to do that? See this resource: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1065
  10. if #currentWeatherTable == 0 then setNewWeather() end Place between line 21 and 22. (in the current code here) Which will full up the 'currentWeatherTable' table again.
  11. function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end function getRightOrLeft(oldX, oldY, startX, startY, endX, endY) local rotZ1, rotZ2 = findRotation( oldX, oldY, startX, startY ), findRotation(startX, startY, endX, endY) local rotationOffsetZ = (rotZ1 - rotZ2 + 360) % 360; if (rotationOffsetZ > 180) then rotationOffsetZ = 360 - rotationOffsetZ else rotationOffsetZ = -rotationOffsetZ end return rotationOffsetZ > 10 and "right" or rotationOffsetZ < -10 "left" or "nothing" end So you have 3 positions... seriously... pffffff your really making it hard to help you. -- try to use this in your code iprint(getRightOrLeft(previousNode.x, previousNode.y, node.x, node.y, nextNode.x, nextNode.y)) --
  12. So 2 positions. (not 4) Technically it can't be left or right unless you compare it with an start-point. Is 0 your start-point? And what is left and right to you?
  13. It is still not clear to us what your end result will be. This is what you have: X, Y, X2, Y2 Not a 3e position?(else there is nothing to compare against) Where do you get your second angle from? Do you want to add or subtract 10, to get the ones you want to get the new rotation from? Or do you need the pitch rotation instead? If you still can't explain what you need, then I recommend to you visualize it.
  14. That's what it does... If you say the angle between them, it can only be positive.... (in my opinion) But if you talk about offset, it can also be negative. And it freaking works for me. Just test it...
  15. I am still having a hard time to figure out what you need. But you want to know the differences between the rotations right?(positive and negative) If you calculate from both sides the rotation with findRotation, you can use this code to find the offset: local rotZ1, rotZ2 = 90, -90 local rotationOffsetZ = (rotZ1 - rotZ2 + 360) % 360; if (rotationOffsetZ > 180) then rotationOffsetZ = 360 - rotationOffsetZ else rotationOffsetZ = -rotationOffsetZ end iprint(rotationOffsetZ)-- -180
  16. If you need the right and the left, you can add 90 or subtract 90. If you add/subtract 180, you will have the back of it. (it can also be lower than 0 or higher than 360, which is acceptable for using in mta functions)
  17. Search(try) for it yourself, 99% of the gta effects are in there.
  18. Use: setPedCameraRotation
  19. Must be somewhere in here: https://wiki.multitheftauto.com/wiki/Element/Effect
  20. IIYAMA

    advertisements

    Then you shouldn't be posting it here. We are not a service you know... We help people to learn scripting. If you aren't here for that, then unfortunately you are at the wrong section or even forum. Contact the owner of the resource or learn lua by yourself, those are the two options you have, make them count. I wish you the best of luck!
  21. Sometimes it is better to use the call function. Because some how it can fail to pass arguments, which I think is very strange. call
  22. That is the syntax of a function. It will tell you in which order you have to put the arguments and which values are allowed per argument. You can't place it directly in your code... Pls study the examples a bit of that function on wiki. If you put some effort in it, you can figure it out.
  23. blip createBlipAttachedTo ( element elementToAttachTo [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 99999.0] ) https://wiki.multitheftauto.com/wiki/CreateBlipAttachedTo
×
×
  • Create New...