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?
What would I put for the script if the SCars have no script? Correct me if i’m wrong please.