Jump to content

DiSaMe

Helpers
  • Posts

    1,449
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by DiSaMe

  1. Leaning reduces the air resistance, so that's completely logical.
  2. I don't see any reason why making another function is better than fixing the existing one. What would the outcome be? A function which works improperly in the vehicle and another function which doesn't work on foot? Doesn't sound really good. Such as?
  3. setPedAimTarget is supposed to make the ped aim at the point, either on foot or while doing a drive-by, but it doesn't work properly in the latter case. It's a bug.
  4. When you're firing the weapon, the ammo of the flamethrower decreases slowly and a momentary shot may not decrease the ammo shown in the HUD. But 10 momentary shots will. The point is, the game shows 10 times less of the flamethrower ammo than there truly is - that's how the HUD works. The problem arises from inconsistency between the weapon give/ammo get functions. Weapon giving functions measure the ammo in the same way the HUD does, while ammo get functions use the actual ammo value.
  5. DiSaMe

    Delete

    If I understand you correctly, you need MTA anti-cheat to read the players' minds and find out whether they're intentionally causing the lag or not. This cannot be done - first, it needs special hardware to read the signals from the brain, and second, processing these signals into usable information needs a lot of work
  6. That's because you're creating the table before creating the functions.
  7. Then why make huge downloads before playing instead of downloading them during the gameplay?
  8. 0x000010 is a number. 0x000010 is 16. Debugscript clearly says what the problem is. You missed the property name (should be "flags") in your case and used the value (which should be the 4th argument) in its place.
  9. local Table = {0.1, 0.3, -0.15}
  10. This question isn't directly related to MTA, but since I have plans to do something in MTA, I'm asking here. Although mods which bring the map of one game to another (such as Liberty City in GTA SA) are pretty common, I still want to ask to be sure. Is it completely legal to make such mods freely available to download? I mean, the map makes up a big part of the game's content, so converting it to the other game's format and uploading it is not so much different from uploading the game itself. I would like to try putting the Liberty City and Vice City from GTA3 and GTA VC into MTA server, but is it legal to simply upload the map models and textures converted to GTA SA format or is there anything else I need to take care of?
  11. Wake up! SA-MP does not have and never had an ability to use CJ clothes as objects. There's nothing to be jealous of, as MTA has everything what's needed for this. You can import custom objects with engine functions.
  12. When you set the value of the field to nil, that field is removed, so the memory will be freed. That's the point of nil - it is a way to represent the absence of the value. That's the reason why you get nil from non-existing variables or uninitialized fields of the table. If nil didn't have such special behavior, it would be not different from false, therefore an useless duplicate.
  13. Using setElementPosition without setting the 5th argument to false will reset the animation. Try something like this for speed-up: local speedmult = 0.1 addEventHandler("onClientPreRender", root, function(timeslice) local x, y, z = getElementPosition(ped2) local vx, vy, vz = getElementVelocity(ped2) local speedmult = speedmult*timeslice vx, vy, vz = vx*speedmult, vy*speedmult, vz*speedmult setElementPosition(ped2, x+vx, y+vy, z+vz, true) end ) As you can see, it gets the velocity of the ped, multiplies it by some value (you can change the speed by editing the speedmult value) and adds it to the position, so it moves in the direction where the animations and control states make it move.
  14. Updating the table is faster than using getElementsByType every time. When you call getElementsByType, you are creating a new table and doing this every 0.3 seconds isn't efficient. When you update the table, the slowest code to execute is looping through all players and using table.remove (which also pushes all elements back by one index) and doing this when the player leaves isn't that much. So if you're after performance, update the table instead of creating a new one. By the way, it's better to use the player element as the key for the table: --onPlayerJoin myPlayers[source] = true --onPlayerQuit myPlayers[source] = nil --looping through all players: for player in pairs(myPlayers) do end No need to loop through the table on quit, Lua will take care of what's needed, resulting in best performance.
  15. The doors of Patriot have no textures. You could edit the model of the vehicle to add the textures or make a workaround which gets the positions of multiple points of the door (using getElementMatrix) and display the image there with dxDrawMaterialLine3D / dxDrawMaterialSectionLine3D.
  16. That's wrong. Element data is always synced unless you set the 4th argument to false.
  17. You can try using Lua coroutines. They are a nice way to pause the execution of function and resume it later. An example: function infiniteLoopFunction() local lastresume = getTickCount() while true do --do something if getTickCount() > lastresume+200 then coroutine.yield() lastresume = getTickCount() end end end function resumeLoopThread() coroutine.resume(loopThread) end loopThread = coroutine.create(infiniteLoopFunction) resumeLoopThread() setTimer(resumeLoopThread, 400, 0) This code will execute the infinite loop in the infiniteLoopFunction function, but will not cause the error. It runs the loop for 200 ms, then pauses for another 200 ms before resuming the loop again. More about coroutines: http://www.lua.org/pil/9.html http://lua-users.org/wiki/CoroutinesTutorial By the way, I used coroutines in my traffic resource to load the paths. It takes 8-9 seconds to load them on my older computer and the maximum execution time of the loop (unless you use certain functions) is 5 seconds. To avoid "too long execution" error, I put the loading code into the coroutine and the problem was solved
  18. I'm not sure what you mean. The only type you can use as account data is string. It all depends on how you convert the values between strings and other data types.
  19. Element data and event triggering are the only general ways to send the data between server and client. What's wrong about using those functions?
  20. Are you setting the money on the client rather than server? If you do, then you're not really setting it - client-side money functions only change the value which the player sees, not the one which is kept in the server.
  21. There's no way to send the data between server and client without using any bandwidth.
  22. DiSaMe

    fileOpen..

    All what xmlLoadFile does is loading the data from the file into memory. It doesn't do anything related to the data transfer.
  23. DiSaMe

    fileOpen..

    Of course, you have a file because you load it using fileOpen. Use xmlLoadFile to get the node instead.
×
×
  • Create New...