Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. Did you read and try to understand my post or did you copy and paste the code?
  2. The problem about peds is that they don't keep animation data when they're streamed out for the client. This is the easiest workaround: local djPed = createPed (47,1984.86975,1526.91504,12.82) setPedRotation (djPed, 0) setTimer(setPedAnimation,1000,1,djPed, "DANCING", "dnce_M_c") This will apply animation 1 second after the ped has been created. During this time, the ped is likely to be streamed in for the player. But if you go far away, the ped will be streamed out and won't perform the animation when you go back. This is a more reliable way to make him dance: Server-side script: local djPed = createPed (47,1984.86975,1526.91504,12.82) setPedRotation (djPed, 0) setElementID(djPed, "djPed") Client-side script: function initPed() local djPed = getElementByID("djPed") addEventHandler("onClientElementStreamIn", djPed, makePedDance) end addEventHandler("onClientResourceStart", resourceRoot, initPed) function makePedDance() setPedAnimation(source, "DANCING", "dnce_M_c") end The server itself doesn't make the ped dance. Instead, it sets an identifier which the client uses to get the ped element. Then it makes the ped perform animation every time it's streamed in.
  3. getScreenFromWorldPosition
  4. No, but I will release it at my scripts website. I don't want my works to be somewhere between thousands of works of other people
  5. I think it is possible to find free scripters. If you have good scripting skills and have done something special, some people may want to join and form a team with you. But if you don't, then you won't do benefit for them and they're not going to work with you.
  6. What's not simple? Downloading a resource? If it's hard, then scripting is going to be difficult for you anyway and there's nothing to simplify.
  7. On the client, all peds streamed in are looped through onClientPreRender and their control states are updated, but it doesn't seem to make my PC lag any more than it already does when there are many peds and vehicles around On the server, generating peds slows down a little bit, but I know why exactly it does and how to optimize it and this happens because creating elements takes some time, so there's nothing I could do to optimize it And the bandwidth is something what i'm not sure about. I store tables with task parameters as element data to sync ped actions. Something like this: {"goToPoint",x,y,z}. Anyway, if something is wrong, reducing traffic density will help. Something is still better than nothing.
  8. Here's a video about the script which I'm working on: Bots are generated around the players and disappear when they are far. Driving peds stop if there's a player, ped or a car in the front. They also stop when traffic lights are red Edit: new videos of released traffic and path editor scripts:
  9. Technically you can't, but you can make MTA replace and restore models depending on player's position, so that one model is used on ID in one place and another model in another place. I don't know if that's stable enough, though. It didn't work well for me when I tried, but that was 2 years ago.
  10. Use these functions: setPedControlState setPedAimTarget
  11. According to http://gta.wikia.com/Unit , GTA unit IS meter.
  12. Added lava flood script:
  13. DiSaMe

    Billiard

    Nice, but... The balls don't rotate as they move. It would look better if they did.
  14. What's wrong with updating dimension client-side?
  15. getAttachedElements won't do the job because it's not an attachment done using attachElements. And the resource doesn't have the function to return elements attached to specific ped/player. The easiest solution would be setting object's parent to player using setElementParent and the object will be destroyed automatically when player quits.
  16. I did not "forget" this. I think it's up to scripters to do this in their resources. Elements attached with attachElements don't change their dimension and interior automatically either. I want to keep it consistent.
  17. The snow is an object with a custom model and it's raised with setElementPosition.
  18. It should work. But it doesn't save tags which are sprayed on elements (MTA objects, vehicles), because elements are destroyed when the server stops.
  19. drawtag_bc does that automatically when you stop either drawtag or drawtag_bc and loads when you start both of them. If you want to make a tag saving script yourself, there are two exported functions, getTagData and createTagFromExistingData, which you can read about in readme.html. You can also look at save_tags.lua in drawtag_bc if you need an example.
  20. DiSaMe

    -

    Use: getElementMatrix That will get position and rotation vectors of vehicle. In this way you can get world coordinates from position relative to vehicle and use them in setCameraMatrix. To have continuous updating of camera position, you need to do this in onClientPreRender.
  21. Drawtag exports two functions for that purpose, createTagFromExistingData and getTagData. You can read about them in readme.html. Also, you can look at save_tags.lua in drawtag_bc to see how it uses the functions. It stores texture data into binary file and the rest of element data into XML file.
×
×
  • Create New...