Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. I recently decided to sit down and define my own language for Notepad++ based on Lua, but I wanted each MTA function to be highlighted according to their availability(whether it's client-only, server-only or shared). So I came up with this little script which compares the functions available on the Wiki and splits them into text files. Now I'm only sharing this script in case it might help someone for some reason, skip ahead if you're not interested in this and just want to get the syntax highlighting going. Client Code;
  2. getPlayerTeam returns the team element, a userdata value. Not the name. You'll need to use getTeamName to find out what the player's team is called. The reason for why it works on every team, is because the function will return a userdata value if the player is in a team - so this means no matter what team they are in, the if statement will pass because it is not false or nil.
  3. Doubt that it's impossible, if you can tell us what you were trying to do we might have been able to help
  4. That's just an animation being looped, that animation is generally used for when a player is injured and near death. They probably just bound it to a key and use setElementPosition to move the player around, that's why it looked so choppy and not very organic. But can you shoot from that position? I didn't see him firing at all.
  5. Well, I would think it would need to be like this; setWeaponProperty(32, "poor", "flags", "flag_aim_arm") But unfortunately it does not work.
  6. Do you mean to add a new line? Put "\r\n" in your string to add linebreaks.
  7. Use the MTA Wiki. If you go to Client Functions, you'll find all the available file functions there, including fileIsEOF.
  8. Not too sure, haven't been working with weapons before - but you could check out and play around with setWeaponProperty. Looking at it, I would assume that the flag "flag_aim_arm" is what you want.
  9. Sorry, but I really do not understand what you mean with "catch". Do you mean the stance when firing it?
  10. Do you mean to dual-wield MP5 like you can with the pistols and Tec9?
  11. With the current version of MTA, no, you can only replace models - you can not add any. You'd have to wait for MTA Eir to be able to do that.
  12. You can still use the code I provided you with a GUI... I simply provided you with an example of how you could set up a multi-dimensional array to simplify the addition of more radio stations. How you want to make the GUI is up to you
  13. I guess there might be a very fine line, depends on if they require ads to be played via the API. Because it does say; "using the YouTube API to show YouTube content on an ad-enabled API Client". It all depends on how they want you to interpret it, I guess. I meant no offense to the OP, I just want to raise the awareness of these rules when using free APIs.
  14. Not to be that kind of guy, but I'm gonna be that kind of guy. Did you read the Terms of Service for using this API? Here; Other than that, I don't doubt a second that your resource is a well-made one, I'm sure it is. But quite frankly I think it's disrespectful to just outright assume that you have the right to make money using someone else's work(the API). Yes, they share this API with us for free - but that doesn't mean you're entitled to using it for commercial work. There's a reason licensing is a thing in this world. Undoubtedly, people will dislike me for this post. Then so be it
  15. You could make a table like this; local radioChannels = { [1] = {"www.url.com/listen.pls", "Radio 108 FM"} }; outputChatBox(tostring(radioChannels[1][1])) -- Outputs "www.url.com/listen.pls" outputChatBox(tostring(radioChannels[1][2])) -- Outputs "Radio 108 FM" You could do something like this; local currentSong = nil; local isSongPaused = false; -- Code and shizzle currentSong = playSound("www.example.com/listen.pls"); -- More code function muteSong_Handler() if(getElementType(currentSong) == "sound") then setSoundPaused(currentSong, not isSongPaused); isSongPaused = (not isSongPaused); else outputChatBox("No radio is currently being streamed!") end end
  16. Feel free to check my radio player out. It's open source and you're free to edit it as you please or take code from it. It's rather out-dated and I do have plans on making a new one sometime later Edit: Why are you adding the onClientGUIClick event handler 5 times...?
  17. I wouldn't bother, the voice resource needs significant updating. I once made a resource for it which let you create rooms, and only people within the rooms would hear one another. But the volume of that voice resource is so ridiculously quiet - it's practically of no use whatsoever. Unless they've fixed it since I brought it up
  18. Not entirely sure what you're talking about, but do you mean settings for specific resources? You can use getResourceConfig to name one of the ways. There are more, but this is probably the most common. You can edit the settings of resources via the admin panel.
  19. Try to use getPositionFromElementOffset which can be found in getElementMatrix. These use vector space coordinates, so 0, 0, 0 would be the center of the car. And then use that in cojunction with getScreenFromWorldPosition.
  20. Store the URLs in a table, for example; local radioChannels = { [1] = "www.example.com/listen.pls", [2] = "www.example.com/listen.pls", [3] = "www.example.com/listen.pls", [4] = "www.example.com/listen.pls", [5] = "www.example.com/listen.pls" } Then you can play the sound like this; local currentRadio = playSound(radioChannels[1])
  21. Dealman

    Crouching

    Try using it client-side; function onStart_Handler() setControlState("crouch", true); toggleControl("crouch", false); toggleControl("jump", false); end addEventHandler("onClientResourceStart", resourceRoot, onStart_Handler);
  22. Dealman

    Crouching

    Did you try looking at Control_names?
  23. So why not help him out, by reporting all of these bugs?
  24. Dealman

    Button

    Also, dxDrawText, dxDrawRectangle and dxDrawLine do not return elements.
×
×
  • Create New...