VitinhooxD Posted July 16, 2009 Author Share Posted July 16, 2009 Hi everyone.I 'm making a quest script and i have one problem heres the script:```Sub Questing(index)On Error Resume NextDim StatusDim NameDim Questing_msgDim Complete_msgDim NeedspaceDim ExpDim NeedDim NeedvalueDim GiveDim GivevalueDim Level_MsgDim MapDim ReqLevelMap = GetPlayerMap(index)ReqLevel = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "Level _Requeriment" , "LVL")Name = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , "Quest_Name")Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Status" , ""& map , "NotStarted")Status = GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Quest" , ""& map ) Select Case Status Case NotStartedLevel_Msg = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , " Lvl_Msg ") If GetPlayerLevel(Index) >= ReqLevel Then Call PlayerMsg(index , "test" , 4) Else Call CustomMenuClose(index) Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1) Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200) End If End SelectEnd Sub```The script should give the message test if the player have more level than the required in the ini file. The required is 1 and i'm level 32.But the script made it contrary.COuld someone help me?Thanks. Link to comment Share on other sites More sharing options...
DarkSpine Posted July 16, 2009 Share Posted July 16, 2009 I can't see anything wrong with the script…But maybe try switching the lv requirement script around, so replace``` If GetPlayerLevel(Index) >= ReqLevel Then Call PlayerMsg(index , "test" , 4) Else Call CustomMenuClose(index) Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1) Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200) End If```With``` If GetPlayerLevel(Index) < ReqLevel Then Call CustomMenuClose(index) Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1) Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200) End If If GetPlayerLevel(Index) >= ReqLevel Then Call PlayerMsg(index , "test" , 4) End If```If that doesn't work try this:``` If GetPlayerLevel(Index) < ReqLevel Then Call CustomMenuClose(index) Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1) Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200) Else Call PlayerMsg(index , "test" , 4) End If```I just don't see how it's messing up at all, I don't see a single actual error in it. Link to comment Share on other sites More sharing options...
VitinhooxD Posted July 16, 2009 Author Share Posted July 16, 2009 Still doesn't working correctly , but thanks for helping =( Link to comment Share on other sites More sharing options...
Bobosk Posted July 16, 2009 Share Posted July 16, 2009 when you're using select case with strings, you need to put quotes("") around the string Link to comment Share on other sites More sharing options...
VitinhooxD Posted July 16, 2009 Author Share Posted July 16, 2009 Using qoutes it makes the whole script doesn't work =( Link to comment Share on other sites More sharing options...
Bobosk Posted July 16, 2009 Share Posted July 16, 2009 ```Sub Questing(index)On Error Resume NextDim StatusDim NameDim Questing_msgDim Complete_msgDim NeedspaceDim ExpDim NeedDim NeedvalueDim GiveDim GivevalueDim Level_MsgDim MapDim ReqLevelMap = GetPlayerMap(index)ReqLevel = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "Level _Requeriment" , "LVL")Name = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , "Quest_Name")Call PutVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Status" , ""& map , "NotStarted")Status = GetVar("Scripts\charextras\" & GetPlayerName(index) & ".ini" , "Quest" , ""& map ) Select Case Status Case "NotStarted"Level_Msg = GetVar("Scripts\mapextras\" & GetPlayerMap(index) & ".ini" , "MSG" , " Lvl_Msg ") If GetPlayerLevel(Index) >= ReqLevel Then Call PlayerMsg(index , "test" , 4) Else Call CustomMenuClose(index) Call CustomMenuShow(index, "ALERT", "\GUI\CUSTOM\Quest.gif", 1) Call CustomMenuLabel(index, 20, ""& Level_Msg , 20, 80, 10, 0, 2, 400, 200) End If End SelectEnd Sub```i was talking about the```case Not Started```you need to put quotes around the```Not Started```like i did above, in the bigger code box Link to comment Share on other sites More sharing options...
VitinhooxD Posted July 16, 2009 Author Share Posted July 16, 2009 Yes i know i wrote Case "NotStarted" . 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