Jump to content

Pigfoot_Nosebeggar

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Pigfoot_Nosebeggar

  1. Nevermind, i just found setVehicleTurnVelocity... I overlooked it like 100 times while scrolling...
  2. Does nobody have an idea? I am grateful for a hint in the right direction.
  3. Hello all, I'm sure a lot of you have at least once played on the FFS Gaming server. I'm trying to replicate the exact effect of driving through an oilspill in the "shooter" gamemode. For those of you who have no idea what I am talking about: I want to make a vehicle spin around it's own axis really fast, slowsly slowing down, while preserving the original momentum as soon as it touches a colshape. Does anyone have an idea? Help will be greatly appreciated
  4. Thank you so much for this explanation arezu. Very helpful! Exactly what I was looking for!
  5. Hi, I'm fairly familiar with scripting MTA, but there is one problem I just cannot wrap my head around. An easy example. Let's say I have this: local k = 0 while k<=10 do k=k+1 --<---This initalizes a global variable outputChatBox(k) end All I want is to change the value of the local instance. Same problem as: local a = math.random(1,5) local b = math.random(1,5) if a>b then local k = 12 else local k = 13 end outputChatBox(k) Of course this does not give me anything, and I wouldn't wanna do this: local k = false local a = math.random(1,5) local b = math.random(1,5) if a>b then k = 12 else k = 13 end outputChatBox(k) I'm quite cautious with global variables in serverside scripts. However the script I am working on requires me to work serverside, and "k" can NOT be made global, as this would mess up everything for all other players. What is the best way for getting around this? I can not trigger serverevents from within a client loop or something, that would just be stupid.
  6. Thank you for the quick reply! I'll make sure to add lua tags in the future. About the variable condition: i was aware of that, basically the "....blablabla...." part was where the variable would be initialized, however I cannot seem to address the timer from within itself. [EDIT] I edited my original code to yours just to make clear what I'm trying to say, I hope that's ok.
  7. Hello dear people of the MTA Forum, This is my first post, should I have overlooked a sticky or something explaining rules of posting, please be kind. I've been scripting for 12 days straight since I first started learning lua. Having some experience with other programming languages helped me a great deal and I've been able to figure everything out up until now. I cannot for the life of me understand one thing: Let's say I have a function that makes the player sit down and do some other stuff while sitting. I don't have a particular example on hand so I'll just make one up. condition = false function sitAndDo(player) setPedAnimation(player,"BEACH","ParkSit_M_loop",0,false,false,true,true) theTimer = setTimer(function() if condition == true then killTimer(theTimer) end end,10000,0) end This doesn't seem particularly clean, also it doesn't work. I want to continuously check if something happened yet and then of course make the timer stop. How do I accomplish this? I've been searching for days. Should i trigger a custom event as soon as the condition is true that kills the timer? Can someone please give me an example on finding the cleanest way? Also on an unrelated note: how do I check if the player/an element has moved. I cannot seem to find a suitable Event for that.
×
×
  • Create New...