Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. If you do it from clientside, it will only update on the screen of the player on whose client you called the function.
  2. <!-- meta.xml --> <html src="call.htm" /> <!-- call.htm --> <* if (form["do"] == "setweather") then httpWrite(setWeather(form["weather"]) and "SUCCESS" or "FAILED") elseif (form["do"] == "getweather") then httpWrite(getWeather()) end *> You should be able to GET/POST http://ip:port/(resourcename)/call.htm?do=setweather&weather=4 and it'll respond with either "SUCCESS" or "FAILED". However, this was written just using my memory, and haven't been tested.
  3. Did you actually read the guidelines he linked? Your topic lacks a lot of information. We can't help you if you don't help us.
  4. You can't force maximum FPS, that wouldn't make sense. You'd be asking a computer to render more frames per second than it is capable of. Rendering a frame takes quite a lot of calculations, if you didn't know. You could change their frame limiter however, I'm not sure whether it's possible, in MTA, to override the fps_limit cvar. And as far as I'm aware, FPS glitches occur when one's FPS exceed a certain value (I'd assume it to be around 36 FPS, which is what GTA's frame limiter limits FPS to. Of course, FPS slightly higher won't be a problem but if I recall correctly, at 45 FPS, the Skimmer starts to glitch out, not being able to take off from water, etc.)
  5. So what's wrong with it? Should it not say "hi"? You've made a conclusion that it says "hi" and... what exactly do you need help with? With the conclusion? Didn't you already state the conclusion? Your code has 391 lines and you expect us to find out what your problem is? Explain what the code does, and what it attempts to do. Also, don't forget to read the this before posting in this section.
  6. Addlibs

    Help

    You should only upload a single file, for example, client.lua. Download the client.luac that the website returns and place it in your resource folder and change the <script>'s src to the .luac variant. A single text file (such as source code in Lua format) should really not even be close to 1 megabyte (about a million characters of text)
  7. There's executeCommandHandler but it does not work with MTA hardcoded commands (such as /quit)
  8. The error is, in fact, referring to an attempt to use type as a function (which is, in fact, a function by default) but it seems it's been overridden with a number value. In other words, some part of the code is trying to call type() but type is a number, not a function. Try looking through the code to find something like type = ... -- or local type = ... and change the variable name, don't use type as a variable name as it's already a function. Of course, changing a variable name also means you'll need to change it everywhere else in the code where you referenced it.
  9. Lines 26 if (player) then player = client end should be if (not player) then player = client end I believe. Right now, whatever the player is inputted, it just gets substituted with the client.
  10. Addlibs

    distance

    I think he wants the image to scale down with distance, so that it's the same size compared to the car at any given distance.
  11. You can definitely sync MTA chat with whatever you want, but I can't help a lot since I don't know how to collect and broadcast Minecraft chat data. MTA functions you'd need to use are callRemote or fetchRemote.
  12. Addlibs

    group panel

    In function addGroup(client, group), client and group correspond to guiGetText(name) and guiGridListGetSelectedItem(groupGrid), respectively, from the client-side. So you're inputting a string where a player element should be. Just don't name the first parament client and it should work.
  13. You'd know how to do it if you learnt the basics of scripting for MTA. If you haven't done that, there's really no point in asking for help here as we're not going to do everything for you, but rather help you do it yourself. If you really need more help, you should at least let us see the relevant parts of your turfing code so that we can help you.
  14. Depending on how you determine whether someone has toggled their PvP on (I'm guessing element data), you should edit the script so that it checks that toggle status and if PvP is off, disallow/block starting a turf war for that player
  15. Pretty sure line 98 will spit out errors since you're defining an anonymous function but naming it at the same time.
  16. Only texture mods although I believe shaders can also slightly modify how the model looks (i.e. displacement mapping etc)
  17. Currently that is not possible. You can, however, use shaders for an unlimited amount of texture mods (well, limited by video memory I guess)
  18. Aha. Parsing error - the response from the site, although it contains the JSON code, it is not the JSON code on its own. You should do something about those error messages so that the only response from the server is, is the JSON string (what you see on line 5) The first error can be corrected by changing php.ini as instructed, the other error is a result of the first error being written up before the forum code was initialised (which includes setting headers, I guess) and that causes an error - setting headers when something was already outputted (the previous error).
  19. fetchRemote("http://forums.link.com/login.php", -- of course use your own URL here function(response_,errno,player) outputDebugString(tostring(response_)) end , toJSON({user="any username", pass="and any password"}), false) Try running this, preferably with runcode through the HTTP interface (usually at http://<your server ip>:22003/runcode/ unless you changed the HTTP port) and check for the response - it should be a JSON string.
  20. Change lines 4-5 and line 42 to function(response_,errno,player) -- line 4 local response = fromJSON(response_) -- line 5 -- ... elseif response_ == "ERROR" then --line 42 -- ... end This should result in the code correctly informing you of the HTTP error code, and thus no valid response was given (i.e. 500 error) If it still comes up as a parsing error, that means the website's response is incorrectly formatted.
  21. Okay, after researching (just one Google search lol) I found a way to overcome this - add &client=mtasa (or whatever, as long as there is &client=) and it'll let you use it, but your IP (or rather, the IP of the client which plays the sound) might be temporarily blocked if you abuse the service (or overuse it in a short period of time) That is, the URL should look something like this: https://translate.google.com/translate_tts?ie=UTF-8&q=MESSAGE+TO+SPEAK&tl=LANG&client=mtasa
  22. Seems like the page http://translate.google.com/translate_tts is now blocking robots (as well as MTA client I guess) with ReCaptcha and additionally pops up with a 403 Forbidden after solving the "puzzle". Seems like you simply can't use Google Translate's text-to-speech anymore.
  23. Addlibs

    HoursToDay

    How about you just use these calculations: Full days: math.floor(hours / 24) Remaining hours: hours % 24 E.g. 60 hours would return as 2 full days (48 hr) and 12 remaining hours.
  24. First of all, line 6 of the last snippet is wrong players_money = getPlayerMoney -- copies function getPlayerMoney to players_money variable -- instead, it should be players_money = getPlayerMoney() -- copies the RETURN from the function call Secondly, I strongly advise against using takePlayerMoney() on the clientside since it won't sync with the server (as to prevent clientside money hacks) Thirdly, setElementModel (SkinModel) -- is missing the first parameter - the element which you want to change the model of -- properly, it should be setElementModel (localPlayer, SkinModel) -- also, note that this will change the model only on the client's side - it won't be synced to the server nor any other players
  25. minValue + scrollbarPosition * (maxValue - minValue) where minValue would be 150 and maxValue 250, you would get something like
×
×
  • Create New...