Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. Debug your code? https://wiki.multitheftauto.com/index.php?title=Debugging Learn the basics of lua? Write down what all functions do? (in order to understand what the code does) You could do that.
  2. getAttachedElements (vehicle) This returns a table with attached elements. #table # gets the length of a table. value > 0 This returns true or false depending if the value is higher than 0. local serin = result This saves the result in to serin.
  3. A very quick and basic solution, would be: local siren = #getAttachedElements (vehicle) > 0 Place it where you think it would make sense in your code. And if you do not know where to place it, you can always try it at all 24 lines till the code finally does what you want... ? @Ekko
  4. I still have no clue which one of the two you mean. Heli rotors switch (90-degree) = model ( ask somebody who edits GTA models ) Heli rotors animation (360-degree propeller rotation) = texture + shader ( ask somebody who create shaders, they are easy to find if you search for shader resources )
  5. With something that can calculate world positions to screen positions: https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition What does this function do? getScreenFromWorldPosition \/ get - screen - from - world - position \/ Get a screen position from a world position. \/ World position = screen position
  6. I based that information on your code, as you said it only works for the hydra. The hydra does have an adjustable property, a beagle does not. That is just a feature from GTA. Yet, I am very sure that somebody can script this effect for the beagle as well. Just it probably cost a lot of $...
  7. Because it is programmed like that. 511 is the vehicle ID of a hydra. https://wiki.multitheftauto.com/wiki/getPedOccupiedVehicle Feel free to program it to how you think it is suppose to work.
  8. IIYAMA

    Bullet colshape

    If we are talking about custom bullets, then yes. For regular bullets use: https://wiki.multitheftauto.com/wiki/OnClientPlayerWeaponFire @majqq
  9. IIYAMA

    Ped Health

    If you do not know lua, then I can imagine that... lua first, no ifs and buts about it.
  10. IIYAMA

    Bullet colshape

    There are two(three*) functions that can detect things between two points, which you could describe as "line detection". A line would be similar to a flying bullet. https://wiki.multitheftauto.com/wiki/IsLineOfSightClear https://wiki.multitheftauto.com/wiki/ProcessLineOfSight * Water detection.
  11. The only thing you should be aware of is that you can't give it the same values. if value1 == value2 then return value1 end Something like this would solve that. (Place it directly after line 1)
  12. I do not understand your problem. If you are not inside of the vehicle, how else do you want to figure out which vehicle you want to modify? The current code clearly is build to support the vehicle owner only.
  13. function getRandomValueBetween (value1, value2) -- Be different! ;o local difference = value1 - value2 -- Be positive! :D local positiveDifference = math.abs(difference) -- Be ra ndo m! local randomPositiveDifference = math.random(positiveDifference) local randomDifference if difference < 0 then -- Be negative :( randomDifference = -randomPositiveDifference else -- Stay positive! :DDDD randomDifference = randomPositiveDifference end return value1 - randomDifference end -- Be famous print(getRandomValueBetween(-10, 10))
  14. IIYAMA

    Help

    Doesn't look like a ped to me. That script works sort of the same as this headshot script: (You only have to edit it) https://community.multitheftauto.com/index.php?p=resources&amp;s=details&amp;id=1600 Which is very dirty way of deciding when somebody gets hit. Unfortunately some people do have so much lag/de-sync that they can't play the game without it... (not that they can help it ?)
  15. -- Be a number #1 local value1 = 10 local value2 = 100 -- Be different! ;o local difference = value1 - value2 -- Be positive! :D local positiveDifference = math.abs(difference) -- Be ra ndo m! local randomPositiveDifference = math.random(positiveDifference) local randomDifference if difference < 0 then -- Be negative :( randomDifference = -randomPositiveDifference else -- Stay positive! :DDDD randomDifference = randomPositiveDifference end -- Be famous print(randomDifference) Not sure if there is an easier way, but this is a way to calculate it. Not understanding what the math.abs method/function does? Watch video: https://www.khanacademy.org/math/arithmetic/arith-review-negative-numbers/arith-review-abs-value/v/absolute-value-of-integers
  16. IIYAMA

    help in acl

    In the acl.xml file. Which is located next to your server configuration file. Documentation acl This documentation also tells you where to place it in the acl.
  17. What is the returned value of the function? @delta1337
  18. See example: https://wiki.multitheftauto.com/wiki/SetVehicleAdjustableProperty
  19. You can't just callRemote on to the server ip and expect it to work. Here are the steps for you to take in order to serve web content: https://wiki.multitheftauto.com/wiki/Resource_Web_Access
  20. yea, that seems to be the case. KillerX, you can edit the source code of this function here: admin/server/admin_ip2c.lua local aCountries = {} local IP2C_FILENAME = "conf/IpToCountryCompact.csv" local IP2C_UPDATE_URL = "https://mirror.multitheftauto.com/mtasa/scripts/IpToCountryCompact.csv" local IP2C_UPDATE_INTERVAL_SECONDS = 60 * 60 * 24 * 1 -- Update no more than once a day function getPlayerCountry ( player ) return getIpCountry ( getPlayerIP ( player ) ) end function getIpCountry ( ip ) if not loadIPGroupsIsReady() then return false end local ip_group = tonumber ( gettok ( ip, 1, 46 ) ) local ip_code = ( gettok ( ip, 2, 46 ) * 65536 ) + ( gettok ( ip, 3, 46 ) * 256 ) + ( gettok ( ip, 4, 46 ) ) if ( not aCountries[ip_group] ) then return false end for id, group in ipairs ( aCountries[ip_group] ) do local buffer = ByteBuffer:new( group ) local rstart = buffer:readInt24() if ip_code >= rstart then local rend = buffer:readInt24() if ip_code <= rend then local rcountry = buffer:readBytes( 2 ) return rcountry ~= "ZZ" and rcountry end end end return false end -- ... @KillerX
  21. Debug console doesn't show a warning/error at all? Script is serverside? Did you also tried the call function instead of exports? https://wiki.multitheftauto.com/wiki/Call @KillerX
  22. local handlers = {} do local _addEventHandler = addEventHandler function addEventHandler (...) local result = _addEventHandler(...) if result then handlers[#handlers + 1] = {...} return result end end end Wrap it. Just make sure to clean the table once in while. ? Or get the attached function with this function, if you know the event and the element. https://wiki.multitheftauto.com/wiki/GetEventHandlers ____ Yet, you can better name your a dogs. If it is called fluffy, then you only have to call 'fluffy, your dinner is ready' and it will surely come back to you. If you didn't name him, then you have call out like this 'fluffy-dinner is ready'. After that I am not sure how many streetdogs will come back to you. (Not even sure if fluffy would survive that...)
  23. If you didn't come here for scripting, then please use the things that are already available to you. https://wiki.multitheftauto.com/wiki/Server_Commands#whois /whois <nick/playername> /whowas <nick/playername>
  24. Nope, your current problems: - Exported content is always a copy. So if you were to pass a table from one resource to another, then the content might be the same, but it is not the same table. To get a better understanding of this: 1. Create two resources.(if you haven't done that already) 2. Create in one resource a table. 3. Debug the table like this: theTable = {} print(tostring(theTable)) 4. Export the table to the 2e resource. 5. Repeat step [3] in the 2e resource. It will tell you that both tables do have a different userdata. That means they are not the same. ________________ - You can't pass functions to another resource. (Except as a string as I did in my example) And if you did it as a string, it would be a copy of it. The reason why you can't do this is because a function has a function block which only exist at the place where it is created. Which comes to this conclusion: The environment of both resources can't be merged. Which would be merged if: - Tables can be shared between resources. - Functions can be accessed without exporting. @Dzsozi (h03)
×
×
  • Create New...