HumiliatioN
Posting Freak
Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation:
18
|
RE: Add all simple scripts here!
(12-13-2010, 04:54 PM)Akumasama Wrote: void OnStart()
{
}
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
////////////////////////////
// Actual functions
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}
My bad, forgot the ";" after AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true).
This is also part of what you must learn to do.
Seek out the errors in your script.
Most of the the time, the error message you get, tells you where your error is, and what it's missing/wrong.
In your case, it should say something like: "Expected ";""
Oh i see.. Now it works.. hmm this takes time i know these errors but lines are confusing me sometimes. When main errors appears...
Thank you for this tutorial very helpful! I ask more error scripts if something is wrong
“Life is a game, play it”
|
|
12-13-2010, 05:00 PM |
|