Frictional Games Forum (read-only)

Full Version: PlayerInteractCallback how to let it trigger once.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well i made a nice event and i want that you only can click once or it or if you click it for the second time only a text appears like 'i better not touch it again' but how does that work?

Current script now
Spoiler below!

void SecretEvent2(string &in asEntity)
{
PlaySoundAtEntity("scare", "react_scare.snt", "Player", 1, true);
GiveSanityDamage(10, true);
AddTimer("", 1.0, "SecretEvent_Scare2");
SetPlayerLookSpeedMul(0.1);
SetPlayerRunSpeedMul(0.1);
}

void SecretEvent_Scare2(string &in asTimer)
{
GivePlayerDamage(20.0f, "BloodSplat", false, false);
AddTimer("", 2.0, "SecretEvent_Fade2");
FadePlayerRollTo(90, 1, 7);
MovePlayerHeadPos(0.25f, -0.3f, 0, 1, 0.5f);
GiveSanityDamage(100, true);
StartPlayerLookAt("GraveyardMonster", 4.0f, 4.0f, "");
SetEntityActive("GraveyardMonster", true);
ShowEnemyPlayerPosition("GraveyardMonster");
}

void SecretEvent_Fade2(string &in asTimer)
{
SetPlayerCrouching(true);
FadeOut(3);
AddTimer("", 4.0, "SecretEvent_ChangeMap2");
SetMessage("Messages", "SecretEvent3", 3.5);
StopPlayerLookAt();
}

void SecretEvent_ChangeMap2(string &in asTimer)
{
FadePlayerRollTo(0, 15, 90);
TeleportPlayer("BackFromGraveyard");
FadeIn(1);
SetPlayerRunSpeedMul(1);
SetPlayerLookSpeedMul(1);
PlayMusic("18_amb.ogg", true, 1, 1, 1, true);
AddTimer("", 4.0, "SecretEvent_TextReturn");
}

void SecretEvent_TextReturn(string &in asTimer)

{
SetMessage("Messages", "SecretEvent4", 5.0);
}


Already Thanks for helping Big Grin
(03-22-2013, 10:37 PM)Wapez Wrote: [ -> ]Check out the wiki.
http://wiki.frictionalgames.com/hpl2/amn..._functions

Im already doing that haha its getting better Smile