Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
RE: Script Problems
(03-06-2013, 03:47 PM)Coolfromdah00d Wrote: (03-05-2013, 10:19 PM)darksky Wrote: what's the exact error message?
unexpected token {
void OnStart (){
AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}
void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("YOLO", false, true);
PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false);
RemoveItem("StrangeDoorKey");
}
void OnEnter()
{
}
void OnLeave()
{
}
I am sorry... I am a beginner with codes....I'm not so old and I've looked everywhere I can on the page. I've remade the codes so many times I've lost the count. but I just cant find the error... it says ERR:25, 1 a function with the same name and parameters already exists. If you'd help me with this it'd be great. PS: I will try not to use you guys as my coders more.
(03-09-2013, 11:28 PM)Coolfromdah00d Wrote: (03-06-2013, 03:47 PM)Coolfromdah00d Wrote: (03-05-2013, 10:19 PM)darksky Wrote: what's the exact error message?
unexpected token {
void OnStart (){
AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("GuestRoomKey", "jump");
AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door01", false, true);
PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
RemoveItem("GuestRoomKey");
}
void jump(string &in asEntity, string &in type)
{
SetEntityActive("corpse01", true);
PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false);
StartScreenShake(0.5f, 2, 0, 0.25);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("YOLO", false, true);
PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false);
RemoveItem("StrangeDoorKey");
}
void OnEnter()
{
}
void OnLeave()
{
}
I am sorry... I am a beginner with codes....I'm not so old and I've looked everywhere I can on the page. I've remade the codes so many times I've lost the count. but I just cant find the error... it says ERR:25, 1 a function with the same name and parameters already exists. If you'd help me with this it'd be great. PS: I will try not to use you guys as my coders more.
I'm trying to fix so a key can open door YOLO
(This post was last modified: 03-09-2013, 11:29 PM by Coolfromdah00d.)
|
|
03-09-2013, 11:28 PM |
|
ExpectedIdentifier
Member
Posts: 234
Threads: 10
Joined: Sep 2012
Reputation:
11
|
RE: Script Problems
You've called two functions the same name.
|
|
03-10-2013, 02:21 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Script Problems
(03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.
It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
03-10-2013, 02:34 AM |
|
ExpectedIdentifier
Member
Posts: 234
Threads: 10
Joined: Sep 2012
Reputation:
11
|
RE: Script Problems
(03-10-2013, 02:34 AM)JustAnotherPlayer Wrote: (03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.
It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.
Yeah I saw that and it annoyed me but I didn't say anything haha.
|
|
03-10-2013, 02:35 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script Problems
Try this : void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoorYOLO", true); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
|
|
03-10-2013, 03:15 AM |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
RE: Script Problems
(03-10-2013, 02:34 AM)JustAnotherPlayer Wrote: (03-10-2013, 02:21 AM)sonataarctica Wrote: You've called two functions the same name.
It was UsedKeyOnDoor right? I bet this guy is a hipster. Why? he used the word "YOLO" a few times.
You know I hate all swagfags and yolo and shit. I just tried to name door02 someting else and the first thing that came up in my head was YOLO. so I tried it out......
(03-10-2013, 03:15 AM)No Author Wrote: Try this :void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoorYOLO", true); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
nope that didnt work. I can enter the map now but it says "cannot use this item this way" on strange door....
(This post was last modified: 03-10-2013, 11:50 AM by Coolfromdah00d.)
|
|
03-10-2013, 11:37 AM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script Problems
Strange door is the door named "YOLO" right ?
If so try this :
void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoorYOLO", true);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
(This post was last modified: 03-10-2013, 12:00 PM by No Author.)
|
|
03-10-2013, 12:00 PM |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
RE: Script Problems
(03-10-2013, 12:00 PM)No Author Wrote: Strange door is the door named "YOLO" right ?
If so try this :
void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoorYOLO", true);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
Still says cannot use this item this way
|
|
03-10-2013, 12:32 PM |
|
No Author
Posting Freak
Posts: 962
Threads: 10
Joined: Jun 2012
Reputation:
13
|
RE: Script Problems
This ?
void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoorYOLO", false);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
|
|
03-10-2013, 12:33 PM |
|
Coolfromdah00d
Junior Member
Posts: 38
Threads: 5
Joined: Mar 2013
Reputation:
0
|
RE: Script Problems
(03-10-2013, 12:33 PM)No Author Wrote: This ?
void OnStart (){ AddUseItemCallback("", "StrangeDoorKey", "YOLO", "UsedKeyOnDoorYOLO", false);
SetEntityCallbackFunc("GuestRoomKey", "jump"); AddUseItemCallback("", "GuestRoomKey", "door01", "UsedKeyOnDoor", false); }
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("door01", false, true); PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); RemoveItem("GuestRoomKey"); }
void jump(string &in asEntity, string &in type) { SetEntityActive("corpse01", true); PlaySoundAtEntity("", "12_girl_scream.snt", "corpse01", 0, false); StartScreenShake(0.5f, 2, 0, 0.25); }
void UsedKeyOnDoorYOLO(string &in asItem, string &in asEntity)
{ SetSwingDoorLocked("YOLO", false, true); PlaySoundAtEntity("", "Unlock_door", "YOLO", 0, false); RemoveItem("StrangeDoorKey"); }
void OnEnter() {
}
void OnLeave() {
}
nope
|
|
03-10-2013, 12:39 PM |
|
|