Hello, how I can make new spawnpoints for a gamemode or just "move" the current spawnpoints??
The exact entity varies by map, whether it's CS:S or DOD:S or HL2 or whichever, but it'll usually be info_player_start. There's a list of them in the [url=http://www.glua.me/bin/?path=/gamemodes/base/gamemode/player.lua]PlayerSelectSpawn[/url] hook.
Use the [url=http://wiki.garrysmod.com/page/Libraries/ents]ents library[/url] to find them, and ent:Move()/ent:Remove() to move or get rid of them. It'd probably be easiest if you looped through all the existing spawnpoints with ents.FindByClass() and then recreated them from a table of vectors, like so:
[lua]local spawnpoints = {
Vector(24,1059,480),
Vector(5105,2043,2910),
Vector(-1024,-1024,-1024)
}
for _, vector in pairs(spawnpoints) do
local point = ents.Create("info_player_start")
point:SetPos(vector)
point:Spawn()
end[/lua]
Thank you buddy. :)
Sorry, you need to Log In to post a reply to this thread.