attempt to call method 'GetPos' (a nil value) when trying to spawn vehicle

I’m trying to spawn a jeep with the ‘vehicles.PlayerSpawn’ command

the error:


[gamemodes\rebelnpcwar\gamemode\init.lua:151] attempt to call method 'GetPos' (a nil value)


the function in question:
[lua]function spawnbarricade(ply)
if ply:Team() == 1 then
local vehicle = vehicles.PlayerSpawn( player, “jeep”, player:GetPos() + player:GetAngles():Forward() * 64, player:GetAngles():Up() );
end
if ply:Team() == 2 then
RunConsoleCommand( “gm_spawn”, “models/props_combine/combine_barricade_short01a.mdl” )
end
end
[/lua]

let me know if you need me to post more of the code. Thanks!

( player, “jeep”, player:GetPos() + player:GetAngles():Forward() * 64, player:GetAngles():Up() )

ply, not player

Thanks for the help.

Unfortunately now it still doesn’t spawn (it just doesn’t display the error message)

[lua]function spawnbarricade(ply)
if ply:Team() == 1 then
local vehicle = vehicles.PlayerSpawn( ply, “jeep”, ply:GetPos() + ply:GetAngles():Forward() * 64, ply:GetAngles():Up() );
end
[/lua]

I have it rigged to a console command:
[lua]concommand.Add( “rnw_spawnbarricade”, spawnbarricade )
[/lua]

and when I set my team to 1 and put in the command nothing happens