SCars, Scripts, Class?

I have recently asked a question regarding spawning a jeep.


function BuyJeep(ply, ent)  
	if not ply:CanAfford(5000) then  
    Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "car"))  return ""  else
	ply:AddMoney(-5000)
	local jeep = ents.Create("prop_vehicle_jeep")  
	jeep:SetModel("models/buggy.mdl")  
	jeep:SetKeyValue("vehiclescript", "scripts/vehicles/jeep_test.txt")  
	jeep:SetPos(table.Random(CarJeepSpawn))
	jeep:SetAngles( Angle(0,180,0))
	jeep.Owner = ply 
	jeep:Own(ply)  
	jeep:Spawn()  
	jeep:Activate()
end
end
concommand.Add("buy_carjeep", BuyJeep)

How would I spawn the cars from SCars from this code?



local jeep = ents.Create(<class>)

Would I put lua/entites/<sent_Sakarias_Car_Police> for the class of that car? Or would I put prop_vehicle_jeep?


jeep:SetKeyValue("vehiclescript", "scripts/vehicles/jeep_test.txt"

What would I put for the script if the SCars have no script? Correct me if i’m wrong please.

GO into the addons folder of scars and entities and find the entity name of the car you want and simply spawn that ent, it will spawn with default settings.

So basically all the SCars run off of prop_vehicle_jeep? And they take the jeep script?

Wrong, they are entities, not vehicles.
You simply create the entity with the entity name.
addons\SCars\lua\entities

For example the hummer’s entity name would be sent_Sakarias_Car_hummer

Thanks, but you only answered one part of my question.

Would I put lua/entites/<sent_Sakarias_Car_Police> for the class of that car? Or would I put prop_vehicle_jeep?

jeep:SetKeyValue(“vehiclescript”, “scripts/vehicles/jeep_test.txt” What would I put for the script if the SCars have no script? Correct me if i’m wrong please.

function BuyJeep(ply, ent)
if not ply:CanAfford(5000) then
Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, “car”)) return “” else
ply:AddMoney(-5000)
local jeep = ents.Create(“sent_Sakarias_Car_Police”)
jeep:SetPos(table.Random(CarJeepSpawn))
jeep:SetAngles( Angle(0,180,0))
jeep.Owner = ply
jeep:Own(ply)
jeep:Spawn()
jeep:Activate()
end
end
concommand.Add(“buy_carjeep”, BuyJeep)

That helped thank you, one problem when it spawns the wheels go flat and are pushed up on the bottom of the car frame… any ideas of the cause?

http://cloud.steampowered.com/ugc/630733216214239224/54CD9A6014C0A38A955F03757CAB8ABB8543ECDB/

I don’t know, works fine on my DarkRP server. Try another car it’s frame may be too heavy.

[editline]6th December 2011[/editline]

You can also lift it up and redo wheels with wheel tool.

One thing I want to say is that . The frame being to heavy is literally impossible because I can spawn it with the toolgun and it works perfectly. When I spawn it with the Snpc it’s not the same.

If you could add me on
http://steamcommunity.com/id/Infernofication/

Just try lifting it up and placing the wheels again, or have it spawn off ground a tad.

Im not gonna place wheels everytime someone spawns it and it is pretty far off the ground when it spawns. Why cant you add me so you can join my server and see for yourself?

Found one problem. Wheels dont move when I spawn it from NPC. When I redo wheels they dont show up in the wheel position they are supposed to be in(probably because of npc)

Try a different model just to be safe, my server works fine with it.

I did try another model and the tires don’t work on any of them. I think i’ll just stick to drivable cars and not SCars.

You can also have them spawn in a fixed vector, not tr.hitpos

[editline]7th December 2011[/editline]

ADd me on steam aswell - nofear1999