Script Change map
so this is my script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptAreaCorpsespawn", "SpawnCorpse1", true, 1);
AddEntityCollideCallback("Player", "HeadSpawn1", "SpawnHead1", true, 1);
AddEntityCollideCallback("Player", "Behind_you1", "Behind_You", true, 1);
AddEntityGeneral("Player", "Bed_room_door1", "ChangeMap1", true, 1);
}
void SpawnCorpse1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse1", true);
SetEntityActive("corpse2", true);
SetEntityActive("corpse3", true);
}
void SpawnHead1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("HeadbyOil", true);
}
void Behind_You(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Behind_you.ogg", false, 30, 2, 1, true);
}
void ChangeMap1(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound)
{
asMapName("Main_hall.map", true);
asStartPos("PlayerStart_Main_hall1", true);
asStartSound("door_mansion_open.ogg", true);
asEndSound("door_mansion_close.ogg", true);
}
and i cant get it to work.
|