View Full Version : Function gotoLabel
Hello,
Ive been trying to do a function like this:
function cPosZ(posz, toback) --posz = Your z Position, toback = Label to go back.
if (Self.Position().z ~= posz) then
gotoLabel(tostring(toback))
end
end
But is not working, if I type the Label name instead of 'toback' it works but I want to set is a variable.
Could some1 help me to do that?
Thanks,
L!p3.
Infernal Bolt
06-07-2012, 03:26 PM
removing the tostring() thingy and adding your label with " around it will probably work.
removing the tostring() thingy and adding your label with " around it will probably work.
I can't try that cause the label name has a limited number of characters, I can't let it as: cPosZ(6, "Pos01").
Anyway I ddnt tryed that, Ill check and Edit the post asap.
Edit:
Can't even try, no way to write so many caracters..
But If its like cPosZ(toback) and toback = "Pos01" it worked.
Thanks =)
Infernal Bolt
06-07-2012, 03:36 PM
Yes you can, just change the label name in notepad, it works.
Yes you can, just change the label name in notepad, it works.
I did it, but if the label name contain " it wont load, no matter how many characters.
And with tostring() didn't worked.
<item text="cPosZ("Pos01"):" tag="255"/>
I think It read as: "cPosZ(" and later "Pos01" and ):"..
Got it?
XtrmJosh
06-07-2012, 04:55 PM
function cPosZ(posz, toback) --posz = Your z Position, toback = Label to go back.
if (Self.Position().z ~= posz) then
gotoLabel("toback")
end
end
Fixed?
function cPosZ(posz, toback) --posz = Your z Position, toback = Label to go back.
if (Self.Position().z ~= posz) then
gotoLabel("toback")
end
end
Fixed?
No, It will gotoLabel named as toback, not exectued as a variable so If u don't have this label it gonna just skip.
Infernal Bolt
06-07-2012, 06:05 PM
try it with ' then
try it with ' then
With ' worked! Thanks a lot guys!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.