Scripting Moderators
  • Content Count

  • Joined

  • Last visited

  • Days Won


IIYAMA last won the day on February 26

IIYAMA had the most liked content!

Community Reputation

950 MTA Ambassador


  • Rank
    Scripting Moderator & User Guide Contributor
  • Birthday 01/01/2016


  • Gang
  • Location
  • Occupation
    I have never been to the streets of SA... so who knows?
  • Interests
    Design, scripting, UX/UI

Recent Profile Visitors

9,384 profile views
  1. Options: A. use the command: /refreshall B. Empty your client cache MTA San Andreas X\mods\deathmatch\resources Source:
  2. hmm, it is kind of a strange error. Since freeroam doesn't request the files from the path /data/ rows={xml='stats.xml', attrs={'name', 'id'}}, File fr_client.Lua. Line 461 This error is showing when starting freeroam or always?
  3. Those files are located in: \[gameplay]\freeroam Try to unzip the resource (and delete the zip)


    See example below this function: https://wiki.multitheftauto.com/wiki/DxDrawCircle
  5. @anlaltnay Download the latest freeroam resource from: (after downloading, located in [gameplay]) https://github.com/multitheftauto/mtasa-resources
  6. You can use the addCommandHandler. addCommandHandler ( "givemoney", function (responsibleElement, commandName, teamName, money) iprint("givemoney command used") if responsibleElement and getElementType(responsibleElement) == "console" then iprint("the one used the command is the console") money = tonumber(money) if teamName and money then iprint("parameters are valid!") -- do your stuff end end end)
  7. In most cases not. It does indeed reduce memory, but that only matters when the variable contains a lot of data. For example: A variable that contains a table reference with > 1000 items. Cleaning this data will not boost your performance directly, it will only allow your users to use less HDD memory when they do not have enough ram installed. Which will indirect result in improving the performance. People with 4 gb ram installed on a windows 10 computer, that is segment you are helping.
  8. You might be able to test that. Initial Put yourself or the vehicle you want to test in the air. Gravity to 0. Speed to 0. Start Write down the velocity for every frame. Set the default gravity and test how the speed is changing for the first few frames. Note: keep in mind that vehicles also have their own mass.
  9. Note: you can also apply the matrix of the ped to the projectile. It might not have the correct rotation in the beginning, but you can correct that. setElementMatrix
  10. Here some code snippets I ripped out of one of my scripts. The code was used to calculate the new projectile position based on frame time. This would terminate different projectile speeds based on FPS. -- add function findRotation local findRotation = function ( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end -- add function findPitch local findPitch = function (camerax,cameray,cameraz,pointx,pointy,pointz) local dX=camerax-pointx local dY=cameraz-pointz local dZ=cameray-pointy local pitch=math.atan2(dY,math.sqrt(math.pow(dZ,2) + math.pow(dX,2))); return pitch end local xr, yr, zr = getElementRotation(source, "ZXY") -- source is projectile -- xr, yr, zr is saved inside of projectileData.rotation local targetX, targetY, targetZ = getElementPosition(target) -- target is projectile local rotZ = findRotation(newX, newY, targetX, targetY) + 180 local pitch = findPitch(newX, newY, newZ, targetX, targetY, targetZ) local rotX = pitch*(180/math.pi) local newRotX = projectileData.rotation.x local newRotZ = projectileData.rotation.z local rotationDistanceX = (projectileData.rotation.x - rotX + 360) % 360; if (rotationDistanceX > 180) then rotationDistanceX = 360 - rotationDistanceX newRotX = newRotX + math.min(rotationDistanceX, behaviourData.rotationSpeed * speedMultiplier) else newRotX = newRotX + -math.min(rotationDistanceX, behaviourData.rotationSpeed * speedMultiplier) end local rotationDistanceZ = (projectileData.rotation.z - rotZ + 360) % 360; if (rotationDistanceZ > 180) then rotationDistanceZ = 360 - rotationDistanceZ newRotZ = newRotZ + math.min(rotationDistanceZ, behaviourData.rotationSpeed * speedMultiplier) else newRotZ = newRotZ + -math.min(rotationDistanceZ, behaviourData.rotationSpeed * speedMultiplier) end projectileData.rotation.x = newRotX projectileData.rotation.z = newRotZ local rotationZ = -projectileData.rotation.z if creatorVehicle then -- if the projectile creator was a vehicle, then add 180 to invert the rotation. rotationZ = rotationZ + 180 end setElementRotation(element, projectileData.rotation.x, projectileData.rotation.y, rotationZ, "ZXY")
  11. A local function is just the function value saved inside of a local variable. Like this (a local available before the function is defined): local test function test () end or this (a global, as well as a local after the local keyword): function test () end local test = test or this: (a local variable, available after the function) local test = function () end or this: (a local variable, available in and after the function) local function test() end So when do you need to use it? The same way as just a regular local variable. Variables that are accessed a lot of time. (onClientRender) Variables that are only available within it's scope. Variables that are temporary required. etc.
  12. @VaporZ Stop moving, you can easily ask that question here. Now you are just pushing other people their topics down, that deserve the same attention as yours.
  13. Nope, there are other methods, like checking if rectangles are colliding. But if you use 2, it doesn't mean it is more difficult. Infact it is a lot easier to create a computed version of your grid. It tells you exactly which cells are being used and you can throw it away when you do not need it any more. An item ID, which is the one of the item you want to move. This value is an integer, the first column located in your db table.