Investor

Members
  • Content Count

    101
  • Joined

  • Last visited

Community Reputation

29 Good

3 Followers

About Investor

  • Rank
    Punk-@ss B*tch
  • Birthday 14/04/1999

Details

  • Location
    United Kingdom
  • Occupation
    Student & 3D modeller
  • Interests
    3D modelling, law, computer gaming, game development, level design, etc

Recent Profile Visitors

1,259 profile views
  1. Investor

    [Question]: Java SDK and Lua

    You can poll for data using the Java SDK. If you want to send unsolicited data, you'll probably need to use a fetchRemote or callRemote to a webserver and pipe that into your Java SDK (if that's possible, have never tried)
  2. Investor

    timestamp

    Months have variable length so I wouldn't advise using that. If you need to, use the average month length which is actually slightly >30 days, meaning 2592000 seconds (more more accurately, 30.44 days = 2630016 seconds) in a month. local years = math.floor(remaining_time / 31557600) local months = math.floor((remaining_time % 31557600) / 2592000) local days = math.floor((remaining_time % 2592000) / 86400) local hours = math.floor((remaining_time % 86400) / 3600) local mins = math.floor((remaining_time % 3600) / 60) local secs = math.floor(remaining_time % 60)
  3. Investor

    timestamp

    If you're asking for time remaining until a specific target timestamp, then local target = --[[ some timestamp ]] local current = getRealTime().timestamp local remaining_time = target - current local hours = math.floor((remaining_time % 86400) / 3600) local mins = math.floor((remaining_time % 3600) / 60) local secs = math.floor(remaining_time % 60)
  4. Are they running the same version? I remember a while back MTA included extra protections on HTTP logins requiring an IP associated with an authorized serial, or a httppass being postfixed to a user password. Disabling login can be done via ACLs if you so wish, but this is a security risk. You may open up the webadmin or HTTP runcode to unauthorized users this way. Adding resource.vitaStream.http in Default ACL rights (with access="true" of course) will open up http://serverip:port/vitaStream/* (including vitaStream/call/functionName which can call exported functions with http="true") to anyone without login.
  5. Are both servers running the same version with the same mtaserver.conf? The title mentions connection flood - that is related to httpdosthreshold and http_dos_exclude which limit how often an IP can make a request (to prevent denial of service attacks originating from one IP) - but the contents of the post make no mention of it, concentrating on logins; would be helpful if you clarified what exactly is the problem.
  6. Investor

    Calculate radararea on radar

    dxDrawImage on line 4 is rotated, but dxDrawRectangle on line 14 isn't (and cannot). This can be overcame by using another rendertarget, or by rotating the whole RT with radarareas in it, instead of just the map image. Former solution requires two RTs, latter solution will not look good without alphamasking or something. A third, possible solution would be to use dxDrawPrimitive or dxDrawMaterialPrimitive (not sure whether the first one fills or not) instead of rectangles. Then you just need to calculate the positions of the 4 vertices (not so complicated trigonometry) instead of trying to rotate them.
  7. Investor

    Calculate radararea on radar

    The main problem you're having is that the dx rectangle does not rotate. You need to to align with the map. The easiest way to do this is to render the map in a rendertarget (RT), and render radar areas directly onto that (without any width or height transformations), then render the RT with the correct rotation in the corner (perhaps alpha-masked via a shader as well), and above that, the blips.
  8. Investor

    Using table instead of setElementData

    I've heard some say that custom event triggers may be slower than element data when it comes to syncing up with clients unless you only do it when necessary rather than on each change. If you're intending on sharing the data on the server-side only, you should simply set the 4th argument to false in setElementData. Exported functions travel from one LuaVM through C/C++ into a different LuaVM and back to your resource via C/C++. This is slower than simply using element data which only goes from LuaVM to C/C++ and back to your LuaVM (LuaVM is an instance of Lua being run under the hood, separating Lua contexts between resources). As long as you don't sync set element data, it would provide better speed than custom system with exports. A custom system would probably run faster if you keep everything in one resource though, but that's at the price of modularity.
  9. Investor

    Shader find or create

    I was gonna say you could try dxDrawPrimitive for this, but it's no good if you want curved edges, so you probably want a mask shader, perhaps using dxDrawPrimitive to generate the part which follows the cursor. You'll need to use either trianglestrip or trianglefan.
  10. Investor

    MTA | WARNING: destroyElement

    Line 528 et seq if elementBackpack[source] then detachElementFromBone(elementBackpack[source]) destroyElement(elementBackpack[source]) end should be if elementBackpack[source] then detachElementFromBone(elementBackpack[source]) destroyElement(elementBackpack[source]) elementBackpack[source] = false end and that should fix it. Problem was removeAttachedOnDeath not marking the backpack as removed and the code trying to remove it again when it did not exist anymore.
  11. Investor

    MTA | WARNING: destroyElement

    Also don't just post the whole code but narrow in on the couple of lines that are relevant. Don't just state what the error is, state when it occurs, what happens and what was supposed to happen. We can easily solve the error message popping up by sort of suppressing it, but that doesn't solve the underlying issue (if there is any). If there's no problems at all, just error/warning spam, then say that. Don't just drop the code down here like its a mailbox. Easy fix: Remove line 88. No error anymore. But that's not helpful. Tell us what you want and we'll tell you how to do it. 'destroyElement' occurs 81 times in the shared code. How are we supposed to find the one you're talking about without line numbers? If you bothered reading the guidelines you'd had known adding code snipped tags will give us line numbers.
  12. Well, the source code seems to suggest that that should work. It was added in 1.5.4 on February 22, 2017. Are you sure you're running the latest version of both client and server? You should probably check if it works on other servers or something, and if so, perhaps this needs to be reported as a bug.
  13. Setting each to dimension="-1" should make the objects visible in all dimensions.
  14. Investor

    getPlayersInTeam help

    local theTeam = "Thugs" local players = getPlayersInTeam(getTeamFromName(theTeam)) -- this part will break with debug error, getPlayersInTeam expecting team got nil, if a team under that name does not exist if (#players >= 5) then -- count (#) the values in the table outputChatBox("Thugs: There are already 5 of your members ",source) end
  15. Investor

    Does it make sense to use ACL?

    ACLs are uniform and convenient - and integrate very well between multiple resources (especially community resources), while custom permissions would likely require exports, and thus can become broken if the permissions resource isn't turned on in time, for example. If you use the default MTA account system, there's no reason not to use ACLs. If you have your own accounts system, it's entirely up to you, but ACL integration is useful, especially due to being separate from the database -- if someone makes unauthorised database changes, ACLs are unaffected, and vice versa, when ACLs are changed, the database remains unaffected.