Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Command

    Try to test it with a different command, if you want to test if the command is blocked. I never said that there are debug problems. I said that you have to add debuglines and test your code.
  2. It should be indeed not a problem. But keep in mind that once the function with a callback has been executed, it leaves the lua environment. If MTA doesn't tell lua to keep that function then the garbage collector loves to clean it. If you want to know this for sure, you can manually collect it and see if an error appears. It is probably old information if you ask me.
  3. Use a render target to merge multiple images. https://wiki.multitheftauto.com/wiki/DxCreateRenderTarget
  4. IIYAMA

    Command

    There is no 'event' in this code. Please add more debuglines, because I am very sure this is a human error.
  5. IIYAMA

    createWeapon bug

    One of the possibility is that it takes longer to load the model, when there are a lot of objects around. Which means it takes more time to create and stream it in. So try to give it some time.
  6. IIYAMA

    createWeapon bug

    I am well aware that attaching custom weapons are a bit buggy outside of the gta boundary. You have to drive/move the vehicle in order to attach them correctly. A small velocity push to the vehicle might do the trick. About that code. You are creating and destroy the weapons at the same time. Shouldn't you wait for the next frame? Also you might want to create the weapon near the player. With an offset of ~0, 0, 40.
  7. IIYAMA

    Spike system

    This code: if (getTeamName(getPlayerTeam(player)) ~= "robber" then return false end Shouldn't be able to executed because of: if player and getElementType(player) == "player" then So I am not sure if I am looking at the right code. Do no attach functions which are inside of other functions directly in an addEventHandler! They are not destroy able without accessing the globals: _G The function will be created infinity times! I recommend you to create a function outside of the block. addCommandHandler("putaspiketotheground", -- function(player, source) if (player) then local px, py, pz = getElementPosition ( player ) local rz = getPedRotation ( player ) local distance = 5 local x = distance*math.cos((rz+90)*math.pi/180) local y = distance*math.sin((rz+90)*math.pi/180) local b2 = 15 / math.cos(math.pi/180) local nx = px + x local ny = py + y local nz = pz - 0.8 local provz = rz + 90 local spike = createObject ( 2892, nx, ny, nz, 0.0, 0.0, provz) local x, y, z = getElementPosition(player) local x2, y2, z2 = getElementPosition(spike) local blow = createColSphere(x2, y2, z2, 3) addEventHandler("onColShapeHit",blow,function (player) if player and getElementType(player) == "player" then local pveh = getPedOccupiedVehicle(player) if isPedInVehicle(player) then if (getTeamName(getPlayerTeam(player)) ~= "robber" then return false end setVehicleWheelStates(pveh,1,1,1,1) setVehicleColor( pveh, 247, 39, 157 ) end end end) end end)
  8. IIYAMA

    createWeapon bug

    Not sure, maybe you can disable the streamer for it. https://wiki.multitheftauto.com/wiki/SetElementStreamable Check the output of the function to validate if it is actually doing something.
  9. If you every player to see the same objects, then serverside is the right thing to do. If you do not know how to work with tables then you can also work with elementdata, but it is a little bit dirtier. And can actually make it very dirty if it isn't removed. Use a flowchart to make the decision how you want to build it. Ask yourself this question: Which parts do I want to do serverside and which ones clientside?
  10. Create and destroy it clientside. I recommend you to create a flowchart if you have no idea how to build it. Which is actually very close to the code you are going to build, but at a more understand able level. You can later use that to inform yourself or your helper to build the components of the code.
  11. IIYAMA

    GiveWeapon

    Then it must be roleplay anticheat.
  12. IIYAMA

    GiveWeapon

    Try to run the play gamemode instead of roleplay and test the script. Most roleplay gamemodes do have anti weapon cheat.
  13. IIYAMA

    GiveWeapon

    You sure you don't run a gamemode with anti cheat next to it? And you aren't trying to give the weapon clientside?
  14. IIYAMA

    GiveWeapon

    But what is the problem? I don't know what to look for.
  15. You sure? Because isLineOfSignClear does not require a callback. addEventHandler("onClientVehicleDamage",root,function(attacker,wep,loss,x,y,z,tyreid) if (wep == 63 or wep == 51 or wep == 19) then local aX,aY,aZ = getElementPosition(attacker); local tX,tY,tZ = getElementPosition(source); iprint(isLineOfSightClear(tX,tY,tZ,aX,aY,aZ,true,false,false,true),aX,aY,aZ,tX,tY,tZ) if not isLineOfSightClear(tX,tY,tZ,aX,aY,aZ,true,false,false,true) then cancelEvent(); end end end); blowVehicle does not support the second argument clientside, only serverside. And I wouldn't recommend it to do it clientside because of desync.
  16. yea, true Explosions are forced to be sync. Last thing: (clientside only) bool createExplosion ( float x, float y, float z, int theType [, bool makeSound = true, float camShake = -1.0, bool damaging = true ] ) Set damaging to false after recreation. P.s. car explosions might look different.
  17. Possible way to cancel damage and still see the effect. https://wiki.multitheftauto.com/wiki/OnClientExplosion https://wiki.multitheftauto.com/wiki/CreateExplosion Might cause a little temporary desync with other players. (If you cancel the event and other players are near you.) If you saw this at the server from bigbadbutler (chaos.de), then you have to know that he used custom health instead of normal health which is a very different approach.
  18. IIYAMA

    GiveWeapon

    I don't understand your question, please rewrite last part. Not required: setWeaponAmmo (thePlayer, 38, 500) Change: giveWeapon (thePlayer, 38, 1000, true) Adding the script to two sides is not correct, unless you know what you are doing. <meta> <script src="script.lua" type="server" /> <!--<script src="script.lua" type="client" />--> </meta>
  19. @Matevsz Why don't you start with learning how to interact with a table? Your table structure is incorrect created based on the data that is inside it. Either put more data inside each item(sub table) or make each item the value(number) and not a sub-table. If you do not understand about a word of what I just said, start this: Or boring, but useful: http://lua-users.org/wiki/TablesTutorial
  20. Even so you will need to brute force it, because it a one way encryption. passwordVerify can't convert them back to original, it can only check if a hash is the same as the original password. Which means you need the original password first. @quindo oh you were quicker haha I would say: Brute force + this function = ~2030+. (Not sure how long that would take) After all, if you want to make it more harder, you can use teaEncode on top of it. (which I do) https://wiki.multitheftauto.com/wiki/TeaEncode Problem solved.
  21. I updated some content. If you find some typo's/etc Feel free to mention it. It is not my mother language after all. Thank you for the support guys! You are the best!
  22. Line 5. for i = 0, 16 do local upgrade = getVehicleUpgradeOnSlot (source, i) if ( upgrade ) then addVehicleUpgrade (source, i) end end What do you want to do here? Because I doubt this is what you want. Maybe something like this: local upgrades = getElementData (source, "upgrades") if upgrades and type(upgrades) == "table" then iprint("upgrades found") for i=1, #upgrades do if upgrades[i] then addVehicleUpgrade (source, upgrades[i]) end end else iprint("no upgrades found") end (of course you need to set the elementdata first before this is going to work) Untested Line 48. Please check the syntax of setElementData. You have now filled in one argument, but you need to fill in at least 3. https://wiki.multitheftauto.com/wiki/SetElementData Line 57. local car = getElementData(source, "hisCar") and setElementData (getVehicleUpgrades (source, "hisCar"))
  23. IIYAMA

    My Code

    I really do not understand, what you want with this? Afaik you have helped a lot people. Just some people do consider us as slaves... Please don't worry about those garbage idiots. Ignoring is the best solution.
  24. IIYAMA

    Binds

    https://wiki.multitheftauto.com/wiki/GetBoundKeys
  25. With: https://wiki.multitheftauto.com/wiki/AddVehicleUpgrade Here you can find all vehicle functions: https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#Vehicle_functions
×
×
  • Create New...