Jump to content

Disable carmods


~Air

Recommended Posts

I don't think it is possible since the player's GTA3.img (this is where textures and DFFs are loaded from) does not contain the original .dff file.

The first solution and not recommended is to force the player to download all stock vehicles .dff files and re-set them using MTA DFFs functions (engineLoadDFF, engineImportDFF)

Of course it's a hard work and waste of bandwidth since players with stock DFFs will have to download them aswell, but I know that MTA has a function to check if a certain player has vehicle mods or not (can't remember the function name right now), so maybe you can skip players with already original .dff files.

The second solution would be using the function to check if the player has mods or not, kick the player if they have and tell them to use only stock .dff files, but again, this could lead to players leaving your server since a single player won't uninstall all his mods only to play on one server (unless they are some kind of constant playing player on the server)

Link to comment

This is included in the mtaserver.conf file as far as I'm aware.

<!-- By default, the server will block the use of customized GTA:SA data files. --> 
<!-- To allow specific client files, add one or more of the following: --> 
<!-- client_file name="data/carmods.dat" verify="0" --> 
  
<!-- Comma separated list of disabled anti-cheats. 
For details see [url=https://wiki.multitheftauto.com/wiki/Anti-cheat_guide]https://wiki.multitheftauto.com/wiki/Anti-cheat_guide[/url] 
e.g. To disable anti-cheat #2 and #3, use: 2,3 --> 
<disableac></disableac> 

Link to comment

I tried this:

addEventHandler("onClientResourceStart", resourceRoot, 
function() 
     for i, v in ipairs(getElementsByType("vehicle")) do 
     local vehicleID = getVehicleModelFromName ( vehicle ) 
     engineRestoreModel ( v ) 
end 
end) 

But there is an error called:

Bad argument @getVehicleModelFromName [Expected string at argument 1, got nil]

Link to comment
        addEventHandler("onClientResourceStart", resourceRoot, 
        function() 
             for i, v in ipairs(getElementsByType("vehicle")) do 
             local vehicleID = getElementModel ( v ) 
             engineRestoreModel ( vehicleID ) 
        end 
        end) 

Link to comment

That's because getElementsByType, gets the elements by their type and stores it in a table. You're getting elements with the element type "vehicle". So what you will get is a vehicle element.

Use getElementModel instead.

Edit:

John beat me to it. However, I doubt this will make any difference. I'm pretty sure engineRestoreModel restores to whatever model is inside the GTA3.img.

So even if they did modify a vehicle, it would just restore it to the one they modified anyway. engineRestoreModel won't magically repair the GTA3.img to original.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...