On my DarkRP 2.5 server, things are beginning to finally work out well.
There is, however, one error.
Every time I sit in a chair or piano, the console is spammed with this error:
[ERROR] gamemodes/base/gamemode/animations.lua:155: attempt to call method 'GetAllowWeaponsInVehicle' (a nil value)
1. HandlePlayerDriving - gamemodes/base/gamemode/animations.lua:155
2. unknown - gamemodes/base/gamemode/animations.lua:284
Can anyone please help me out with fixing this as soon as possible?
Change it to GetAllowWeaponsInVehicle or false.
[QUOTE=code_gs;44966705]Change it to GetAllowWeaponsInVehicle or false.[/QUOTE]
Come again? What am I changing exactly?
[url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/gamemode/animations.lua[/url]
Looking at it a bit closer, change
[code]if ( ply:GetAllowWeaponsInVehicle() && IsValid( ply:GetActiveWeapon() ) ) then[/code]
to
[code]if ( IsValid( ply:GetAllowWeaponsInVehicle() ) && ply:GetAllowWeaponsInVehicle() && IsValid( ply:GetActiveWeapon() ) ) then[/code]
[CODE]if ( ply:GetAllowWeaponsInVehicle() && IsValid( ply:GetActiveWeapon() ) ) then
local holdtype = ply:GetActiveWeapon():GetHoldType()
if ( !holdtype ) then return true end
if ( holdtype == "smg" ) then holdtype = "smg1" end
ply.CalcSeqOverride = ply:LookupSequence( "sit_" .. holdtype )
end[/CODE]
It was already like that. This is how it has always been
No, paste the new code I provided.
[CODE] if ( IsValid( ply:GetAllowWeaponsInVehicle() ) && ply:GetAllowWeaponsInVehicle() && IsValid( ply:GetActiveWeapon() ) ) then
local holdtype = ply:GetActiveWeapon():GetHoldType()
if ( !holdtype ) then return true end
if ( holdtype == "smg" ) then holdtype = "smg1" end
ply.CalcSeqOverride = ply:LookupSequence( "sit_" .. holdtype )
end
end[/CODE]
Tried that, console was still spammed with the same errors.
Anything else to try?
Did you restart the server?
Yeah, I tried. Console is still spammed
Same error? That's odd; the if statement shouldn't progress since it was checked if it was nil first. Honestly, you could just comment the if statement and everything it contains out since it has to do with clientside animation with vehicle weapons; almost no addons use AllowWeaponsInVehicle.
How would I comment it out?
I'm sorry, I'm really new to Lua
[editline]1st June 2014[/editline]
This is what it looks like:
[IMG]http://i.gyazo.com/c349abdf7376d619826d04f083cedb88.png[/IMG]
Block comment from 155 to 163
[code]--[[ code
code
code ]][/code]
Thanks, the errors are gone.
One issue, why the h*** am I standing up in the chair?
An addon must be screwing with the weapon in chair animation. Uncomment the code when you've found the issue.
Sorry, you need to Log In to post a reply to this thread.