Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. Implement some feature (which some people may dislike) when there are enough scripting features and people who own servers can do that? I think it wouldn't really be a good idea.
  2. addEventHandler ( "onMarkerHit", End1, onEnd1Hit ) Element End1 doesn't exist because its value is nil when resource starts. Possible ways to solve this: 1. Move addEventHandler into function Stuff after element creation. And checking if source is equal to End1 is useless because this condition will always be true unless End1 has children elements. 2. In addEventHandler line change End1 to getRootElement().
  3. onClientLogin parameters are different from parameter in your script. Never put 'source' into parameters list for events.
  4. That didn't work. BUT you made me look at the source of MTA and now I found that and solved the problem. Thanks!
  5. This is a question to MTA developers because they did this in MTA. I'm making a mod for GTA SA and one of features is drive-by with full aiming from driver seat. But there's a bug that keeps turning camera to the front. I noticed this stops for a few seconds if I turn camera with keys on the keyboard. So maybe there's a timer or something like that? What values do I have to change in game memory to fix that bug?
  6. DiSaMe

    Few questions.

    Total limit of all types of elements is 65536. But number of elements streamed in is lower. You can only see the nearest elements.
  7. Do you mean you want to spawn a server-side vehicle by using GUI? http://development.mtasa.com/index.php? ... erverEvent
  8. I think we need attachElementToBone function. From positions of bones we (at least me ) can calculate angles only in two axes. Using getPedBonePosition needs some scripting to make attaching server-side. In SCM scripting it's possible to attach objects to bones and you can also set offset. If it's possible in SCM scripting, then it should be possible to make something like that in MTA too.
  9. You're right about object animations. They exist in GTA SA and I think implementing them into MTA would be nice. But opcode 035D doesn't make objects destroyable. Some objects can be destroyed, some can't. Those which can be destroyed, they are destroyable by default. Opcode 035D only sets whether the object can be aimed at with auto-aim (when controller type is set to joypad in options) or you can only use manual aiming.
  10. Correct me if I'm wrong, but as far as I know, SA limit adjuster wouldn't increase the limit of elements in the server. It can only increase the maximum number of elements that are streamed in.
  11. MTA SA DM has limit of 65536 elements of any type in the server.
  12. I think you don't need any uninstalling. At least I install new nightly build over the old version.
  13. Yes, I just divided it and it's still the same. By the way, I just noticed that even dividing 256 by 10 or multiplying by 0.1 returns 25.60000038147.
  14. My problem isn't about sending data to client. The code I just wrote returns incorrect result and is completely client-side. In my gamemode I have 256mg amphetamine in the inventory. This number is sent from server and displayed correctly with GUI. But where it shows the mass in kilograms, it multiplies those 256mg by 0.000001 (which is stored in client-side) and displays 0.00025599999935366.
  15. Because I don't want to create thousands of topics, I'll tell you about my another problem here. a = 5*1e-005 outputChatBox(tostring(a)) When executed server-side, it outputs 5e-005. In client-side it shows 4.9999998736894e-005. How could I make it be shown correctly?
  16. Yes, I know that, but some of the data has to be synced with clients. Right now my gamemode uses triggerClientEvent for that. But if using element data is so inefficient, maybe I'll stay with tables. I think I don't need to sync player inventory with all clients just because he bought one more item when he already has 50 items and he must see them all in his inventory window
  17. math.deg(math.atan2(x2-x1,y2-y1)) I think this should work, but you may have to negate it (put - at the start of the line) or swap x1 with x2 and y1 with y2.
  18. I have just decided that using element data functions would be better than array of players data. And some of data is in array format too. So I have to do something like this with element data. This is what I tried with runcode resource: setElementData(player,"array",{4,5,6}) Then checked it: getElementData(player,"array")[2] It returned 5. It's OK. Now here's the problem. I try to change one field in array: getElementData(player,"array")[3] = 7 But when I use getElementData(player,"array")[3] it still returns 6. Is there any way to use element data as array?
  19. I played SA-MP, then heard about MTA when only race version was available. I got tired of SA-MP and MTA SA DM was released soon. I downloaded and tried it. First server I successfully connected ran team deathmatch gamemode. I didn't enjoy gameplay as much as I enjoyed knowing I will never have to use SA-MP to play GTA online. I had started making gamemode on SA-MP, but hadn't done much. Soon after downloading MTA SA DM I decided to start scripting on it. When I looked at code examples in MTA wiki, scripting on MTA looked harder than SA-MP, just like for many other SA-MP scripters. But soon I realized it's much easier. My first script was a very simple gamemode which spawned player in the middle of map. I asked for help here: https://forum.multitheftauto.com/viewtop ... 91&t=22041 and soon got an answer. I was involved in MTA scripting
  20. It's possible by making a program that reads IPL files, finds traffic lights and writes light positions to a file
  21. createPickup(x+math.sin(math.rad(-ang))*5, y+math.cos(math.rad(-ang))*5, z, 0, 100) As you can see, you only have to multiply values math.sin and math.cos return.
  22. function spawnObj( source ) local x,y,z = getElementPosition( source ) local ang = getPlayerRotation( source ) createObject( 3267, x+math.sin(math.rad(-ang)), y+math.cos(math.rad(-ang)), z ) end addCommandHandler( "samsite", spawnObj ) Didn't test, but if I didn't make a mistake, it should work.
  23. It looks like peds health isn't really synced. Something like this happened to me. I spawned many peds, then killed them. Then I spawned many peds again and killed them too. I turned around and then I saw peds that were streamed out, weren't dead.
  24. I didn't know where to post this, so I post here. First bug is about peds. When I create ped with model ID 105, then stand near him for a few seconds, he says something to me, then I answer negatively, he attacks me. I have tested this with other GSF's and ballas peds, but only ID 105 had this bug. Second bug is about getElementPosition(). There are some non-solid interiors in the game. I want to make them usable in my gamemode. So I put some solid objects and set their interior (don't know if this affects getElementPosition()) to 255 to make them invisible. When I stand on those objects, getElementPosition() returns wrong coordinates like I was a few meters from the center of the map. When I jump the air or go onto solid part of interior, getElementPosition() returns correct coordinates.
×
×
  • Create New...