FlaW
Junior Member
Posts: 48
Threads: 9
Joined: Nov 2011
Reputation:
0
|
clickable entities
HI everyone . I have stypid question: how to create clickable entities ,i.e same script ,after clicking on it ,something happened.
Sorry for bad explanation, I don't know how to explain it differently. I hope you understand me
|
|
02-12-2012, 09:17 PM |
|
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 |
|
FlaW
Junior Member
Posts: 48
Threads: 9
Joined: Nov 2011
Reputation:
0
|
RE: clickable entities
Thank you. Not noticed.
(This post was last modified: 02-12-2012, 09:23 PM by FlaW.)
|
|
02-12-2012, 09:23 PM |
|
onv
Member
Posts: 51
Threads: 12
Joined: Feb 2012
Reputation:
2
|
RE: clickable entities
Np
(This post was last modified: 02-12-2012, 09:26 PM by onv.)
|
|
02-12-2012, 09:26 PM |
|