nightsxp
Member
Posts: 53
Threads: 8
Joined: Sep 2011
Reputation:
0
|
RE: i forgot how to script :c
(12-14-2012, 08:11 AM)beecake Wrote: What you want is first a collide script.
Your script should look like this:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "PlaySounds", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "TeleportToNextMap", true, 1);
}
void PlaySounds(string &in asParent, string &in asChild, int alState)
{
FadeOut(0);
AddTimer("Sound_1", 2, "CollideFunctionTimer_1");
AddTimer("Sound_2", 4, "CollideFunctionTimer_1");
}
void CollideFunctionTimer_1(string &in asTimer)
{
if(asTimer == "Sound_1")
{
PlaySoundAtEntity("Sound_1", "[SOUND].snt", "Player", 0, false);
}
if(asTimer == "Sound_2")
{
PlaySoundAtEntity("Sound_2", "[SOUND].snt", "Player", 0, false);
}
}
void TeleportToNextMap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("[MAPNAME].map", "PlayerStartArea_1", "", "");
}
Replace the Bold names with what they need. Oh.my.god.Thank you a lot!! aand..can you explain what does (string &in asParent, string &in asChild, int alState) mean?
|
|
12-14-2012, 08:23 AM |
|