Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. 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.
  2. 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
  3. 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.
  4. 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)) --
  5. 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?
  6. 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.
  7. 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...
  8. 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
  9. 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)
  10. Search(try) for it yourself, 99% of the gta effects are in there.
  11. Use: setPedCameraRotation
  12. Must be somewhere in here: https://wiki.multitheftauto.com/wiki/Element/Effect
  13. 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!
  14. 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
  15. 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.
  16. 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
  17. "onClientPlayerDamage" setElementHealth
  18. http://s6.dosya.tc/server9/ssefpp/hs.zip.html Working.
  19. Send me the full script in a zip file. Your poor debug skills are getting the better of me, looking at the freaking debug console isn't enough.
  20. restarted the resource? And: headshotDamage = 200?
  21. If it sets your health to 90, then you still haven't set the 90 to 0. local newHealth = math.max(playerOriginalHealth - headshotDamage, 0) ...
  22. I did test the code without this part: if not ( bodypart == 9 ) then return false end -- check if the player has been hit in the head if not attacker or not ( getElementType( attacker ) == "player" ) then return false end -- check if the attacker is a player Just to check if it is working (because I didn't have a dummy to test it on). It did work. If you disable that, will it give you an insta-kill when you receive any damage? If not, then you have :Oed it up somewhere along the way.
  23. You edited line 7, that is a bit sloppy of you. If you put that to 90, the health can never be lower than 90. If you want it to work, change it back to the code I gave you. My code: local newHealth = math.max(playerOriginalHealth - headshotDamage, 0) Your code: local newHealth = math.max(playerOriginalHealth - headshotDamage, 90)
×
×
  • Create New...