Forum
Scripts
Staff Spawn point
Staff Spawn point
12 replies
1

setpos command.
Dynamite07 has writtenWhat? How do you expect us to know what mod and map you are talking about.
Sry,im talking about deathmatch,happy town. I need Staff to spawn in staff house not in normal spawn place...
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
IsAdmin = {
	[88318] = true
}
AdminSpawn = {0, 0} -- x and y position (in tiles) where admins will be spawned
HookSpawn = function(id)
	if IsAdmin[player(id, "usgn")] then
		parse("setpos "..id.." "..(AdminSpawn[1] * 32 + 16).." "..(AdminSpawn[2] * 32 + 16))
	end
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Created By Salad Fingers --
-- on 2014.02.03 21:16 --
admins = {6943} -- Put staff's usgn here
stuff_x = 500 -- Cordinate X
stuff_y = 500 -- Cordinate Y
function table.contains(table, element)
for key, value in pairs(table) do
if value == element then
return true
end
end
end
addhook("spawn","staff_spawn")
function staff_spawn(id)
if table.contains(admins,player(id,"usgn")) then
parse("setpos "..id.." "..stuff_x.." "..stuff_y.."")
end
end
My noob script!
Tested and works fine
Marcell: It works but i think that something is wrong with cordinates,when i write them there (X,Y) it spawn me somewhere else,myb i cant find cordinates,i use it by
"Tile position 10l10"
edited 1×, last 24.04.14 02:26:04 pm
Marcell's script makes the player spawn at the chosen X and Y position in pixels, not in tiles.
Accurator: How can i find pixels? THX
1

Offline