Forum

> > CS2D > Scripts > Change Map then Change Script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Change Map then Change Script

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Change Map then Change Script

SpriNG
User Off Offline

Zitieren
MOBSTAZ hat geschrieben
Hello! everyone

I'am looking for the map change then the script will be change! someone help me :x


So,you mean if you change a map the script should also change right? :x

Well,i think this too needs a script xD!

alt Re: Change Map then Change Script

Rainoth
Moderator Off Offline

Zitieren
Method A :
1
2
de_dust.map
de_dust.lua
Just rename lua file into your map file and put it in maps folder. Be sure that running map luas is allowed in server settings.

Method B :
1
2
3
4
5
6
7
AnyNameYouLikeOrWhatever.lua
-----
if map("name")=="de_dust" then
	msg("You're playing on de_dust")
elseif map("name")=="cs_office" then
	msg("You're playing on cs_office")
end

alt Re: Change Map then Change Script

TimeQuesT
User Off Offline

Zitieren
Replace "msg" in user Rainoth's script with "dofile" to execute separated files.

Here's a small example
1
2
3
4
5
if ((string.len(map("name") > 2) and (string.substr(map("name"), 2) == "gg")) then
	dofile("Gungame.lua"); --whenver the map prefix is gg a gungame script will be executed.
else
	dofile("Default.lua"); 
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht