Forum

> > CS2D > Scripts > Lua mapchange
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua mapchange

3 replies
To the start Previous 1 Next To the start

old Lua mapchange

Surplus
User Off Offline

Quote
I want a script, that changes the map to the current map when i say "!restartserver".

heres what i got so far.

1
2
3
4
5
6
7
8
addhook("say","restartserver")
	function restartserver()
		if rp_ct[id]==true then
		if (text==!restartserver) then
			parse("I want current map here!")
end
end
end

PS: its for a RP script.

old Re: Lua mapchange

DannyDeth
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("say","restartserver")
function restartserver(id,txt)
	if txt=="!restartserver" and rp_ct[id]==true then
		local map = map("name")
		parse("restart")
		parse("sv_map "..map)
	else
		return 0
	end
end
There, however, if I remember correctly, CS2D keeps the current map when you restart. So half that code might be for nothing.

old Re: Lua mapchange

Surplus
User Off Offline

Quote
well... the cmd should restart the lua, because i am doing changes to the server currently.

EDIT:

1
2
3
4
5
6
7
8
9
10
addhook("say","restartserver")
function restartserver(id,txt)
     if txt=="!restartserver" and rp_ct[id]==true then
          local map = map("name")
          parse("restart")
          parse("map "..map)
     else
          return 0
     end
end

Fixed your fix

sv_map doesnt seem to be changing the map. So i changed it into map.

old Re: Lua mapchange

DannyDeth
User Off Offline

Quote
Well I'm sorry hey! Lol.

I had a feeling that wouldn't work. I guess you would have to do the sv_map before you resart. IDC really.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview