EvoCity v33x car dealer

Hello, I’m clearly running a PERP server on Evocity v33x. And I’m trying to add some display cars for it. Now I’m almost there just a few things left too do.

So far I’ve got this code (Will post below) and Its not seeming to spawn in the map. Now I’m using Sickess car models and TDM ones too. This file is places under “lua/autorun/server/Cars.lua”.
I also want too add physics too the cars but like not drivable where someone can enter the vehicle and jack off with it :stuck_out_tongue: just want it too be solid. Then in-case they get moved or anything, they respawn back there position every 10 seconds.

Heres the code:
[lua]–PERP3 EvoCity v33x Car dealer display cars

–setpos 4745.954590 -4406.350098 202.338196;setang 24.999992 -75.522499 0.000008 (Charger)
local charger = ents.Create(“models/tdmcars/chargersrt8.mdl”)
charger:SetPos( Vector(4745.954590, -4406.350098, 202.338196) )
charger:SetAngle( Angle(24, -75, 0) )
charger:SetSkin( 1 )
charger:Spawn()

–setpos 4776.402832 -4522.560547 189.471466;setang 18.877470 85.844315 0.000012 (Dodge Pickup Truck)
local pickup = ents.Create(“models/tdmcars/dodgeram.mdl”)
pickup:SetPos( Vector(4776.402832, -4522.560547, 189.471466) )
pickup:SetAngle( Angle(18, 85, 0) )
pickup:SetSkin( 6 )
pickup:Spawn()

–setpos 5540.785645 -4580.003906 207.489166;setang 24.999998 34.447514 0.000017 (Mustang GT500)
local mustang = ents.Create(“models/tdmcars/gt500.mdl”)
mustang:SetPos( Vector(5540.785645, -4580.003906, 207.489166) )
mustang:SetAngle( Angle(24, 34, 0) )
mustang:SetSkin( 4 )
mustang:Spawn()

–setpos 5788.421875 -4328.022949 204.430878;setang 24.999994 168.320663 -0.000004 (Skyline)
local skyline = ents.Create(“models/tdmcars/skyline_r34.mdl”)
skyline:SetPos( Vector(5788.421875, -4328.022949, 204.430878) )
skyline:SetAngle( Angle(24, 168, 0) )
skyline:SetSkin( 2 )
skyline:Spawn()

–setpos 4872.523438 -3638.715820 180.786133;setang 25.000488 154.312057 0.000038 (Escalade)
local escalade = ents.Create(“models/sickness/cavalcadedr.mdl”)
escalade:SetPos( Vector(4872.523438, -3638.715820, 180.786133) )
escalade:SetAngle( Angle(0, 180, 0) )
escalade:SetSkin( 2 )
escalade:Spawn()

–setpos 5008.344727 -3562.712402 151.000092;setang 24.999857 -38.580429 0.000033 (DiabloV)
local diablo = ents.Create(“models/sickness/diablovt.mdl”)
diablo:SetPos( Vector(5008.344727, -3562.712402, 151.000092) )
diablo:SetAngle( Angle(0, 180, 0) )
diablo:SetSkin( 3 )
diablo:Spawn()

–setpos 5341.253906 -3535.223389 153.240860;setang 13.014093 -56.160892 0.000126 (SpeedO VAN)
local van = ents.Create(“models/sickness/speedodr.mdl”)
van:SetPos( Vector(5341.253906, -3535.223389, 153.240860) )
van:SetAngle( Angle(0, 180, 0) )
van:SetSkin( 1 )
van:Spawn()

–setpos 6216.588867 -6149.037598 171.284912;setang 24.999918 44.648518 -0.000235 (Vanquish)
local vanquish = ents.Create(“models/sickness/vanquish.mdl”)
vanquish:SetPos( Vector(6216.588867, -6149.037598, 171.284912) )
vanquish:SetAngle( Angle(24, 44, 0) )
vanquish:SetSkin( 3 )
vanquish:Spawn()

–setpos 5949.314941 -6019.810547 141.130402;setang 12.863108 -39.179600 -0.000141 (Murcielago)
local murcielago = ents.Create(“models/sickness/murcielago.mdl”)
murcielago:SetPos( Vector(5949.314941, -6019.810547, 141.130402) )
murcielago:SetAngle( Angle(12, -39, 0) )
murcielago:SetSkin( 2 )
murcielago:Spawn()

–setpos 3428.453369 -5941.519043 125.566170;setang 1.668597 -40.353207 -0.000179 (Huntly)
local huntly = ents.Create(“models/sickness/huntleydr.mdl”)
huntly:SetPos( Vector(3428.453369, -5941.519043, 125.566170) )
huntly:SetAngle( Angle(1, -80, 0) )
huntly:SetSkin( 4 )
huntly:Spawn()[/lua]

Can someone help me finish this code? Thanks!

You are trying to create an entity of whatever the model is. You need to create the entity and then set the model.

For example:
[lua]
local charger = ents.Create( “prop_physics” )
charger:SetModel( “models/tdmcars/chargersrt8.mdl” )
[/lua]

OK heres what I did:
[lua]
–PERP3 EvoCity v33x Car dealer display cars

–setpos 4745.954590 -4406.350098 202.338196;setang 24.999992 -75.522499 0.000008 (Charger)
local charger = ents.Create( “prop_physics” )
charger:SetModel(“models/tdmcars/chargersrt8.mdl”)
charger:SetPos( Vector(4818, -4546, 61) )
charger:SetAngle( Angle(0, -59, 0) )
charger:SetSkin( 1 )
charger:Spawn()

–setpos 4776.402832 -4522.560547 189.471466;setang 18.877470 85.844315 0.000012 (Dodge Pickup Truck)
local pickup = ents.Create( “prop_physics” )
pickup:SetModel(“models/tdmcars/dodgeram.mdl”)
pickup:SetPos( Vector(4816, -4326, 61) )
pickup:SetAngle( Angle(0, -117, 0) )
pickup:SetSkin( 6 )
pickup:Spawn()

–setpos 5540.785645 -4580.003906 207.489166;setang 24.999998 34.447514 0.000017 (Mustang GT500)
local mustang = ents.Create( “prop_physics” )
mustang:SetModel(“models/tdmcars/gt500.mdl”)
mustang:SetPos( Vector(5540.785645, -4580.003906, 61) )
mustang:SetAngle( Angle(0, 120, 0) )
mustang:SetSkin( 4 )
mustang:Spawn()

–setpos 5788.421875 -4328.022949 204.430878;setang 24.999994 168.320663 -0.000004 (Skyline)
local skyline = ents.Create( “prop_physics” )
skyline:SetModel(“models/tdmcars/skyline_r34.mdl”)
skyline:SetPos( Vector(5788.421875, -4328.022949, 61) )
skyline:SetAngle( Angle(0, 120, 0) )
skyline:SetSkin( 2 )
skyline:Spawn()

–setpos 4872.523438 -3638.715820 180.786133;setang 25.000488 154.312057 0.000038 (Escalade)
local escalde = ents.Create( “prop_physics” )
escalade:SetModel(“models/sickness/cavalcadedr.mdl”)
escalade:SetPos( Vector(4872.523438, -3638.715820, 61) )
escalade:SetAngle( Angle(0, 180, 0) )
escalade:SetSkin( 2 )
escalade:Spawn()

–setpos 5008.344727 -3562.712402 151.000092;setang 24.999857 -38.580429 0.000033 (DiabloV)
local diablo = ents.Create( “prop_physics” )
diablo:SetModel(“models/sickness/diablovt.mdl”)
diablo:SetPos( Vector(5008.344727, -3562.712402, 61) )
diablo:SetAngle( Angle(0, 180, 0) )
diablo:SetSkin( 3 )
diablo:Spawn()

–setpos 5341.253906 -3535.223389 153.240860;setang 13.014093 -56.160892 0.000126 (SpeedO VAN)
local van = ents.Create( “prop_physics” )
van:SetModel(“models/sickness/speedodr.mdl”)
van:SetPos( Vector(5341.253906, -3535.223389, 61) )
van:SetAngle( Angle(0, 180, 0) )
van:SetSkin( 1 )
van:Spawn()

–setpos 6216.588867 -6149.037598 171.284912;setang 24.999918 44.648518 -0.000235 (Vanquish)
local vanquish = ents.Create( “prop_physics” )
vanquish:SetModel(“models/sickness/vanquish.mdl”)
vanquish:SetPos( Vector(6216.588867, -6149.037598, 62) )
vanquish:SetAngle( Angle(0, 150, 0) )
vanquish:SetSkin( 3 )
vanquish:Spawn()

–setpos 5949.314941 -6019.810547 141.130402;setang 12.863108 -39.179600 -0.000141 (Murcielago)
local murcielago = ents.Create( “prop_physics” )
murcielago:SetModel(“models/sickness/murcielago.mdl”)
murcielago:SetPos( Vector(5949.314941, -6019.810547, 62) )
murcielago:SetAngle( Angle(0, -150, 0) )
murcielago:SetSkin( 2 )
murcielago:Spawn()

–setpos 3428.453369 -5941.519043 125.566170;setang 1.668597 -40.353207 -0.000179 (Huntly)
local huntly = ents.Create( “prop_physics” )
huntly:SetModel(“models/sickness/huntleydr.mdl”)
huntly:SetPos( Vector(3428.453369, -5941.519043, 61) )
huntly:SetAngle( Angle(0, 138, 0) )
huntly:SetSkin( 4 )
huntly:Spawn()[/lua]

But for some reason ONLY the charger spawned and no other car did :confused:

Any errors?

[editline]11th December 2011[/editline]

OK I’ve fixed this issue, apparently I was supposed to make SetAngle, ‘SetAngles’ then everything worked.

Now what next I need is I don’t like it how its just the car model. Can I anyway spawn with its script so its not so you know, frozen like a prop? Because wheels and such look weird :confused: Is there a way maybe I can make it run its car script?

Change the ent.Create to “prop_vehicle_jeep” instead of “prop_physics” and if you know where the vehicle script is then use

[lua]Vehicle:SetKeyValue( “vehiclescript”, “scripts/vehicles/example_vehicle.txt” )[/lua]

It’s important you set the vehicle script as it contains information about how far the wheels should be from the vehicle itself.

To freeze the vehicle use something like this

[lua]local entphys = ent:GetPhysicsObject()
if entphys:IsValid() then
entphys:Sleep()
end[/lua]