Author Topic: Gmod gives me script errors whenever I get into a vehicle  (Read 2551 times)

so whenever I get into a vehicle I get this script error:
Code: [Select]
[ERROR] lua/autorun/client/clientvehiclescript.lua:4: attempt to index global 'gmod_vehicle_viewmode' (a nil value)
  1. v - lua/autorun/client/clientvehiclescript.lua:4
   2. unknown - l
and it keeps spamming itself in my console until I get out of the car.

do you have any vehicle-related add-ons enabled

do you have any vehicle-related add-ons enabled
yes

TDM cars

and a few others like SCars

yes

TDM cars

and a few others like SCars
did this happen before with those mods enabled?

try disabling them and see if it works

Paste the function that line is in.

Paste the function that line is in.
what do you mean, the error shows up whenever I get into a car, and I think it means that the 3rd person view has done something wrong and it wont function

what do you mean, the error shows up whenever I get into a car, and I think it means that the 3rd person view has done something wrong and it wont function

Go to the directory of the file, open it in a text editor, copy paste the function that contains line 4. Put it in code tags too so it doesn't destroy the indentation and spacing.

The convar "gmod_vehicle_viewmode" was removed in Garry's Mod 13. I can make a stuff fix for it in a bit.
« Last Edit: February 25, 2013, 09:47:55 PM by Zaure »

Disable both and re-launch Gmod and see if it works

Then enable SCars and try, TDM Cars might be the issue

http://pastebin.com/diy4BrDU
Assuming the code of that file I found on a SVN page is the same as yours, this will probably work for now (this is a stuff fix, I didn't make anything nice like a toggle feature). Replace all the code in the file with what's in the pastebin. If you want to go thirdperson/firstperson in those vehicles just set up a bind to go back and forth between "ef_vehicle_thirdperson 1" and "ef_vehicle_thirdperson 0".

Disable both and re-launch Gmod and see if it works

Then enable SCars and try, TDM Cars might be the issue

The mod he is using is old and uses a no longer available convar.


Replace all the code in the file with what's in the pastebin.
which file

which file

...
The file which is erroring. It's in the first post.

your stuff fix broke my gmod

ugguhguhsushuauhsuh

your stuff fix broke my gmod

ugguhguhsushuauhsuh
delete it and the garbage addons you have breaking/spamming the game