Squiddle Posted February 28, 2009 Author Share Posted February 28, 2009 Hi everyone. I'm having difficulties with my recent script. You see, I have a script which would reply "Open" if a certain variable is 1, or "Closed" if it's 0\. I can't seem to find the problem with it though, as when I click the button I get "Type Mismatch: String"Here's my code:``` If Clicked_Index = 21 Then If GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 0 Then Call PlayerMsg(Index, "Open", GREEN) ElseIf GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 1 Then Call PlayerMsg(Index, "Closed", GREEN) End If End If ```And this is my Minigames.ini located directly inside the Server\Scripts folder:```[SLYMEHUNTER]Game1Used=0Game1Timer=0``` Link to comment Share on other sites More sharing options...
Fruitpunch Posted February 28, 2009 Share Posted February 28, 2009 The Elseif should be an else Link to comment Share on other sites More sharing options...
Squiddle Posted February 28, 2009 Author Share Posted February 28, 2009 Like this?```If Clicked_Index = 21 Then If GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 0 Then Call PlayerMsg(Index, "Open", GREEN) Else Call PlayerMsg(Index, "Closed", GREEN) End If End If ```Because that's still giving me errors. Link to comment Share on other sites More sharing options...
Fruitpunch Posted February 28, 2009 Share Posted February 28, 2009 try this```Dim Slymehunter Slymehunter = GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") If Clicked_Index = 21 and Slymehunter = 0 Then Call PlayerMsg(Index, "Open", GREEN) Else Call PlayerMsg(Index, "Closed", GREEN) End If``` Link to comment Share on other sites More sharing options...
Squiddle Posted February 28, 2009 Author Share Posted February 28, 2009 TypeMismatch 'SlymeHunter' =(. Link to comment Share on other sites More sharing options...
Fruitpunch Posted March 1, 2009 Share Posted March 1, 2009 huh? Link to comment Share on other sites More sharing options...
Squiddle Posted March 1, 2009 Author Share Posted March 1, 2009 When I try that I get the RTE "TypeMismatch: 'SlymeHunter' Link to comment Share on other sites More sharing options...
Fruitpunch Posted March 1, 2009 Share Posted March 1, 2009 [http://www.touchofdeathforums.com/smf/index.php?topic=12254.0](http://www.touchofdeathforums.com/smf/index.php?topic=12254.0) Number 13 my friend Link to comment Share on other sites More sharing options...
Squiddle Posted March 1, 2009 Author Share Posted March 1, 2009 I checked over every single value, they're all correct. I've put parenthesies aroudn some of the values, but now I'm stuck with the same problem I had in the first place. Link to comment Share on other sites More sharing options...
Squiddle Posted March 1, 2009 Author Share Posted March 1, 2009 Nevermind, I found the solution. It turns out that I had my Minigames Ini as a Text Document, instead of a configuration document. Link to comment Share on other sites More sharing options...
Guest Posted March 1, 2009 Share Posted March 1, 2009 lolz Link to comment Share on other sites More sharing options...
Squiddle Posted March 1, 2009 Author Share Posted March 1, 2009 Probrably the most least-likely problem someone would figure out. Link to comment Share on other sites More sharing options...
Fruitpunch Posted March 1, 2009 Share Posted March 1, 2009 so im guessing it works now? Link to comment Share on other sites More sharing options...
Squiddle Posted March 1, 2009 Author Share Posted March 1, 2009 Yes, thank you =). But NOW I need help with timers. Posting a topic, please stand by… 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