Jump to content

Einheit-101

Distinguished Members
  • Posts

    661
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Einheit-101

  1. Absolutely not possible. Cleo may be able to do this but not MTA. Too many vehicle functions / events are missing.
  2. I'm sorry, but this function IS bugged. Try to get the position of misc_c or the turret and you will see, that those are completely wrong and this has been reported at bugs.mtasa.com. Maybe the wrong turret position is caused by modified Rhino.dff models, i will test it with an unmodified model soon, but misc_c is surely wrong even with unmodified game files. Also, i dont want any turret rotation. I want to get the world xyz of misc_a and misc_c.
  3. getVehicleOccupants should work in a pairs loop.
  4. Hello community, i try to calculate the world position of the turret of the Rhino tank. I found this code on the web, but it does return wrong positions (at least X position is wrong), my tank is at x,y,z = 0,0,0 and this returns x=3 for the turret. Can someone tell me whats wrong? I tried to get the positions with getVehicleComponentPosition but this function is bugged and it returns wrong positions for turret and misc_c components so i used x,y,z = 0,0,1.1 for testing this code. function getComponentWorldPosition(vehicle, component) local m = getElementMatrix(vehicle) local x, y, z = getVehicleComponentPosition(vehicle, component) -- Vektor mit ElementMatrix multiplizieren local wX = x * m[1][1] + y * m[2][1] + z * m[3][1] + m[4][1] local wY = x * m[1][2] + y * m[2][2] + z * m[3][2] + m[4][2] local wY = x * m[1][3] + y * m[2][3] + z * m[3][3] + m[4][3] return wX, wY, wZ end
  5. I am currently creating a map of Berlin in World War 2 and i reached the Object limit of MTA Blue 1.3.5, after ~500 GTA objects it starts lagging and fading out objects. I hope that Eir will fix this poor limit so i can add even more details to my Map! Keep on the great work!
  6. The Panel had problems with the ENBseries installed for my GTA. That was the cause for some not working shaders like palette an radial_Blur. I deleted the ENB and now it works well. (ENB effect was not enabled, just installed) Soft particles are still not working, resource started but nothing happens. Me and my friends will try with latest 1.3.5 soon.
  7. does onClientVehicleDamage trigger if the rhino gets hit? This Tank is still bullet-proof and i would like to change this behaviour (and a “getVehicleMuzzlePosition“ would be great, too).
  8. thank you, i got it working some hours ago with some experimenting indeed, 2 for loops are useless and i got 22x all ranks returned in the chatbox, this way i found out how to do it correct
  9. It seems to work a little bit, but i get the following error: This code should compare the current Rank with the ones in the table and trigger the Client event with the correct rank. local usranks = { {"[1]PVT"},{"[2]PFC"},{"[3]CPL"},{"[4]SGT"},{"[5]SSG"},{"[6]SFC"},{"[7]MSG"},{"[8]1SG"},{"[9]SGM"},{"[10]CSM"},{"[11]SMA"},{"[12]2LT"},{"[13]1LT"},{"[14]CPT"},{"[15]MAJ"},{"[16]LTC"},{"[17]COL"},{"[18]BG"},{"[19]MG"},{"[20]LTG"},{"[21]GEN"},{"[22]GA"} } for i, therank in ipairs(usranks) do outputChatBox(""..tostring(therank)) outputChatBox(""..tostring(usRank)) if (therank == usRank) then --does not work because therank is not a String triggerClientEvent("r"..tostring(i), playersource) end end Now the first outputChatBox returns a userdata value like "0507E8E" and the second outputs the correct Rank of the Player: "[1]PVT". Why does the variable "therank" return a userdata value and not the String of the table above? I can not compare Userdata values and Strings... €DIT::: I got it. I have to remove the brackets in the Table: local usranks = { {"[1]PVT"}, ... -- change to: local usranks = { "[1]PVT", ...
  10. Thank you. I will now try to change all the code and report if it worked for me.
  11. Hello community. I created a little rank system and i have a big code with a lot of unnecessary lines which could be done with some simple lines in a "for" loop. My question is, does the following code the same thing as the second following code? First Code: local usranks { "[1]PVT","[2]PFC","[3]CPL","[4]SGT","[5]SSG","[6]SFC","[7]MSG","[8]1SG","[9]SGM","[10]CSM","[11]SMA"},"[12]2LT","[13]1LT","[14]CPT","[15]MAJ","[16]LTC","[17]COL","[18]BG","[19]MG","[20]LTG","[21]GEN","[22]GA" } function playerSpawn ( ) playersource = source for index, usRank in ipairs(usranks) do if (usRank == usranks[2]) then triggerClientEvent("r1", playersource) elseif (usRank == usranks[2]) then triggerClientEvent("r2", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r3", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r4", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r5", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r6", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r7", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r8", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r9", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r10", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r11", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r12", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r13", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r14", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r15", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r16", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r17", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r18", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r19", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r20", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r21", playersource) elseif (usRank == usranks[3]) then triggerClientEvent("r22", playersource) end end end addEventHandler("onPlayerSpawn", getRootElement(), playerSpawn) Second Code: local usranks { "[1]PVT","[2]PFC","[3]CPL","[4]SGT","[5]SSG","[6]SFC","[7]MSG","[8]1SG","[9]SGM","[10]CSM","[11]SMA"},"[12]2LT","[13]1LT","[14]CPT","[15]MAJ","[16]LTC","[17]COL","[18]BG","[19]MG","[20]LTG","[21]GEN","[22]GA" } function playerSpawn ( ) playersource = source for index, therank in ipairs(usranks) do for i = 1, 22 do if (therank == usranks[i]) then triggerClientEvent("r"..tostring(i), playersource) end end end end addEventHandler("onPlayerSpawn", getRootElement(), playerSpawn) Thanks in forward.
  12. jump height with setPedGravity(thePed, float) server sided
  13. Thank you for your help! I think i can do it now and if not, i will just copy&paste
  14. Would it look like that? This is the Code for my Window and its buttons: whSecondary = guiCreateWindow ( 0.0, 0.329, 0.3, 0.13, "Secondary", true) Mp = guiCreateButton ( 0, 0.15, 0.2, 0.25, "MP-40", true, whSecondary ) Lug = guiCreateButton ( 0, 0.42, 0.2, 0.25, "Luger P08", true, whSecondary ) Sho = guiCreateButton ( 0, 0.69, 0.2, 0.25, "Grabengewehr", true, whSecondary ) windows.window1 = {Mp, Lug, Sho}
  15. So i have to put all windows into this table: windows = {} But what data has to be stored in "windows.window1 ={}" ?
  16. Hello Community. I am trying to create some Windows with 3 buttons each and i want to disable a button if a player clicks on it, but the other buttons of this window should be re-enabled so the player is able to choose what he wants. I have 8 Windows like this and i could do the job like this for each window: function clicked if source == Stg then guiSetEnabled ( Stg, false ) guiSetEnabled ( Kar, true) guiSetEnabled ( G43, true) elseif source == Kar then guiSetEnabled ( Kar, false ) guiSetEnabled ( Stg, true) guiSetEnabled ( G43, true) elseif source == G43 then guiSetEnabled ( G43, false) guiSetEnabled ( Kar, true ) guiSetEnabled ( Stg, true) end end addEventHandler ( "onClientGUIClick", getRootElement(), clicked ) My question is: Is there a shorter way to script this without writing 100 lines of code for all 8 windows? Thanks in advance.
  17. I just tried it and i love this resource after 5 minutes! Great work.
  18. I will follow this topic and i could contribute if i have time.
  19. There is already such a kill reward resource uploaded at the MTA community website, but i dont know the name of it.
  20. Yes, my friend, thank you! This exactly does what i was searching for! Unfortunately “getVehicleComponentPosition“ does not return useful xyz values for the misc_c component, so i have to wait with my script until there is something like “x,y,z = getVehicleMuzzlePosition(theVehicle)“. I wanted to create a custom Rhino cannon, but it seems that CLEO is more advanced with vehicle scripting functions than MTA...
  21. Hello community. I have a question related to Vector calculation. I got 2 Objects with their X Y Z coordinates and i want to calculate a velX, velY and velZ from object 1 to object 2. I am still searching on the internet for a solution but i cant find what i want. Could anyone please help me with this problem? Mfg Einheit-101
  22. Thank you a lot. i will try this very soon. I changed a lot of properties already and i had to change some reload animations/ fire rates , too. So my only problem was the pumping.
  23. Hello Community. I want to change the "Shotgun" into a gun like the standard "Rifle", i make a WW2 Server and the other team uses the Rifle already. So i decided to change some properties of the Shotgun. I changed the following: setWeaponProperty("shotgun", "std", "maximum_clip_ammo",8) setWeaponProperty("shotgun", "std", "weapon_range", 80) setWeaponProperty("shotgun", "std", "accuracy", 0.9) but i have 2 problems: - The gun "pumps" after every shot, but it should fire all 8 Bullets without pumping - The gun fires more than 1 bullet Is there a way to disable the pumping animation and change the number of Bullets the shotgun fires? Another little question: What does the following flag do? 0x080000 - expands Thanks in advance.
  24. Ah nice okay. I hope this one is able to reduce the PED health
×
×
  • Create New...