Investor

Members
  • Content Count

    92
  • Joined

  • Last visited

Community Reputation

26 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,156 profile views
  1. 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.
  2. 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.
  3. 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.
  4. Setting each to dimension="-1" should make the objects visible in all dimensions.
  5. 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
  6. 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.
  7. Investor

    bone_attach - cannot resume dead coroutine

    How about setTimer( function() if not clearing_nonexisting_peds or coroutine.status (clearing_nonexisting_peds) == "dead" then clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds) end coroutine.resume(clearing_nonexisting_peds) end, 1000, 0 )
  8. Investor

    [HELP] Close Smoke Script

    I need information. I want the information to be complete when you create the topic. I need information because I don't understand your topic. If you "need script because you don't understand mtawiki.com" then I'm afraid you're in the wrong place. If you want someone else to do it for them, you better pay, or go look on Facebook maybe you'll have more luck there.
  9. Investor

    [HELP] Close Smoke Script

    I'm afraid I can't understand what you need. If possible, please try to rephrase the question, or seek support in your native language forum.
  10. Investor

    [HELP] Why not working playSound?

    For me, this link directs to youtubeinmp3.com which is a nonexistent domain name as it "might be temporarily down or it may have moved permanently to a new web address. (ERR_NAME_RESOLUTION_FAILED)" You can try addEventHandler("onClientSoundStream", root, function(succ, length, streamN, err) if not succ then outputChatBox("Sound: "..streamN.." failed to start: "..err,100,0,0) end end ) to see the reason for the failure to download/stream it.
  11. Investor

    [HELP] Return values ​​with triggers

    Trigger a custom event from A to B (e.g. "onRequestAccountDetails") B handles the event, and calculates a return Trigger a custom event back from B to A with the return value along it (e.g. "onReceiveAccountDetails") A handles this as if it were a callback function You can make your life easier by writing a wrapper that handles this as if it was proper callbacks, keeping a table that maps requests to callback functions, and calls them when the returning event comes, along with the return value. The other option is coroutines, which, while being a lot more complicated, allow you to pause ("yield") the execution of a script until the return value arrives from the other end, and returns the value as a return of a simple call. This imitates a blocking function, which pauses execution of the Lua script (doesn't freeze the whole client) until the return is available, as opposed to the traditional use of asynchronous functions that work via callbacks. This is because events are asynchronous, meaning it takes quite a bit of time for the data to travel from the client to the server or vice versa, longer than the execution of one instruction - so you either have to pause execution, or end the function at some point and continue on in a callback handler function when the return is ready.
  12. Investor

    engineRemoveShaderFromWorldTexture problem..

    The variable "shaderElement" refers to a different shader element than the "shaderElement" you've applied to world texture. Thus, this statement is inaccurate Specifically, the shaderElement at engineRemoveShaderFromWorldTexture is a shader that has just been created on line 31, rather than the one created and applied in lines 11 and 15. If you keep a reference to the shader in a table (named 'shaders' in example below), and insert every created shader into that table under a key of the element who which you've applied it, you'll be able to refer to it later on in different parts of the code. local shaders = {} function applyShader ( element, table, _type) if shaders[elem] then outputDebugString("Attempted to call applyShader when a shader is already applied") return end -- this blocks applying two shaders on the same element for index, value in pairs ( table ) do if ( index == 1 ) then model = value elseif ( index == 2 ) then textureName = value elseif ( index == 3 ) then texturePath = value end end shaders[element] = dxCreateShader ( "shader/shader.fx", 0, 0, false, _type == "skin" and "ped" or "vehicle" or "object" ) local textureElement = dxCreateTexture ( _type.."/textures/"..texturePath ) if ( shaders[element] and textureElement ) then dxSetShaderValue ( shaders[element], "Tex0", textureElement ) engineApplyShaderToWorldTexture ( shaders[element], textureName, element ) end end addEvent("shaders.applyShader", true) addEventHandler("shaders.applyShader", root, applyShader) function removeShader ( element, table, _type) for index, value in pairs ( table ) do if ( index == 1 ) then model = value elseif ( index == 2 ) then textureName = value elseif ( index == 3 ) then texturePath = value end end if ( shaders[element] and textureElement ) then engineRemoveShaderFromWorldTexture ( shaders[element], textureName, element ) destroyElement(shaders[element]) -- don't forget to destroy the shader shaders[element] = nil end end addEvent("shaders.removeShader", true) addEventHandler("shaders.removeShader", root, removeShader) If you need this to handle multiple shaders, you'll probably need to change how they're stored in the table, as this one only allows one shader to be stored at a time, and I'll leave that as an exercise for yourself.
  13. Investor

    DX Render order

    If I understood correctly, you're using two different event handlers for the windows? In that case, addEventHandler has a priority parameter, just set it to a higher priority on the event of the window/panel that you want drawn first and below (i.e. overlapped by the other one, which would be drawn later, on top)
  14. Investor

    Vehicles disappear on disconnect

    MTA doesn't destroy vehicles on disconnect, so it must be a script, and if you didn't write that in this resource than it's some other resource causing this.
  15. Investor

    SEND EMAIL MTA - Anybody know

    function sendMail(to, from, title, body) local function callbackfnc(result, msg) outputDebugString("callbackfnc: " .. result .. " (" .. msg .. ")") end callRemote("https://domain.tld/path/to/file.php", callbackfnc, to, from, title, body) end <?php include("mta_sdk.php"); if ($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']) { mta::doReturn(-1, "Remote access not allowed"); exit; } $input = mta::getInput(); if ( isset($input[0]) && isset($input[1]) && isset($input[2]) && isset($input[3]) ) { $to = $input[0]; $from = $input[1]; $subject = $input[2]; $message = $input[3]; $headers = "From: " . $input[1]; mail($to, $subject, $message, $headers); mta::doReturn(0, "Success"); } else { mta::doReturn(-1, "Invalid input"); } ?> And you need the PHP SDK (mta_sdk.php file) downloadable here: http://code.opencoding.net/mta/mtaphpsdk_0.4.zip This does not filter against malicious inputs, so make sure you never callRemote to the PHP file with unsanitised user input, or even better, don't use user input at all if possible (except the to email address I suppose)