Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. 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.
  2. lol ?
  3. What is the returned value of the function? @delta1337
  4. See example: https://wiki.multitheftauto.com/wiki/SetVehicleAdjustableProperty
  5. 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
  6. 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
  7. 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
  8. 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...)
  9. 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>
  10. 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)
  11. In the real world it cost time to steer from 0° to 45° degrees right? If they didn't apply the same principle in gta san, where ever you were to turn right/left your car would simply rollover. (Just like a dog would do, when he has to earn his candy) So they decided to do this if you were to press your left arrow. This wheel animation is time as well as fps related.
  12. If you look carefully in the video to the first few cars that driving past, you can clearly see that the wheels are steering with 100% to the left and the right. Which makes it look very unnatural. With the set analog function, you can also steer 30% to the right or the left. But remember: controlstates are an indirect method to control an ped or car. They do not adjust the orientation of elementen, they are actions to behave like it. The outcome can be entirely different depending on a lot of factors. One last thing: from 0 t/m 100 steering cost time.
  13. The frame rate is indeed a factor. Also the code runs on different place in the memory. The timing can be variable. You can smooth or force the key pressing a bit with: https://wiki.multitheftauto.com/wiki/SetPedAnalogControlState You can also use that to calculate the amount of steering from point to point. (that is if you want to go a level higher)
  14. How about you first try to understand why this difference does exist in the first place? Because there is an enormous difference between those two. (I am not talking about the syntax, but the role it has)
  15. Nope, it doesn't work like that. You can't change arguments of events after they are fired. But you can do something like this. function choosed(processed, colors) if not processed then if choosed then triggerEvent("onDGSPickerChoose", root, true, colors) end end end addEventHandler("onDGSPickerChoose", root, choosed, false) -- addEventHandler("onResourceStart", resourceRoot, function () setElementData(root, "onDGSPickerChoose_blocking", true, false) end) addEventHandler("onResourceStop", resourceRoot, function () removeElementData(root, "onDGSPickerChoose_blocking") end) addEventHandler("onDGSPickerChoose", root, function(processed, rgba) if not getElementData(root, "onDGSPickerChoose_blocking") or processed then end end, false) triggerEvent("onDGSPickerChoose", root, false, {255, 100, 100, 255})
  16. https://wiki.multitheftauto.com/wiki/Client_Commands#showcol /showcol To have access to this command: https://wiki.multitheftauto.com/wiki/SetDevelopmentMode
  17. Sure, if you know how to do port forwarding: https://sourceforge.net/projects/npp-plugins/files/NppDocShare/ However, git is basically better if you have multiple stakeholders and a shared production-line/project.
  18. https://wiki.multitheftauto.com/wiki/AddEvent It is an option to prevent events, to trigger the handlers from either the client or server. If you put the option on a clientside script to false, it will ignore events triggered from serverside scripts. If you put the option on a serverside script to false, it will ignore events triggered from clientside scripts. It doesn't prevent triggering from other files(unless it is from the other [server/client]side) and it also doesn't prevent triggering from other resources. ?
  19. Start first with making your API: https://wiki.multitheftauto.com/wiki/Resource_Web_Access or/and https://wiki.multitheftauto.com/wiki/Javascript_SDK
  20. ------------------ ------ function function functionName () end -- < end ------------------ ------ if statement if true then end -- < end ------------------ ------ if statement with elseif and else if true then elseif true then else end -- < end ------------------ ------ do-end block do end -- < end ------------------ ------ loops for i=1, 10 do end -- < end -- for i, v in ipairs({1, 2, 3}) do end -- < end -- while true do end -- < end ------ Cheat sheet. More info: Starting here: https://www.lua.org/pil/4.3.html https://www.lua.org/pil/4.3.2.html https://www.lua.org/pil/4.3.1.html https://www.lua.org/pil/4.3.4.html https://www.lua.org/pil/4.3.5.html https://www.lua.org/pil/5.html
  21. The most basic lua syntax for that would be: (without tables) local posX1, posY1, posZ1, rotX1, rotY1, rotZ1 = 2445, 788789, 768879, 0, 90, 0 local posX2, posY2, posZ2, rotX2, rotY2, rotZ2 = 2445, 788789, 768879, 0, 0, 0 moveObject ( barrafc, 1000, posX1, posY1, posZ1, rotX1, rotY1, rotZ1 ) -- A to B moveObject ( barrafc, 1000, posX2, posY2, posZ2, rotX2, rotY2, rotZ2 ) -- B to A
  22. Define the static start and end orientation and transform to there. Just like a train on a railroad, it can only move between the stations but not further or sidewards.
  23. Hmm good question. I think they didn't add this feature in case of passwords and other security/privacy sensitive commands.
  24. addCommandHandler("test", function (player, command, ...) iprint("The responsible player/console:", player) iprint("The command:", command) iprint("The arguments:", ...) local arguments = {...} iprint("The first and second argument:", arguments[1], ",", arguments[2]) end) Serverside @arciCZ This is the sky.
×
×
  • Create New...