PDA

View Full Version : need a solution for repeated error message in RC


khortez
02-06-2014, 02:42 AM
i was trying to create a gui window but for some reason i keep getting this error message: "Script: Function addcontrol not found " can someone tell me a solution for that?



edit: i don't think it's the code but if necessary, i'll provide it

editx2 : i still don't have a clue of why it was acting the way it did.. so if anyone wants to give me possible reasons for why it was saying that i would be grateful so i could fix it/prevent it in the future. though it's fine now

khortez
02-12-2014, 06:35 AM
function onCreated(){
new GuiShowImgCtrl("Selected_Pocket"){
x = 30;
y = 30;
height = 100;
width = 100;
}
}


was working fine, for awhile. then i got the error again, so i have to look back here once more for help. any ideas what's wrong?

Torankusu
02-12-2014, 10:20 AM
Have you tried naming the control a different name? (Removing the selected). Also you dont have clientside indicator in your snippet, but that part is under //#CLIENTSIDE right?

Shot in the dark.

khortez
02-12-2014, 05:20 PM
Have you tried naming the control a different name? (Removing the selected). Also you dont have clientside indicator in your snippet, but that part is under //#CLIENTSIDE right?

Shot in the dark.

yeah it's under //#CLIENTSIDE, and yeah it's had different names before, but it never makes a difference what name it is it feels like for this error to appear, as just to test it, i have used the default code provided in graal bible just to see if this error would appear and it did still. it oddly appears after i copy/paste my code from one weapon to another. at least that's the only time i can recall seeing it. the one single time i fixed it before, was when i had manually re-written the code from scratch, this time though apparently, that won't work. i'll try renaming the control again though. thanks for the help


edit: I just changed the name to "Pocket" then changed the control name to "Test_Window", it still for some reason can't create the control. Also just in case.. i notice it doesn't have an image set to it but, it doesn't matter because it won't allow me to create the control in the first place

beckett164
02-22-2014, 03:16 AM
I think that you may need to give the control a profile.

//#CLIENTSIDE
function onCreated() {
new GuiBitmapCtrl("MyGUI_Bitmap1") {
profile = GuiDefaultProfile; // <----- LIKE THIS
bitmap = "login_gradient_blue.png";
height = 80;
width = 120;
x = 687;
y = 258;
}


I'm just assuming that's how it goes because the client-rc gui compiler always generates controls like that.

MysticalDragon
02-24-2014, 05:35 PM
Looks the that container that's calling addcontrol is missing :O

khortez
03-24-2014, 09:24 PM
Looks the that container that's calling addcontrol is missing :O

Not entirely sure what you mean , but while i recognize this is a somewhat old thread, i'm posting my appreciation to those that helped me. for some time i actually thought i'd have to try and solo it somehow.

that said, what exactly did you mean by the container that's calling addcontrol is missing? i couldn't tell much difference because it looked the same as other GUI's i created code-wise. thanks again

Jakov_the_Jakovasaur
03-25-2014, 12:07 AM
hello!

if you are receiving this error in remote control then it appears '//#CLIENTSIDE' (no white spaces before or afterwards) is not being set properly, as only serverside functions should be producing such a message

if you add echo("test" SPC player.account); within onCreated, press F2, go to 'scripts', and you see your account name, then you will know it is occurring clientside as it should be, if you just see "test " within remote control chat then it is definitely occurring serverside

khortez
03-25-2014, 05:25 PM
hello!

if you are receiving this error in remote control then it appears '//#CLIENTSIDE' (no white spaces before or afterwards) is not being set properly, as only serverside functions should be producing such a message

if you add echo("test" SPC player.account); within onCreated, press F2, go to 'scripts', and you see your account name, then you will know it is occurring clientside as it should be, if you just see "test " within remote control chat then it is definitely occurring serverside

i guess that may have been something i overlooked when i copied/pasted my code into another weapon, however simple as it may have been, thanks for the help everyone