Jump to content

Forums

  1. Multi Theft Auto: San Andreas 1.x

    1. Support for MTA:SA 1.x

      HELP! HELP! Need help? Post here.

      53.9k
      posts
    2. User Guides

      These guides are a good place to start learning how to achieve certain things within MTA in an efficient and well mannered way.

      11
      posts
    3. Open Source Contributors

      This space is for contributors to discuss the development of MTA. No user suggestions/support.

      1.3k
      posts
    4. Suggestions

      Suggestions and requests go here. Please note that actual feature requests must be filed on our GitHub.

      7.7k
      posts
    5. Ban appeals

      Use this forum to appeal your GLOBAL MTA:SA bans. Permanent bans only - appeals for timed ones (eg. 24 hours) will be refused.

      Do not use it for appealing server-specific bans as we do not have power over these specific servers.

      4.6k
      posts
  2. General MTA

    1. News

      News and updates on Multi Theft Auto.

      9.6k
      posts
    2. Media

      User-made screens and movies go here.

      4.4k
      posts
    3. Site/Forum/Discord/Mantis/Wiki related

      Share your comments & concerns about our services.

      5.4k
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!

      2.1k
      posts
    5. 328.2k
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      259.1k
      posts
    2. Maps

      Discussions for maps on various gamemodes.

      13.3k
      posts
    3. Resources

      Everything else about resources.

      28.3k
      posts
    4. Other Creations & GTA modding

      This section includes things such as GUI themes, forum userbars, user-created MTA logos, etc. Also contains topics which cover general GTA modding areas that can be used in MTA, such as modelling.

      2.3k
      posts
    5. Competitive gameplay

      Discussions about various MTA-related competitive gameplay events. Also gang (clan) forums.

      26.7k
      posts
    6. Servers

      Looking for a server to play on? Looking for someone to host your server? Looking for a place to discuss with other server owners? Here's where to look.

      15.3k
      posts
  4. Other

    1. General

      Non-MTA discussions. Anything you want.

      38.1k
      posts
    2. Multi Theft Auto 0.5r2

      Discussion regarding Multi Theft Auto 0.5r2 for GTAIII and Vice City.

      651
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

      785
      posts
  5. Archive

    1. 144k
      posts
    2. Trash

      These posts have broken forum rules. They are stored here temporarily so offending users can see what they have done wrong.

      2k
      posts
  • Posts

    • function enable_shaders() if not shadersEnabled then -- code to enable shaders, for example: setWeather(15) setFogDistance(50) shadersEnabled = true outputChatBox("Shaders enabled.") else outputChatBox("Shaders are already enabled.") end end function disable_shaders() if shadersEnabled then -- code to disable shaders, for example: setWeather(0) setFogDistance(200) shadersEnabled = false outputChatBox("Shaders disabled.") else outputChatBox("Shaders are already disabled.") end end This example uses a global variable shadersEnabled to keep track of whether the shaders are currently enabled or disabled. The enable_shaders() function checks if the shaders are already enabled before enabling them, and the disable_shaders() function does the same for disabling the shaders. You would also need to initialize the global variable shadersEnabled to keep track of the current state of shaders, for example: shadersEnabled = false You would then need to add a command handler to listen for the "shaders on" and "shaders off" commands:   addCommandHandler("shaders", function(player, command, option) if option == "on" then enable_shaders() elseif option == "off" then disable_shaders() end end) Note that the code to actually enable and disable the shaders would depend on the specific technology you are using to implement the shaders, and in this example I provided an example of how to change the weather and fog distance, you may need to adjust that according to your needs.  
    • You can use getCameraMatrix: https://wiki.multitheftauto.com/wiki/GetCameraMatrix and setCameraMatrix https://wiki.multitheftauto.com/wiki/SetCameraMatrix
    • With all respect to the original creator of this resource, here is a mod downloader resource that I created and just published (free & open source like this resource). It supports encrypted models and is overall more customizable, so I'm leaving it here for anyone who'd like. Thank you for the inspiration!    
    • New v1.1.0 release! Full changelog here. It features the ability to have all mods in a category be grouped so they can be only activated/deactivated together + GUI updates + demo TP script update.
    • addEvent ( "aResource", true ) addEventHandler ( "aResource", root, function ( name, action ) if checkClient( "command."..action, source, 'aResource', action ) then return end local pname = getPlayerName ( source ) if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then local text = "" if ( action == "start" ) then if ( startResource ( getResourceFromName ( name ), true ) ) then text = "started" end elseif ( action == "restart" ) then if ( getResourceState ( getResourceFromName ( name ) ) == "running" ) then if ( restartResource ( getResourceFromName ( name ) ) ) then text = "restarted" end end elseif ( action == "stop" ) then if ( stopResource ( getResourceFromName ( name ) ) ) then text = "stopped" end elseif ( action == "delete" ) then if ( deleteResource ( getResourceFromName ( name ) ) ) then text = "deleted" end elseif ( action == "stopall" ) then if ( stopAllResources ( ) ) then text = "All Stopped" end end isso tudo está acima da linha que enviei anteriormente

Twitter Feed

×
×
  • Create New...