Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. You were talking about vehicle element health and that includes any kind damage. Simple logic
  2. DiSaMe

    Tornado

    You need particle effects. MTA has effects functions, but I don't know if that will help you, as there are few effects. For all effects, you can download particle objects resource from community site or my site. Particle effects are created with objects. There's no rotating particle effect, but the direction of some particles depends on rotation of object which created them, so you can create a few objects, put them in the circle and rotate them in such way that particles would go around the center of tornado.
  3. DiSaMe

    don t work?

    Setting the parent of element doesn't do anything related to positions. You need this function: createBlipAttachedTo Get players in the team, cycle through them and create a blip for every player.
  4. That's because a custom element isn't an object. Its element type is "grass" in your map, so it's an abstract element. It doesn't have any physical representation in GTA world. You would get the same result if you created it in this way: createElement("grass")
  5. I think I could make it save the tags, but... not now
  6. DiSaMe

    Disable grass

    The only thing related to grass is the model under it. Grass is the part of the ground object which it grows on. It is generated automatically on surfaces. So you need to change the material of surface under it to prevent it from generating.
  7. I thought it would be a good idea to make a website where I would put my MTA scripts. http://crystalmv.net84.net It currently includes: Airbrake Bone attachments Bytedata Drawtag Gravity gun Lava flood NPC high-level control (HLC) NPC HLC traffic NPC HLC traffic editor NPC task sequencer Particle objects Server collisions Sticky fishes Traffic light sequence
  8. DiSaMe

    Disable grass

    The grass is the part of surface below them. It's the part of model which it is on. I think you should have noticed they don't grow in air - only on certain models.
  9. Player element and client are the same. When you trigger client event for specific client, you pass player element as the first argument.
  10. DiSaMe

    Disable grass

    Use map editor to get it. I'm not sure if MTA map editor will help you. If it doesn't, try MEd.
  11. I'd advise you to use element data. It's synced automatically by default, so you can set it on one client and all other clients will be able to see the changes and react to them. setElementData getElementData onClientElementDataChange When the key is pressed or released, use setElementData to change the data, such as: setElementData(ped, "shooting", keyState) And when element data of ped changes, set control state to whatever getElementData returns: local ctrlstate = getElementData(source, "shooting")
  12. Did you ever play GTA San Andreas? When your car gets damaged, fume appears, doors fall... Yes, I did. And did you? I shot the car with M4 until black smoke appeared and doors still weren't damaged at all.
  13. DiSaMe

    Disable grass

    As I said, edit .col file in some collision file editor and replace the collision model. You need to do so because this grass is the property of model.
  14. Thanks for the report. I had noticed this error message, but didn't know when it appeared. I've fixed it now.
  15. Hey everyone, this is a new version of Drawtag script. The previous version was just a demonstration, this one is really playable. MTA SA 1.3.1 is needed, though (or whatever it is, I don't know exactly, but this script uses dxDrawMaterialLine3D). P. S. On resources forum it says: "UPLOAD YOUR RESOURCES TO THE COMMUNITY CENTER!", is that a rule? Does that mean I can't post my resources there if they're not in community.multitheftauto.com?
  16. DiSaMe

    Disable grass

    I think you can modify material of the surface in .col file and import it as a custom collision model.
  17. Vehicle health is health of engine and most people can tell the difference between engine and doors So IIYAMA posted the right functions. But there are two more functions: getVehiclePanelState setVehiclePanelState
  18. The problem is in this line: if not ped[p] == nil then Because "not" has higher priority than "==", this line checks if (not ped[p]) is equal to nil. (not ped[p]) can only be true or false, so it will never be equal to nil. Either use: if not (ped[p] == nil) then or simply: if ped[p] then
  19. You make setTimer call the function 5 times every 0.5 seconds. That means the function won't be called after 2.5 seconds have passed.
  20. Serverside (same as your original code): function createPedForPlayer(thePlayer, command, pedModel) local x,y,z = getElementPosition(thePlayer) local ped = createPed( tonumber(pedModel), x, y, z, 0.0, true) if ped == nil then outputChatBox("Error ped was not created.", thePlayer) return end triggerClientEvent("OnPedWalk", getRootElement(), thePlayer, ped) end addCommandHandler("createPed", createPedForPlayer) Clientside: local ped = {} function makeWalk(thePlayer, thePed) ped[thePlayer] = thePed addEventHandler("onClientElementStreamIn", thePed, makeWalkOnStreamIn) end addEvent("OnPedWalk", true) addEventHandler("OnPedWalk", getRootElement(), makeWalk) function makeWalkOnStreamIn() setPedControlState(source, "walk", true) setPedControlState(source, "forwards", true) removeEventHandler("onClientElementStreamIn", source, makeWalkOnStreamIn) end Because makeWalk is called when the ped is created, it's possible that the ped hasn't streamed in for player and setPedControlState doesn't work. So instead, it should wait until the ped is streamed in (onClientElementStreamIn gets called) and then set control state.
  21. Maybe try debugging your code? Like adding outputChatBox into makeWalk to see if the function gets called at all? Edit: I found one more possible reason: On the moment the element is created, it's not streamed in for the player. setPedControlState probably doesn't work on peds which are streamed out. You probably need to set control state in onCilentElementStreamIn.
  22. Your code seems to be correct, and I see the reason why the ped doesn't move. You need to set "forwards" control state to true because "walk" only changes the moving speed from running to walking. It has no effect unless the ped moves.
  23. bindKey getControlState setPedAnimation
  24. I used to script in Notepad++ when I used Windows, but now I use Ubuntu most of the time, so I script in gedit.
×
×
  • Create New...