Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. The processLineOfSight function would give you some information about it. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight It works just fine, I use it to detonate a rocket projectile. It doesn't matter if the object is serverside or clientside, because an serverside object is visible on clientside and a projectile is only available clientside. (Maybe I do not understand your question.)
  2. Afaik the only damage the rhino can receive(on GTA LEVEL) is collision damage and fire damage. The rest of the damage you have to overwrite with onClientPlayerWeaponFire and onClientExplosion.
  3. IIYAMA

    Team Base

    function getTeamDataFromName (name) for i=1, #TeamTable do if TeamTable[i][1] == name then return TeamTable[i] end end return false end Usage: local teamName = getTeamName(playerTeam) if teamName then local teamData = getTeamDataFromName (teamName) -- returns the sub-table if successfull, else false. if teamData then -- do your thing end end There are more ways to do this.
  4. @kieran Oh and one last thing: bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) If you use the addEvent function, you can allow and disallow triggers from different sides(client/server) TRUE = enabled I recommend you to add this function to the resource where you are also triggering from, because if you trigger an event which isn't added yet, you would receive warnings.
  5. local x, y, z = getElementPosition( robmarker1 ) if x == 3099.97 and y == -3281.69 and z == -0.5 then
  6. There is no triggerEvent for changing team. All triggerEvents are global, so that is already happening. It just depends how and under which element you add the handler.
  7. 1. @Bonus Names like 1_7_0 are a remaining of a decompiled script. Because when a script is compiled all variables names are lost. A decompiler will assign names like that to make it work again.
  8. IIYAMA

    newResource

    Add a time as I suggested.
  9. @xeon17 It is a kind of addiction, except for the wasting part. I am well aware that I shouldn't. If you had some lessons around ethical, you would know what I am talking about. Because it is a very common addiction and most of the time overlooked. Yet, everybody has this addiction. With other words: the feeling of being needed.
  10. --store taxidf[player].ped = ped --load local ped = taxidf[player].ped --validate if isElement(ped) then end No need for more code.
  11. Why do you want to double index, when you are only save one ped at the time? With other words, 2x indexing for nothing. If you want to save multiple peds, then you still have to index 1x for nothing.
  12. local prices = {["Beagle"] = 300, ["Shamal"] = 30,["Dodo"] = 0, ["Nevada"] = 1000, ["Crop Dustler"] = 2435, ["Stuntplane"] = 3435} iprint(prices["Dodo"]) -- price: 0 (I don't pay for dead stuff)
  13. you might want to put the code inside of the function and inside of the CODE BLOCK AT LINE 4. Your function ends at line 7.
  14. IIYAMA

    newResource

    addCommandHandler("refreshres",function(source) local resources = getResources() local oldResources = {} for i,v in ipairs(resources) do if getResourceState(v) ~= "failed to load" then oldResources[v] = true end end refreshResources(true) local resources = getResources() local newResources = {} for i,v in ipairs(resources) do if not oldResources[v] and getResourceState(v) ~= "failed to load" then newResources[#newResources + 1] = v end end iprint(newResources) outputChatBox("NewResource loaded: Here is the last resource name which loaded.", source, 255, 255,255,true) end) You might need to set a timer before you re-check the resources again. (not sure because I never tried it)
  15. IIYAMA

    setElementData

    setElementData(player,"Helmet", { {id="notSpecial", amount, armor}, {id="stupid", 999, -10000}, {id="IIYAMA", 1, 1000000000000000000} } ) setElementData(player,"Helmet", { notSpecial = { amount, armor}, stupid = {999, -10000}, IIYAMA = {1, 1000000000000000000} } )
  16. function generatePassword () local passwordLength = math.random(4) -- 1 t/m 4 local password = "" for i=1, passwordLength do password = password .. (math.random(10) - 1) -- 0 t/m 9 end return password end local passwordForGate = generatePassword() iprint(passwordForGate) addCommandHandler("hack", function (player, CMD, password) if password == passwordForGate then iprint("correct password") else iprint("wrong password") end end) This is just a sample. Not ready for a dynamic gate system. You should start with writing and preparing your gate script first. Because it has to be one thing. I can't help you any further, if you do not have your body/main/core code ready for integrating the password system.
  17. OK, bye
  18. https://wiki.multitheftauto.com/wiki/OnClientPreRender dt is the timeslice. Read the wiki. It is the delay/time between the frames, created ONLY by the onClientPreRender If you have 60 fps. The timeslice is around: 1000(1sec) / 60 = 16,666666666666667 ms.
  19. @Professional You may want to reply. It is not @Professional...
  20. @tommymaster You may want to reply.
  21. Yea, thought you missed something in your explanation. You can try to check with getElementMatrix. But I can't help you getting rotations from rotation offsets of matrices, too much for me.
  22. True But fixing a warning/error = less lagg. It always helps in a way.
  23. I don't think so, because the timer is used to destroy elements, when the ped/player element is destroyed/(leaves the server). But you can test it if you want to be 100% sure. Just increase the timer duration to 50 ms and see if the delay still exist. (don't forget to change back, because 50 ms can lagg)
  24. You can't.
  25. What has position in your case to do with rotation? If you have 2 positions, then it would be something else. getElementRotation
×
×
  • Create New...