arvo95 Posted May 27, 2009 Author Share Posted May 27, 2009 Well, Here we go again:These both cases are not working```Case 3Call PutVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1", &GetPlayerSprite(index)&) Exit SubCase 4If GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1",1) ThenCall SetPlayerSprite(index, 1)ElseIf GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1",2) ThenCall SetPlayerSprite(index, 2)End SelectEnd Sub ```This is not working too…``` Case "/quests" If GetVar("FLAGS.ini", "QUESTS", GetPlayerName(index) & "Flag1") = 0 Then Call CustomMenuShow(index, "Quests", "\GUI\CUSTOM\test.bmp", 1) Call CustomMenuLabel(index, "First steps: Character: Scared man, Place: Near the castle of Burgh!", 50, 50, 25, 4, 2, 400, 20) Else Call CustomMenuShow(index, "Quests", "\GUI\CUSTOM\test.bmp", 1) Call CustomMenuLabel(index, "First steps: Congratz, Quest is already completed!", 50, 50, 25, 2, 2, 400, 20) End If Exit SubCase Else ```These both Cases aren't working:``` Select Case Menu_Type Case 1 If menu_title = "Warning!" Then If Clicked_Index = 0 Then Call PlayerWarp(Index, 1, 10, 10) Call BattleMsg(Index, "Welcome to the arena! Pwn0rz everything that moves!", BRIGHTGREEN, 0) Call CustomMenuClose(Index) End If End If Case 2 Case 3 If menu_title = "Miller" Then If Clicked_Index = 2 Then Call CustomMenuLabel(index, 4," Get out!", 50, 50, 10, 2, 2, 400, 20) End If End IfEnd SelectEnd Sub ```Ok, this is all for now. It looks like i am a shitty scripter, but i am only a noob in it, so please help me with it… :renzo: :icon_beer: :icon_crap: Link to comment Share on other sites More sharing options...
Antidote Posted May 27, 2009 Share Posted May 27, 2009 I might be totally wrong on all of this, as I'm not a very good scripter either, but lemme see what I can do:In the first part, it looks like you exited the sub right after Case 3….In the second section, I'm not really sure what's wrong.In the third section, there's nothing in Case 2. That might not mean anything, but I think it would screw the script up a bit...Hope I helped a bit... Link to comment Share on other sites More sharing options...
arvo95 Posted May 27, 2009 Author Share Posted May 27, 2009 Hmm… Maybe you are right about the first one, i am not sure about which one does stop the case End sub or Exit sub, but about third one you aren't right, because it is menu type Selection, if it was a regular case, then you would be right, but thanks anyway ;) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted May 27, 2009 Share Posted May 27, 2009 The first one:Line 2, your putvar is messed up.It should be:Call PutVar("FLAGS.ini", "Appear", "" & GetPlayerName(index) & "Flag1", "" & GetPlayerSprite(index) & "") Line 5 is completly messed up, and I'm not sure what you're trying to do… Are you trying to see if the value of GetVar is 1?If so, it would need to be:If GetVar("FLAGS.ini", "Appear", "" & GetPlayerName(index) & "Flag1") = "1" ThenLine 7 (assuming you're trying to get the number 2), should be:ElseIf GetVar("FLAGS.ini", "Appear", "" & GetPlayerName(index) & "Flag1") = "2" ThenAlso for Case 4, you are missing an End IfSecond one, I'm no good with Custom Menus, but on Line 2…You have a If GetVar = 0?Unless you manually go in there and change that value of the ini to 0, it will never be 0 (unless you use a putvar to make it 0 later in the script)... Either way, it should be:If GetVar("FLAGS.ini", "QUESTS", "" & GetPlayerName(index) & "Flag1") = "0" Then(because it's going to return a string (notice the quotes around "0"), you're trying to have it compare to a number.I haven't checked the custom menus@arvo95:> Hmm… Maybe you are right about the first one, i am not sure about which one does stop the case End sub or Exit sub, but about third one you aren't right, because it is menu type Selection, if it was a regular case, then you would be right, but thanks anyway ;)You can use "Exit Sub" as many times in a sub as you want; it's End Sub you can only use once. Link to comment Share on other sites More sharing options...
arvo95 Posted May 27, 2009 Author Share Posted May 27, 2009 Big thanks, Admiral, but it didn't help… And about the second... I have a PutVar for it... and it look like this:```Call PutVar("FLAGS.ini", "QUESTS", GetPlayerName(index) & "Flag1", 0)```And it is wrong… Link to comment Share on other sites More sharing options...
Admiral Refuge Posted May 27, 2009 Share Posted May 27, 2009 @arvo95:> Big thanks, Admiral, but it didn't help… And about the second... I have a PutVar for it... and it look like this:```> Call PutVar("FLAGS.ini", "QUESTS", GetPlayerName(index) & "Flag1", 0)> ```And it is wrong…That PutVar should be:Call PutVar("FLAGS.ini", "QUESTS", "" & GetPlayerName(index) & "Flag1", 0)Also, as far as it's not working, all of them are still not working? Link to comment Share on other sites More sharing options...
arvo95 Posted May 27, 2009 Author Share Posted May 27, 2009 Nope, it's not working… And Look how my Flags ini looks like, maybe it has a problem in it?```[QUESTS][Appear] ``` Link to comment Share on other sites More sharing options...
Bobosk Posted May 27, 2009 Share Posted May 27, 2009 ```Case 3Call PutVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1", &GetPlayerSprite(index)&) Exit Sub```You did this correctly, for the most part, but you only need 1 & "" with command only variables```Call PutVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1", &GetPlayerSprite(index)&)Call PutVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1", GetPlayerSprite(index) & "")``````Case 4If GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1",1) ThenCall SetPlayerSprite(index, 1)ElseIf GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1",2) ThenCall SetPlayerSprite(index, 2)End SelectEnd Sub```GetVar only has 3 variables, not 4 as you're trying to do here..```If GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1",1) ThenIf GetVar("FLAGS.ini", "Appear", GetPlayerName(index) & "Flag1") = "1" Then```And when altering a player's data(HP, MP, STR, etc.) it's usually a good idea to use```Call SendPlayerData(Index)```or one of the other send data commands their are.As Admiral has also said, you're missing an "End If"``` Case "/quests" If GetVar("FLAGS.ini", "QUESTS", GetPlayerName(index) & "Flag1") = 0 Then Call CustomMenuShow(index, "Quests", "\GUI\CUSTOM\test.bmp", 1) Call CustomMenuLabel(index, "First steps: Character: Scared man, Place: Near the castle of Burgh!", 50, 50, 25, 4, 2, 400, 20) ```Admiral is right about needing quotes around the 0, unless you're using Int(GetVar()) it will always return as a string.You're also not calling CustomMenuLabel() correctly```CustomMenuLabel( player_index, picture_index, caption, left, top, customsize, customcolour, alignment, width, height)Call CustomMenuLabel(index, "First steps: Character: Scared man, Place: Near the castle of Burgh!", 50, 50, 25, 4, 2, 400, 20) ``````Else Call CustomMenuShow(index, "Quests", "\GUI\CUSTOM\test.bmp", 1) Call CustomMenuLabel(index, "First steps: Congratz, Quest is already completed!", 50, 50, 25, 2, 2, 400, 20) End If Exit SubCase Else```Again, you're not calling custommenulabel() correctly``` Select Case Menu_Type Case 1 If menu_title = "Warning!" Then If Clicked_Index = 0 Then Call PlayerWarp(Index, 1, 10, 10) Call BattleMsg(Index, "Welcome to the arena! Pwn0rz everything that moves!", BRIGHTGREEN, 0) Call CustomMenuClose(Index) End If End If Case 2 Case 3 If menu_title = "Miller" Then If Clicked_Index = 2 Then Call CustomMenuLabel(index, 4," Get out!", 50, 50, 10, 2, 2, 400, 20) End If End IfEnd SelectEnd Sub```without seeing the code you're using to show these custom menues, can't really help you…SIDE NOTE: Check for syntax errors anywhere else in your main, and try testing your subs, by re-arranging them slightly, since broken subs mess up all subs below it(In most Eclipse versions)[edit]Before i forget, when using the CustomMenuLabel/CustomMenuPicture/CustomMenuTextBox you CAN'T skip Index numbers(Picture_index/CustomIndex). If you do, you will get some RTE 340 or 339 errors(i forget which).[/edit] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now