Jump to content

Disable carmods


~Air

Recommended Posts

Posted

Not that I know of, you could ofcourse use all the basic textures and load them as a script but I could create some lagg.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

try this (i have not tried)

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

Inactivo.

Posted

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)

Posted

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> 

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

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]

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

If you find my post useful or if it helped you, please like my post :)
Ingame name: ZoeN

560x95_FFFFFF_FF9900_000000_000000.png

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

If you find my post useful or if it helped you, please like my post :)
Ingame name: ZoeN

560x95_FFFFFF_FF9900_000000_000000.png

Posted

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.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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...