Hey, I'm trying to make different spawn point on different maps.
My current code is:
[url]http://pastebin.com/Jt5XNGZk[/url]
(I had it in a pastbin, so was to lazy to find it again :3)
Anyway, can someone help me and tell me whats wrong? (I get NO errors)
According to your code, your map name should be lowercase. Also you're not getting errors because it was probably simply spawning your cars at (0,0,0).
[QUOTE=Crazy Quebec;20669757]According to your code, your map name should be lowercase. Also you're not getting errors because it was probably simply spawning your cars at (0,0,0).[/QUOTE]
I tried this to:
[lua]
CarSpawns = {}
CarSpawns["RP_EvoCity_v2d.bsp"] = Vector(54.040802, 5700.328125, 128.031250)
function ITEM:USE( ply )
local map = game.GetMap()
local ent = ents.Create("prop_vehicle_jeep_old")
ent:SetModel("models/jeep.mdl")
ent:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt")
for k, v in pairs(CarSpawns) do
if k == map then
ent:SetPos(v)
end
end
ent:Spawn()
end
[/lua]
Same result.
game.GetMap returns the name without the ".bsp" on the end. And, it's best if you do
[code]local map = string.lower(game.GetMap())
if string.lower(k) == map then[/code]
[QUOTE=Entoros;20669963]game.GetMap returns the name without the ".bsp" on the end. And, it's best if you do
[code]local map = string.lower(game.GetMap())
if string.lower(k) == map then[/code][/QUOTE]
Ye, I was just going to test that :) And thanks ill try that. :D
Sorry, you need to Log In to post a reply to this thread.