Akselj Posted January 13, 2009 Author Share Posted January 13, 2009 Hi,I get an error with this small piece of code I use at JoinGame;```Dim BookPriceDim BookItemNumBookPrice = Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookPrice"))BookItemNum = Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookItemNum")) If GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","Borrowing") = "Yes" Then If Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime")) > 0 Then Call PutVar(Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime"))-1)) Call PlayerMsg(Index, "You have " & Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime")) " borrowing time left.", BRIGHTBLUE) End If If Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime")) = 0 Then If CanTake(Index, 4, BookPrice) = True Then Call TakeItem(Index, 4, BookPrice) Call PlayerMsg(Index, "You have been charged for not returning your book in the set time.", BRIGHTRED) Else Call PlayerMsg(Index, "You have been jailed for not returning your book in the set time, and not being able to pay.", BRIGHTRED) Call PlayerMsg(Index, "You will get out of jail next time you log in.", BRIGHTRED) Call PlayerMsg(Index, "You are blacklisted and can not borrow books from the library in a while.", BRIGHTRED) Call PlayerMsg(Index, "Your book will be taken.", BRIGHTRED) Call PlayerWarp(Index, 1, 0, 0) Call TakeItem(Index, BookItemNum, 0) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Blacklist", 5) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Jailed", "Yes") End If End If End If```Anyone knows what the error might be? Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 13, 2009 Share Posted January 13, 2009 Call PlayerMsg(Index, "You have " & Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime")) & " borrowing time left.", BRIGHTBLUE)This line, forgot a & :P Link to comment Share on other sites More sharing options...
Akselj Posted January 13, 2009 Author Share Posted January 13, 2009 Oh, I hate those nasty little syntax errors xDEDIT: Still does not work…. Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 13, 2009 Share Posted January 13, 2009 WEll thats ONE :o Link to comment Share on other sites More sharing options...
gizmo1 Posted January 13, 2009 Share Posted January 13, 2009 your error is were you define your value take off int, there is no point to it since there is no math in it. Link to comment Share on other sites More sharing options...
DarkMazer Posted January 14, 2009 Share Posted January 14, 2009 This line:Call PutVar(Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime"))-1))Syntax is wrong. You only have the file path and header for the GetVar, and forgot it for the PutVar. Link to comment Share on other sites More sharing options...
Akselj Posted January 14, 2009 Author Share Posted January 14, 2009 @DarkMazer:> This line:> Call PutVar(Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime"))-1))> Syntax is wrong. You only have the file path and header for the GetVar, and forgot it for the PutVar.What? I do have everything, I checked all my Get and Put Var's….. Explain what you mean. Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 14, 2009 Share Posted January 14, 2009 Hes right, your PutVar does this, PutVar(GetVar(Whatever), "HEADER", "THINGY", "Other Thingy")Red being missing. Now I know what you really want,PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime", Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime"))-1):D Link to comment Share on other sites More sharing options...
gizmo1 Posted January 14, 2009 Share Posted January 14, 2009 no thats put var, dark marine, the error is where he defines his dim, you can't use math (int) in the value. Link to comment Share on other sites More sharing options...
Akselj Posted January 14, 2009 Author Share Posted January 14, 2009 Still does not work. Link to comment Share on other sites More sharing options...
DarkMazer Posted January 14, 2009 Share Posted January 14, 2009 ```Dim BookPriceDim BookItemNumDim BorrowingTimeBookPrice = Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookPrice") & "")BookItemNum = Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookItemNum") & "")BorrowingTime = Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime") & "") If GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","Borrowing") = "Yes" Then If BorrowingTime > 0 Then BorrowingTime = BorrowingTime - 1 Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime", BorrowingTime) Call PlayerMsg(Index, "You have " & BorrowingTime & " borrowing time left.", BRIGHTBLUE) End If If BorrowingTime < 0 Then If CanTake(Index, 4, BookPrice) = True Then Call TakeItem(Index, 4, BookPrice) Call PlayerMsg(Index, "You have been charged for not returning your book in the set time.", BRIGHTRED) Else Call PlayerMsg(Index, "You have been jailed for not returning your book in the set time, and not being able to pay.", BRIGHTRED) Call PlayerMsg(Index, "You will get out of jail next time you log in.", BRIGHTRED) Call PlayerMsg(Index, "You are blacklisted and can not borrow books from the library in a while.", BRIGHTRED) Call PlayerMsg(Index, "Your book will be taken.", BRIGHTRED) Call PlayerWarp(Index, 1, 0, 0) Call TakeItem(Index, BookItemNum, 0) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Blacklist", 5) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Jailed", "Yes") End If End If End If```If that doesn't work, then there's probably some bug in the .ini file itself or the code that puts values into it. Link to comment Share on other sites More sharing options...
gizmo1 Posted January 14, 2009 Share Posted January 14, 2009 lmao dude, how many times do i have to SAY THIS!!!you dont need int, here is how it should look:```Dim BookPriceDim BookItemNumDim BorrowingTimeBookPrice = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookPrice")BookItemNum = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BookItemNum") BorrowingTime = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime") If GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","Borrowing") = "Yes" Then If BorrowingTime > 0 Then BorrowingTime = BorrowingTime - 1 Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime", BorrowingTime) Call PlayerMsg(Index, "You have " & BorrowingTime & " borrowing time left.", BRIGHTBLUE) End If If BorrowingTime < 0 Then If CanTake(Index, 4, BookPrice) = True Then Call TakeItem(Index, 4, BookPrice) Call PlayerMsg(Index, "You have been charged for not returning your book in the set time.", BRIGHTRED) Else Call PlayerMsg(Index, "You have been jailed for not returning your book in the set time, and not being able to pay.", BRIGHTRED) Call PlayerMsg(Index, "You will get out of jail next time you log in.", BRIGHTRED) Call PlayerMsg(Index, "You are blacklisted and can not borrow books from the library in a while.", BRIGHTRED) Call PlayerMsg(Index, "Your book will be taken.", BRIGHTRED) Call PlayerWarp(Index, 1, 0, 0) Call TakeItem(Index, BookItemNum, 0) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Blacklist", 5) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library", "Jailed", "Yes") End If End If End If``` Link to comment Share on other sites More sharing options...
Akselj Posted January 14, 2009 Author Share Posted January 14, 2009 Usally it works when I use Int… Link to comment Share on other sites More sharing options...
Dark_Marine_123 Posted January 14, 2009 Share Posted January 14, 2009 Did you try what I put? Because your PutVar is looking for a file and GetVar is there instead, so the putvar is writing a file in your server folder probably called anywhere from 1 ~ 10 (TAKE A LOOK :O)This would fix itPutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime", Int(GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "Library","BorrowingTime"))-1) Link to comment Share on other sites More sharing options...
Akselj Posted January 15, 2009 Author Share Posted January 15, 2009 No that won't fix it I tried.Anyways, with •RçÄÂIØØPHØR•'s script it still does not work; it gets past the script and does the normal JoinGame but doesn't do a shit to me… Yes, I set up the .INI correctly. Link to comment Share on other sites More sharing options...
gizmo1 Posted January 15, 2009 Share Posted January 15, 2009 lol, then there is an error in the above subs somewhere lol. it works for me in the source. Link to comment Share on other sites More sharing options...
Akselj Posted January 15, 2009 Author Share Posted January 15, 2009 It doesn't for me. Link to comment Share on other sites More sharing options...
gizmo1 Posted January 15, 2009 Share Posted January 15, 2009 lmao, send me your main.txt and i'll try to find your error. 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