Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
Unexpected error on my script.
I keep getting an unexpected error with my script... I have no idea what's wrong it says: main (51,2)
:ERR: Unexpected end of file.
Heres my script if you can help it would be much appreciated
////////////////////////////
// Run when entering map
void OnEnter()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void OnStart()
{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
void OnStart()
{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|
|
12-02-2011, 06:18 PM |
|
Khyrpa
Senior Member
Posts: 638
Threads: 10
Joined: Apr 2011
Reputation:
24
|
RE: Unexpected error on my script.
////////////////////////////
// Run when entering map
void OnEnter()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void OnStart()
{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
}
void OnStart()
{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
are you sure you are using c++ language or the configs recommended in wiki for notepad++ or whatever youre using? It makes spotting those bracket errors a lot easier
(This post was last modified: 12-02-2011, 07:23 PM by Khyrpa.)
|
|
12-02-2011, 07:23 PM |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
RE: Unexpected error on my script.
(12-02-2011, 07:23 PM)Khyrpa Wrote: ////////////////////////////
// Run when entering map
void OnEnter()
{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Door_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void OnStart()
{
AddUseItemCallback("","crowbar_1", "cdoor", "FUNCTION", true);
}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("crowbar_1");
}
void OnStart()
{
SetEntityConnectionStateChangeCallback("booklever", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
are you sure you are using c++ language or the configs recommended in wiki for notepad++ or whatever youre using? It makes spotting those bracket errors a lot easier
|
|
12-02-2011, 08:35 PM |
|
|