Jump to content

DiSaMe

Helpers
  • Posts

    1,449
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by DiSaMe

  1. 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.
  2. 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.
  3. 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?
  4. 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
  5. 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.
  6. 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?
  7. 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
  8. It's possible by making a program that reads IPL files, finds traffic lights and writes light positions to a file
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. I like seeing noobs getting pwned by themselves when they say "SA-MP is better, MTA has only race and DM". I say then: SA-MP has only 0.2 However, 'DM' doesn't fit for MTA a little bit. When I hadn't played MTA and was going to download it, I was thinking about this - is it really DM or is it only the title. And when I saw it's not just DM and it's possible to script much more than in SA-MP, I was happy
  14. DiSaMe

    dxDrawFace()

    I just tried lag with dxDrawLine3D. I made the game draw 200 lines near each other that are 2 meters long and 100 units width. It was like a cube. And it was playable. Then I tried to make the game draw 400 lines, 4 meters long and 200 units width. Then the game was slower. And my computer isn't really very fast. Maybe dxDrawFace wouldn't slow down the game very much either? Oh, and one more thing: I noticed that dxDrawLine3D is drawn over HUD. And I think it would be good if dxDrawFace didn't do that. If it's going to be implemented into MTA, of course
  15. Why would it get reported if reinstalling works... There isn't any fix so far. But it ain't a major bug anyway. I may be mistaken, but if I remember correctly, onClientWeaponFire event doesn't get triggered when you are shooting with this bug.
  16. Maybe he wants to rotate the object.
  17. DiSaMe

    dxDrawFace()

    Speaking of this, why is dxDrawLine3D that slow actually? And it shouldn't lag that much if it ain't that big or not spammed near eachother. Hmm... Then it may lag a lot if I use it
  18. This may be too big request, but I'll give a try. Yesterday I tried function dxDrawLine3D. When I tested it, I realized the line was a plane in 3D. And if that is possible, maybe my suggestion is possible too? My request is function: dxDrawFace(x1,y1,z1,x2,y2,z2,x3,y3,z3,[color,postGUI,image_name,img_x1,img_y1,img_x2,img_y2,img_x3,img_y3]) Parameters: x1..z3 - positions of points, plane is triangular color - the color of the plane postGUI - you know this image_name - name of image file, texture for plane, if nil, then everything depends on color parameter img_x1..img_y3 - positions of points on texture Even though there are functions to replace objects, so that we can create our own, but this function would let to create new models and even modify them during the game. I hope it's possible. But I believe it may be not...
  19. Having two programs installed won't create any mess, will that? Just because SA-MP is installed, it doesn't affect MTA. SA-MP only affects the game when it's running. And you can't run SA-MP and MTA on the same GTA SA process at the same time
  20. OK, thanks. I had made XML accounts system in my gamemode, but I decided to get rid of it. Fortunately, I can use format with separating symbol
  21. Is there any way of writing fixed number of bytes from any data type? For example, if a string is shorter than specified number of bytes, it would be lengthened with bytes that have value 0 (byte number, not a character "0"). And no need to convert number to string? I don't want to convert 4-byte value to the longer non-fixed length string by making it harder to read...
  22. DiSaMe

    onClientRender?

    Maybe it gets speed of vehicle that doesn't exist (when player is on foot)? You need to make the script check if the vehicle exists.
  23. Yeah. You can do anything if you believe in that
×
×
  • Create New...