onv
Member
Posts: 51
Threads: 12
Joined: Feb 2012
Reputation:
2
|
RE: clickable entities
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity)
asName - internal name (of the entity you want to click on)
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity
void CALLBACKNAMEHERE(string &in asEntity)
{
Commands here
}
Let's say i want to active a monster when picking a key , my script would be like that :
void OnStart ();
{
SetEntityPlayerInteractCallback("key_study_1", "ActivateMonster", true);
}
void ActiveMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
}
(This post was last modified: 02-12-2012, 09:25 PM by onv.)
|
|
02-12-2012, 09:20 PM |
|